Fix bug 541530. r=jst sr=brendan

This commit is contained in:
Blake Kaplan 2010-03-04 13:44:42 -08:00
parent 5621f91d48
commit 5f9a4782f7
3 changed files with 8 additions and 49 deletions

View File

@ -584,7 +584,8 @@ static nsDOMClassInfoData sClassInfoData[] = {
WINDOW_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(Location, nsLocationSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
(DOM_DEFAULT_SCRIPTABLE_FLAGS &
~nsIXPCScriptable::ALLOW_PROP_MODS_TO_PROTOTYPE))
NS_DEFINE_CLASSINFO_DATA(Navigator, nsNavigatorSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
@ -6538,7 +6539,9 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSBool ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
::JS_GetStringLength(str), v, nsnull,
nsnull, JSPROP_ENUMERATE);
nsnull,
JSPROP_PERMANENT |
JSPROP_ENUMERATE);
if (!ok) {
return NS_ERROR_FAILURE;
@ -8155,7 +8158,9 @@ nsDocumentSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSString *str = JSVAL_TO_STRING(id);
JSBool ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
::JS_GetStringLength(str), v, nsnull,
nsnull, JSPROP_ENUMERATE);
nsnull,
JSPROP_PERMANENT |
JSPROP_ENUMERATE);
if (!ok) {
return NS_ERROR_FAILURE;

View File

@ -107,8 +107,6 @@ _TEST_FILES = \
grandchild_bug260264.html \
utils_bug260264.js \
test_bug531176.html \
test_bug534362.html \
iframe_bug534362.html \
test_bug531542.html \
test_bug456151.html \
$(NULL)

View File

@ -1,44 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=534362
-->
<head>
<title>Test for Bug 534362</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=534362">Mozilla Bug 534362</a>
<p id="display"></p>
<div id="content" style="display: none">
<iframe src="http://example.org/tests/dom/tests/mochitest/bugs/iframe_bug534362.html" name="testFrame" onload="changeLocation();"></iframe>
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 534362 **/
function checkSetterCalled(called, shouldCall)
{
is(called, shouldCall, "Setter " + (called ? "" : "not ") + "called.");
if (!shouldCall) {
SimpleTest.finish();
}
}
function changeLocation()
{
checkSetterCalled(setterCalled, true);
setterCalled = false;
frames["testFrame"].location.href = "javascript:";
checkSetterCalled(setterCalled, false);
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>