4 https://bugzilla.mozilla.org/show_bug.cgi?id=910220
8 <title>Test for Bug
910220</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=910220">Mozilla Bug
910220</a>
15 <div id=
"content" style=
"display: none">
16 <form name=
"x"></form>
20 <script type=
"application/javascript">
22 /** Test for Bug
910220 **/
28 function namedSetStrict(obj) {
38 "Should throw in strict mode when setting named property on " + obj);
47 "Should throw in strict mode when setting named property via SETELEM on " + obj);
50 Object.defineProperty(obj,
"x", { value:
17 });
56 "Should throw in strict mode when defining named property on " + obj);
58 function namedSetNonStrict(obj) {
67 "Should not throw in non-strict mode when setting named property on " + obj);
76 "Should not throw in non-strict mode when setting named property via SETELEM on" + obj);
79 Object.defineProperty(obj,
"x", { value:
17 });
85 "Should throw in non-strict mode when defining named property on " + obj);
87 for (let obj of [ document, document.forms ]) {
89 namedSetNonStrict(obj);
92 function indexedSetStrict(obj) {
102 "Should throw in strict mode when setting indexed property on " + obj);
111 "Should throw in strict mode when setting out of bounds indexed property on " + obj);
114 Object.defineProperty(obj,
"0", { value:
17 });
120 "Should throw in strict mode when defining indexed property on " + obj);
122 function indexedSetNonStrict(obj) {
131 "Should not throw in non-strict mode when setting indexed property on " + obj);
140 "Should not throw in non-strict mode when setting out of bounds indexed property on " + obj);
143 Object.defineProperty(obj,
"0", { value:
17 });
149 "Should throw in non-strict mode when defining indexed property on " + obj);
151 for (let obj of [ document.forms, document.childNodes ]) {
152 indexedSetStrict(obj);
153 indexedSetNonStrict(obj);