mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 620947. Be a little more careful getting properties from document.all. r=jst
This commit is contained in:
parent
f37460a48d
commit
571ccbe530
@ -8750,6 +8750,8 @@ nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JSObject *obj,
|
|||||||
|
|
||||||
result = node;
|
result = node;
|
||||||
cache = node;
|
cache = node;
|
||||||
|
} else {
|
||||||
|
result = nsnull;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
|
@ -133,6 +133,7 @@ _TEST_FILES = \
|
|||||||
file_bug593174_2.html \
|
file_bug593174_2.html \
|
||||||
test_bug612267.html \
|
test_bug612267.html \
|
||||||
test_bug617296.html \
|
test_bug617296.html \
|
||||||
|
test_bug620947.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
libs:: $(_TEST_FILES)
|
libs:: $(_TEST_FILES)
|
||||||
|
32
dom/tests/mochitest/bugs/test_bug620947.html
Normal file
32
dom/tests/mochitest/bugs/test_bug620947.html
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<!-- This test must be in quirks mode so it has a document.all -->
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=620947
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<title>Test for Bug 620947</title>
|
||||||
|
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||||
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=620947">Mozilla Bug 620947</a>
|
||||||
|
<p id="display"></p>
|
||||||
|
<div id="content" style="display: none">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<pre id="test">
|
||||||
|
<script type="application/javascript">
|
||||||
|
|
||||||
|
/** Test for Bug 620947 **/
|
||||||
|
is(-1 in document.all, false, "shouldn't be there");
|
||||||
|
is(document.all[-1], undefined, "shouldn't be able to get it");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user