Fix for bug 384122 (QueryInterface shouldn't be enumerable on DOM interface objects). r/sr=jst.

This commit is contained in:
peterv%propagandism.org 2007-06-14 10:03:45 +00:00
Родитель ea1021fd0e
Коммит 2d6441d5ac
3 изменённых файлов: 38 добавлений и 2 удалений

Просмотреть файл

@ -567,12 +567,14 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(Prototype, nsDOMConstructorSH,
DOM_BASE_SCRIPTABLE_FLAGS |
nsIXPCScriptable::WANT_HASINSTANCE)
nsIXPCScriptable::WANT_HASINSTANCE |
nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE)
NS_DEFINE_CLASSINFO_DATA(Constructor, nsDOMConstructorSH,
DOM_BASE_SCRIPTABLE_FLAGS |
nsIXPCScriptable::WANT_HASINSTANCE |
nsIXPCScriptable::WANT_CALL |
nsIXPCScriptable::WANT_CONSTRUCT)
nsIXPCScriptable::WANT_CONSTRUCT |
nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE)
// Core classes
NS_DEFINE_CLASSINFO_DATA(XMLDocument, nsDocumentSH,

Просмотреть файл

@ -53,6 +53,7 @@ _TEST_FILES = \
test_bug351601.html \
test_bug370098.html \
test_bug377539.html \
test_bug384122.html \
$(NULL)
libs:: $(_TEST_FILES)

Просмотреть файл

@ -0,0 +1,33 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=384122
-->
<head>
<title>Test for Bug 384122</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/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=384122">Mozilla Bug 384122</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 384122 **/
var foundQI = false;
for (var property in Node)
if (property == "QueryInterface")
foundQI = true;
is(foundQI, false,
"QueryInterface should not be enumerable on DOM interface objects");
</script>
</pre>
</body>
</html>