summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_window_define_nonconfigurable.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/base/test/test_window_define_nonconfigurable.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/base/test/test_window_define_nonconfigurable.html')
-rw-r--r--dom/base/test/test_window_define_nonconfigurable.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/dom/base/test/test_window_define_nonconfigurable.html b/dom/base/test/test_window_define_nonconfigurable.html
new file mode 100644
index 000000000..ad1cf7687
--- /dev/null
+++ b/dom/base/test/test_window_define_nonconfigurable.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1107443
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Test for Bug 1107443</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <script type="application/javascript">
+
+ /** Test for Bug 1107443 **/
+ try {
+ Object.defineProperty(window, "nosuchprop", { value: 5, configurable: false });
+ throw "didn't throw";
+ } catch (e) {
+ is(e instanceof TypeError, true,
+ "defineProperty(window) with a non-configurable property should " +
+ "throw a TypeError, instead got: " + e);
+ is(Object.getOwnPropertyDescriptor(window, "nosuchprop"), undefined,
+ 'Window should not have property after an attempt to define it failed');
+ }
+
+ Object.defineProperty(window, "nosuchprop", { value: 6 });
+ var desc = Object.getOwnPropertyDescriptor(window, "nosuchprop");
+ is(typeof(desc), "object", "Should have a property now");
+ todo_is(desc.configurable, true, "Property should be configurable");
+ is(desc.writable, false, "Property should be readonly");
+ is(desc.value, 6, "Property should have the right value");
+
+ Object.defineProperty(window, "nosuchprop2", { value: 7, configurable: true });
+ desc = Object.getOwnPropertyDescriptor(window, "nosuchprop2");
+ is(typeof(desc), "object", "Should have a property now");
+ is(desc.configurable, true, "Property should be configurable");
+ is(desc.writable, false, "Property should be readonly");
+ is(desc.value, 7, "Property should have the right value");
+ </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1107443">Mozilla Bug 1107443</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>