зеркало из https://github.com/mozilla/pjs.git
Better macro name, nit-pick on last checkin.
This commit is contained in:
Родитель
84744778aa
Коммит
3f993ab41a
|
@ -305,7 +305,7 @@ typedef struct Sprinter {
|
||||||
|
|
||||||
#define OFF2STR(sp,off) ((sp)->base + (off))
|
#define OFF2STR(sp,off) ((sp)->base + (off))
|
||||||
#define STR2OFF(sp,str) ((str) - (sp)->base)
|
#define STR2OFF(sp,str) ((str) - (sp)->base)
|
||||||
#define SET_STR(sp,str) ((sp)->offset = STR2OFF(sp, str))
|
#define RETRACT(sp,str) ((sp)->offset = STR2OFF(sp, str))
|
||||||
|
|
||||||
static JSBool
|
static JSBool
|
||||||
SprintAlloc(Sprinter *sp, size_t nb)
|
SprintAlloc(Sprinter *sp, size_t nb)
|
||||||
|
@ -729,7 +729,7 @@ DecompileSwitch(SprintStack *ss, TableEntry *table, uintN tableLength,
|
||||||
rval = QuoteString(&ss->sprinter, str, (jschar)'"');
|
rval = QuoteString(&ss->sprinter, str, (jschar)'"');
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
} else {
|
} else {
|
||||||
rval = JS_GetStringBytes(str);
|
rval = JS_GetStringBytes(str);
|
||||||
}
|
}
|
||||||
|
@ -986,7 +986,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
js_printf(jp, "\t%s:\n", rval);
|
js_printf(jp, "\t%s:\n", rval);
|
||||||
jp->indent += 4;
|
jp->indent += 4;
|
||||||
break;
|
break;
|
||||||
|
@ -997,7 +997,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
js_printf(jp, "\t%s: {\n", rval);
|
js_printf(jp, "\t%s: {\n", rval);
|
||||||
jp->indent += 4;
|
jp->indent += 4;
|
||||||
break;
|
break;
|
||||||
|
@ -1026,7 +1026,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
js_printf(jp, "%s", rval);
|
js_printf(jp, "%s", rval);
|
||||||
pc += js_CodeSpec[JSOP_INITCATCHVAR].length;
|
pc += js_CodeSpec[JSOP_INITCATCHVAR].length;
|
||||||
LOCAL_ASSERT(*pc == JSOP_ENTERWITH);
|
LOCAL_ASSERT(*pc == JSOP_ENTERWITH);
|
||||||
|
@ -1272,7 +1272,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
js_printf(jp, "\tcontinue %s;\n", rval);
|
js_printf(jp, "\tcontinue %s;\n", rval);
|
||||||
break;
|
break;
|
||||||
case SRC_CONTINUE:
|
case SRC_CONTINUE:
|
||||||
|
@ -1284,7 +1284,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
js_printf(jp, "\tbreak %s;\n", rval);
|
js_printf(jp, "\tbreak %s;\n", rval);
|
||||||
break;
|
break;
|
||||||
case SRC_HIDDEN:
|
case SRC_HIDDEN:
|
||||||
|
@ -1421,7 +1421,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!lval)
|
if (!lval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, lval);
|
RETRACT(&ss->sprinter, lval);
|
||||||
goto do_fornameinloop;
|
goto do_fornameinloop;
|
||||||
|
|
||||||
case JSOP_FORVAR:
|
case JSOP_FORVAR:
|
||||||
|
@ -1430,7 +1430,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!lval)
|
if (!lval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, lval);
|
RETRACT(&ss->sprinter, lval);
|
||||||
goto do_fornameinloop;
|
goto do_fornameinloop;
|
||||||
|
|
||||||
case JSOP_FORNAME:
|
case JSOP_FORNAME:
|
||||||
|
@ -1438,7 +1438,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!lval)
|
if (!lval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, lval);
|
RETRACT(&ss->sprinter, lval);
|
||||||
|
|
||||||
do_fornameinloop:
|
do_fornameinloop:
|
||||||
sn = js_GetSrcNote(jp->script, pc);
|
sn = js_GetSrcNote(jp->script, pc);
|
||||||
|
@ -1466,7 +1466,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!lval)
|
if (!lval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, lval);
|
RETRACT(&ss->sprinter, lval);
|
||||||
js_printf(jp, ".%s", lval);
|
js_printf(jp, ".%s", lval);
|
||||||
} else if (xval) {
|
} else if (xval) {
|
||||||
js_printf(jp, "[%s]", xval);
|
js_printf(jp, "[%s]", xval);
|
||||||
|
@ -1641,7 +1641,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!lval)
|
if (!lval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, lval);
|
RETRACT(&ss->sprinter, lval);
|
||||||
todo = Sprint(&ss->sprinter, "%s %s", js_delete_str, lval);
|
todo = Sprint(&ss->sprinter, "%s %s", js_delete_str, lval);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1687,7 +1687,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
lval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!lval)
|
if (!lval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, lval);
|
RETRACT(&ss->sprinter, lval);
|
||||||
todo = Sprint(&ss->sprinter, "%s%s",
|
todo = Sprint(&ss->sprinter, "%s%s",
|
||||||
js_incop_str[!(cs->format & JOF_INC)], lval);
|
js_incop_str[!(cs->format & JOF_INC)], lval);
|
||||||
break;
|
break;
|
||||||
|
@ -1872,7 +1872,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
todo = Sprint(&ss->sprinter, "%s%s", VarPrefix(sn), rval);
|
todo = Sprint(&ss->sprinter, "%s%s", VarPrefix(sn), rval);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2129,7 +2129,7 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||||
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
rval = QuoteString(&ss->sprinter, ATOM_TO_STRING(atom), 0);
|
||||||
if (!rval)
|
if (!rval)
|
||||||
return JS_FALSE;
|
return JS_FALSE;
|
||||||
SET_STR(&ss->sprinter, rval);
|
RETRACT(&ss->sprinter, rval);
|
||||||
js_printf(jp, "\texport %s\n", rval);
|
js_printf(jp, "\texport %s\n", rval);
|
||||||
todo = -2;
|
todo = -2;
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче