/** Test for Bug 1215072 **/
try { var gl = document.createElement("canvas")
.getContext("webgl", { get stencil() { throw "bah (webgl)"; } });
ok(!gl, "Either should have thrown or not create a webgl context!");
} catch(ex) {
is(ex, "bah (webgl)", "Should have thrown an exception.");
}
try { var c = document.createElement("canvas")
.getContext("2d", { get alpha() {throw "bah (2d)"; } });
ok(!c, "Either should have thrown or not create a 2d context!");
} catch(ex) {
is(ex, "bah (2d)", "Should have thrown an exception.");
}
var gl2;
try {
gl2 = document.createElement("canvas").getContext("webgl", false);
gl2 = document.createElement("canvas").getContext("webgl", 123);
gl2 = document.createElement("canvas").getContext("webgl", "");
gl2 = document.createElement("canvas").getContext("webgl", undefined);
gl2 = document.createElement("canvas").getContext("webgl", null);
ok(true, "Shouldn't have thrown an exception!");
} catch(ex) {
ok(false, "Shouldn't have thrown an exception " + ex);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.