diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp index 78446e66e833..cd84b9ad3532 100644 --- a/caps/src/nsScriptSecurityManager.cpp +++ b/caps/src/nsScriptSecurityManager.cpp @@ -149,18 +149,13 @@ GetScriptContext(JSContext *cx) inline void SetPendingException(JSContext *cx, const char *aMsg) { JSAutoRequest ar(cx); - JSString *str = JS_NewStringCopyZ(cx, aMsg); - if (str) - JS_SetPendingException(cx, STRING_TO_JSVAL(str)); + JS_ReportError(cx, "%s", aMsg); } inline void SetPendingException(JSContext *cx, const PRUnichar *aMsg) { JSAutoRequest ar(cx); - JSString *str = JS_NewUCStringCopyZ(cx, - reinterpret_cast(aMsg)); - if (str) - JS_SetPendingException(cx, STRING_TO_JSVAL(str)); + JS_ReportError(cx, "%hs", aMsg); } // DomainPolicy members diff --git a/caps/tests/mochitest/Makefile.in b/caps/tests/mochitest/Makefile.in index 235a53a405d7..6af004e4d14d 100644 --- a/caps/tests/mochitest/Makefile.in +++ b/caps/tests/mochitest/Makefile.in @@ -46,6 +46,7 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk _TEST_FILES = test_bug423375.html \ + test_bug246699.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/caps/tests/mochitest/test_bug246699.html b/caps/tests/mochitest/test_bug246699.html new file mode 100644 index 000000000000..bfd3a0663761 --- /dev/null +++ b/caps/tests/mochitest/test_bug246699.html @@ -0,0 +1,61 @@ + + + + + Test for Bug 246699 + + + + + +Mozilla Bug 246699 +

+ +
+
+
+ + +