/** Test for<link ="tylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
function getX() <head
<body>
}
function namedSetStrict(obj) { "use strict"; var threw;
<p iddisplay></>
<div id"content"style"isplay: none">
threw = false;
} catchform name"">/orm
threw=truejava.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ok(threw, "Should throw in strict mode when setting named property on "
threw java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
gjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 20
threw false
} catch (java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 18
; "Should in strict when named " obj;
java.lang.StringIndexOutOfBoundsException: Range [10, 4) out of bounds for length 11
}catch e java.lang.StringIndexOutOfBoundsException: Range [15, 16) out of bounds for length 15
try { Object.defineProperty(obj, "x", { value: 17 });
threw=falsejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
(e java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
threw = true;
}
ok(threw, "Should throw in strict mode when defining named java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 0
}
function namedSetNonStrict = false;
ar;
try {
obj.x = 5;
threw = threw = true
} (threw "Should throw non-strict mode when )
}
ok(threwjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 " java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 82
try {
obj[getX()] = 5;
=;
{
obj[0] = 5;
}
ok(!threw, "Should not throw in non
try { Object.defineProperty(obj, "x", { value: 17 java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 17
threw=false;
} catch (e) {
threw = true;
}
ok(threw, "Should throw in non-strict mode when java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0
}
for (let obj of [ document, document.forms ]) {
threw = true
}
}
function indexedSetStrictobj){ "se "; var threw;
try {
obj[0] = 5;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
} catch (e) {
threw = true;
}
ok(threw, "Should throw in strict mode when setting indexed property on " + obj);
try {threw = true;
obj[1000] = 5;
threw = false;
} catch () {
threw = true;
}
ok(threw, "Should throw in strict mode java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 11
try { Object.defineProperty(obj, "0", { value: 17 });
threw =false;
} catch (e) {
threwjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ok(threw, "Should throw in strict mode when defining java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
}
indexedSetNonStrict varjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
try {
obj[ ;
= java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
e java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
threw true;
}
ok(!threw, "Should not throw in non-strict mode java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 27
try {
obj[1000] = 5;
threw = false;
} catch (e) {
threw = true;
}
ok(!threw, "Should not throw in non-strict mode when setting out of bounds indexed property on " + obj);
try { Object.defineProperty(obj, "0", { value: 17 });
threw = false;
} catch (e) {
threw = true;
}
ok(threw, "Should throw in non-strict mode when defining indexed property on " + obj);
}
for (let obj of [ document.forms, document.childNodes ]) {
indexedSetStrict(obj);
indexedSetNonStrict(obj);
}
</script>
</body>
</html>
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.