From 13df6efbae1dc3d5554ba403bd6dc95bf13642ae Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Fri, 26 Mar 2010 19:37:45 -0700 Subject: [PATCH] Bug 555104 - remove JS_ExecuteScriptPart (r=brendan) --- js/src/jsapi.cpp | 30 ------------------------------ js/src/jsapi.h | 12 ++++-------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 028893f584a..9e0e840feb9 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -4840,36 +4840,6 @@ JS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval) return ok; } -JS_PUBLIC_API(JSBool) -JS_ExecuteScriptPart(JSContext *cx, JSObject *obj, JSScript *script, - JSExecPart part, jsval *rval) -{ - JSScript tmp; - JSBool ok; - - /* Make a temporary copy of the JSScript structure and farble it a bit. */ - tmp = *script; - if (part == JSEXEC_PROLOG) { - tmp.length = tmp.main - tmp.code; - } else { - tmp.length -= tmp.main - tmp.code; - tmp.code = tmp.main; - } - - /* Tell the debugger about our temporary copy of the script structure. */ - const JSDebugHooks *hooks = cx->debugHooks; - if (hooks->newScriptHook) { - hooks->newScriptHook(cx, tmp.filename, tmp.lineno, &tmp, NULL, - hooks->newScriptHookData); - } - - /* Execute the farbled struct and tell the debugger to forget about it. */ - ok = JS_ExecuteScript(cx, obj, &tmp, rval); - if (hooks->destroyScriptHook) - hooks->destroyScriptHook(cx, &tmp, hooks->destroyScriptHookData); - return ok; -} - /* Ancient uintN nbytes is part of API/ABI, so use size_t length local. */ JS_PUBLIC_API(JSBool) JS_EvaluateScript(JSContext *cx, JSObject *obj, diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 4d8f1c1c931..4704bedf22c 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -2261,10 +2261,10 @@ extern JS_PUBLIC_API(JSString *) JS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, uintN indent); /* - * NB: JS_ExecuteScript, JS_ExecuteScriptPart, and the JS_Evaluate*Script* - * quadruplets all use the obj parameter as the initial scope chain header, - * the 'this' keyword value, and the variables object (ECMA parlance for where - * 'var' and 'function' bind names) of the execution context for script. + * NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj + * parameter as the initial scope chain header, the 'this' keyword value, and + * the variables object (ECMA parlance for where 'var' and 'function' bind + * names) of the execution context for script. * * Using obj as the variables object is problematic if obj's parent (which is * the scope chain link; see JS_SetParent and JS_NewObject) is not null: in @@ -2304,10 +2304,6 @@ JS_ExecuteScript(JSContext *cx, JSObject *obj, JSScript *script, jsval *rval); */ typedef enum JSExecPart { JSEXEC_PROLOG, JSEXEC_MAIN } JSExecPart; -extern JS_PUBLIC_API(JSBool) -JS_ExecuteScriptPart(JSContext *cx, JSObject *obj, JSScript *script, - JSExecPart part, jsval *rval); - extern JS_PUBLIC_API(JSBool) JS_EvaluateScript(JSContext *cx, JSObject *obj, const char *bytes, uintN length,