mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Disallow non-native global objects (609990, r=brendan).
This commit is contained in:
parent
b4d33227f7
commit
6d6e6a903d
@ -345,3 +345,4 @@ MSG_DEF(JSMSG_SC_RECURSION, 262, 0, JSEXN_INTERNALERR, "recursive obje
|
||||
MSG_DEF(JSMSG_CANT_WRAP_XML_OBJECT, 263, 0, JSEXN_TYPEERR, "can't wrap XML objects")
|
||||
MSG_DEF(JSMSG_BAD_CLONE_VERSION, 264, 0, JSEXN_ERR, "unsupported structured clone version")
|
||||
MSG_DEF(JSMSG_CANT_CLONE_OBJECT, 265, 0, JSEXN_TYPEERR, "can't clone object")
|
||||
MSG_DEF(JSMSG_NON_NATIVE_SCOPE, 266, 0, JSEXN_TYPEERR, "non-native scope object")
|
||||
|
@ -947,6 +947,13 @@ Execute(JSContext *cx, JSObject *chain, JSScript *script,
|
||||
if (!innerizedChain)
|
||||
return false;
|
||||
|
||||
/* If we were handed a non-native object, complain bitterly. */
|
||||
if (!innerizedChain->isNative()) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
|
||||
JSMSG_NON_NATIVE_SCOPE);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Initialize frame. */
|
||||
frame.fp()->initGlobalFrame(script, *innerizedChain, flags);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user