mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 822383 - Allow arbitrary proxies on the scope chain. r=luke
This commit is contained in:
parent
8547c57386
commit
efd3605ec9
@ -316,7 +316,7 @@ 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")
|
||||
MSG_DEF(JSMSG_UNUSED266, 266, 0, JSEXN_NONE, "")
|
||||
MSG_DEF(JSMSG_STRICT_FUNCTION_STATEMENT, 267, 0, JSEXN_SYNTAXERR, "in strict mode code, functions may be declared only at top level or immediately within another function")
|
||||
MSG_DEF(JSMSG_INVALID_FOR_IN_INIT, 268, 0, JSEXN_SYNTAXERR, "for-in loop let declaration may not have an initializer")
|
||||
MSG_DEF(JSMSG_CLEARED_SCOPE, 269, 0, JSEXN_TYPEERR, "attempt to run compile-and-go script on a cleared scope")
|
||||
|
@ -552,12 +552,14 @@ js::Execute(JSContext *cx, HandleScript script, JSObject &scopeChainArg, Value *
|
||||
if (!scopeChain)
|
||||
return false;
|
||||
|
||||
/* If we were handed a non-native object, complain bitterly. */
|
||||
if (!scopeChain->isNative()) {
|
||||
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_NON_NATIVE_SCOPE);
|
||||
return false;
|
||||
}
|
||||
JS_ASSERT(!scopeChain->getOps()->defineProperty);
|
||||
/* Ensure the scope chain is all same-compartment and terminates in a global. */
|
||||
#ifdef DEBUG
|
||||
RawObject s = scopeChain;
|
||||
do {
|
||||
assertSameCompartment(cx, s);
|
||||
JS_ASSERT_IF(!s->enclosingScope(), s->isGlobal());
|
||||
} while ((s = s->enclosingScope()));
|
||||
#endif
|
||||
|
||||
/* The VAROBJFIX option makes varObj == globalObj in global code. */
|
||||
if (!cx->hasRunOption(JSOPTION_VAROBJFIX)) {
|
||||
|
@ -476,7 +476,6 @@ inline bool
|
||||
DefVarOrConstOperation(JSContext *cx, HandleObject varobj, HandlePropertyName dn, unsigned attrs)
|
||||
{
|
||||
JS_ASSERT(varobj->isVarObj());
|
||||
JS_ASSERT(!varobj->getOps()->defineProperty || varobj->isDebugScope());
|
||||
|
||||
RootedShape prop(cx);
|
||||
RootedObject obj2(cx);
|
||||
|
Loading…
Reference in New Issue
Block a user