amilajack / amilajack/compat-db
Support for different JS contexts
- Vorherrschende Sprache
- JavaScript
- Sterne
- 64
- Forks
- 3
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Some tests can only be run in certain contexts. WebGL and Workers are examples of this. We currently do some primitive prototype lookups to check if an API is defined in the global context. For other contexts, we'll need to make some modifications:
example:
```js
// Try this in chrome, which has support for webgl:
WebGLRenderingContext.clearColor === undefined // true
// We need to do this instead:
const canvas = document.getElementById('glCanvas');
var webglContext = canvas.getContext('webgl')
webglContext.clearColor === undefined // false
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.