summaryrefslogtreecommitdiffstats
path: root/dom/bindings/test/test_dom_xrays.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /dom/bindings/test/test_dom_xrays.html
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/bindings/test/test_dom_xrays.html')
-rw-r--r--dom/bindings/test/test_dom_xrays.html23
1 files changed, 22 insertions, 1 deletions
diff --git a/dom/bindings/test/test_dom_xrays.html b/dom/bindings/test/test_dom_xrays.html
index 6d65ab7315..eafa0c632c 100644
--- a/dom/bindings/test/test_dom_xrays.html
+++ b/dom/bindings/test/test_dom_xrays.html
@@ -176,6 +176,27 @@ function test() {
// ECMAScript-defined properties live on the prototype, overriding any named properties.
checkXrayProperty(coll, "toString", [ undefined, undefined, win.Object.prototype.toString ]);
+ // Constructors
+ img = new win.Image();
+ ok(win.HTMLImageElement.isInstance(img), "Constructor created the right type of object");
+
+ let threw;
+ try {
+ threw = false;
+ win.Image();
+ } catch (e) {
+ threw = true;
+ }
+ ok(threw, "Constructors should throw when called without new");
+
+ try {
+ threw = false;
+ new win.Node();
+ } catch (e) {
+ threw = true;
+ }
+ ok(threw, "Constructing an interface without a constructor should throw");
+
// Frozen arrays should come from our compartment, not the target one.
var languages1 = win.navigator.languages;
isnot(languages1, undefined, "Must have .languages");
@@ -358,7 +379,7 @@ function test() {
// legacyCaller should work.
ok(win.HTMLAllCollection.isInstance(doc.all),
"HTMLDocument.all should be an instance of HTMLAllCollection");
- let element, threw;
+ let element;
try {
threw = false;
element = doc.all(0);