mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
252995: reordering script_toSource and script_toString, r=brendan
This commit is contained in:
parent
5f4bc4067d
commit
5f80275577
@ -72,13 +72,17 @@ static JSBool
|
||||
script_toSource(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||
jsval *rval)
|
||||
{
|
||||
uint32 indent;
|
||||
JSScript *script;
|
||||
size_t i, j, k, n;
|
||||
char buf[16];
|
||||
jschar *s, *t;
|
||||
uint32 indent;
|
||||
JSString *str;
|
||||
|
||||
indent = 0;
|
||||
if (argc && !js_ValueToECMAUint32(cx, argv[0], &indent))
|
||||
return JS_FALSE;
|
||||
|
||||
if (!JS_InstanceOf(cx, obj, &js_ScriptClass, argv))
|
||||
return JS_FALSE;
|
||||
script = (JSScript *) JS_GetPrivate(cx, obj);
|
||||
@ -91,9 +95,6 @@ script_toSource(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||
k = 0;
|
||||
s = NULL; /* quell GCC overwarning */
|
||||
} else {
|
||||
indent = 0;
|
||||
if (argc && !js_ValueToECMAUint32(cx, argv[0], &indent))
|
||||
return JS_FALSE;
|
||||
str = JS_DecompileScript(cx, script, "Script.prototype.toSource",
|
||||
(uintN)indent);
|
||||
if (!str)
|
||||
@ -133,10 +134,14 @@ static JSBool
|
||||
script_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||
jsval *rval)
|
||||
{
|
||||
JSScript *script;
|
||||
uint32 indent;
|
||||
JSScript *script;
|
||||
JSString *str;
|
||||
|
||||
indent = 0;
|
||||
if (argc && !js_ValueToECMAUint32(cx, argv[0], &indent))
|
||||
return JS_FALSE;
|
||||
|
||||
if (!JS_InstanceOf(cx, obj, &js_ScriptClass, argv))
|
||||
return JS_FALSE;
|
||||
script = (JSScript *) JS_GetPrivate(cx, obj);
|
||||
@ -145,9 +150,6 @@ script_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
indent = 0;
|
||||
if (argc && !js_ValueToECMAUint32(cx, argv[0], &indent))
|
||||
return JS_FALSE;
|
||||
str = JS_DecompileScript(cx, script, "Script.prototype.toString",
|
||||
(uintN)indent);
|
||||
if (!str)
|
||||
|
Loading…
Reference in New Issue
Block a user