Fix a stupid mistake where an error return would cause us to not destroy a script. no bug, r=brendan

This commit is contained in:
mrbkap%gmail.com 2006-02-01 03:18:17 +00:00
parent 07cb0c3299
commit 877666903d

View File

@ -1266,10 +1266,9 @@ obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
*/
ok = js_CheckPrincipalsAccess(cx, scopeobj, principals,
cx->runtime->atomState.evalAtom);
if (!ok)
goto out;
if (ok)
ok = js_Execute(cx, scopeobj, script, caller, JSFRAME_EVAL, rval);
ok = js_Execute(cx, scopeobj, script, caller, JSFRAME_EVAL, rval);
JS_DestroyScript(cx, script);
out:
@ -2269,7 +2268,7 @@ js_FreeSlot(JSContext *cx, JSObject *obj, uint32 slot)
#if JS_BUG_EMPTY_INDEX_ZERO
#define CHECK_FOR_EMPTY_INDEX(id) \
JS_BEGIN_MACRO \
if (JSSTRING_LENGTH(_str) == 0) \
if (JSSTRING_LENGTH(str_) == 0) \
id = JSVAL_ZERO; \
JS_END_MACRO
#else