зеркало из https://github.com/mozilla/pjs.git
253125: script_exec ordering fix, r=brendan
This commit is contained in:
Родитель
91fa4a0ca0
Коммит
5da9812eba
|
@ -261,16 +261,13 @@ out:
|
|||
static JSBool
|
||||
script_exec(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
JSScript *script;
|
||||
JSObject *scopeobj, *parent;
|
||||
JSStackFrame *fp, *caller;
|
||||
JSPrincipals *principals;
|
||||
JSScript *script;
|
||||
|
||||
if (!JS_InstanceOf(cx, obj, &js_ScriptClass, argv))
|
||||
return JS_FALSE;
|
||||
script = (JSScript *) JS_GetPrivate(cx, obj);
|
||||
if (!script)
|
||||
return JS_TRUE;
|
||||
|
||||
scopeobj = NULL;
|
||||
if (argc) {
|
||||
|
@ -330,6 +327,10 @@ script_exec(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
if (!scopeobj)
|
||||
return JS_FALSE;
|
||||
|
||||
script = (JSScript *) JS_GetPrivate(cx, obj);
|
||||
if (!script)
|
||||
return JS_TRUE;
|
||||
|
||||
/* Belt-and-braces: check that this script object has access to scopeobj. */
|
||||
principals = script->principals;
|
||||
if (!js_CheckPrincipalsAccess(cx, scopeobj, principals,
|
||||
|
|
Загрузка…
Ссылка в новой задаче