зеркало из https://github.com/mozilla/pjs.git
Rename strict equality ops (cleanup pre-patch for 363536, r=igor).
This commit is contained in:
Родитель
a96f565dbe
Коммит
21fff0bea8
|
@ -3239,13 +3239,13 @@ interrupt:
|
|||
STORE_OPND(-1, BOOLEAN_TO_JSVAL(cond)); \
|
||||
JS_END_MACRO
|
||||
|
||||
BEGIN_CASE(JSOP_NEW_EQ)
|
||||
BEGIN_CASE(JSOP_STRICTEQ)
|
||||
NEW_EQUALITY_OP(==);
|
||||
END_CASE(JSOP_NEW_EQ)
|
||||
END_CASE(JSOP_STRICTEQ)
|
||||
|
||||
BEGIN_CASE(JSOP_NEW_NE)
|
||||
BEGIN_CASE(JSOP_STRICTNE)
|
||||
NEW_EQUALITY_OP(!=);
|
||||
END_CASE(JSOP_NEW_NE)
|
||||
END_CASE(JSOP_STRICTNE)
|
||||
|
||||
BEGIN_CASE(JSOP_CASE)
|
||||
pc2 = (jsbytecode *) sp[-2-depth];
|
||||
|
|
|
@ -3058,7 +3058,7 @@ Detecting(JSContext *cx, jsbytecode *pc)
|
|||
(pc += js_CodeSpec[op].length) < endpc) {
|
||||
op = (JSOp) *pc;
|
||||
return op == JSOP_EQ || op == JSOP_NE ||
|
||||
op == JSOP_NEW_EQ || op == JSOP_NEW_NE;
|
||||
op == JSOP_STRICTEQ || op == JSOP_STRICTNE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3730,12 +3730,12 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
|||
break;
|
||||
}
|
||||
|
||||
case JSOP_NEW_EQ:
|
||||
case JSOP_NEW_NE:
|
||||
case JSOP_STRICTEQ:
|
||||
case JSOP_STRICTNE:
|
||||
rval = POP_STR();
|
||||
lval = POP_STR();
|
||||
todo = Sprint(&ss->sprinter, "%s %c== %s",
|
||||
lval, (op == JSOP_NEW_EQ) ? '=' : '!', rval);
|
||||
lval, (op == JSOP_STRICTEQ) ? '=' : '!', rval);
|
||||
break;
|
||||
|
||||
BEGIN_LITOPX_CASE(JSOP_CLOSURE)
|
||||
|
|
|
@ -179,8 +179,8 @@ OPDEF(JSOP_TABLESWITCH, 70, "tableswitch", NULL, -1, 1, 0, 0, JOF_TABLES
|
|||
OPDEF(JSOP_LOOKUPSWITCH, 71, "lookupswitch", NULL, -1, 1, 0, 0, JOF_LOOKUPSWITCH|JOF_DETECTING)
|
||||
|
||||
/* New, infallible/transitive identity ops. */
|
||||
OPDEF(JSOP_NEW_EQ, 72, "eq", NULL, 1, 2, 1, 10, JOF_BYTE|JOF_DETECTING)
|
||||
OPDEF(JSOP_NEW_NE, 73, "ne", NULL, 1, 2, 1, 10, JOF_BYTE|JOF_DETECTING)
|
||||
OPDEF(JSOP_STRICTEQ, 72, "stricteq", NULL, 1, 2, 1, 10, JOF_BYTE|JOF_DETECTING)
|
||||
OPDEF(JSOP_STRICTNE, 73, "strictne", NULL, 1, 2, 1, 10, JOF_BYTE|JOF_DETECTING)
|
||||
|
||||
/* Lexical closure constructor. */
|
||||
OPDEF(JSOP_CLOSURE, 74, "closure", NULL, 3, 0, 0, 0, JOF_CONST)
|
||||
|
|
|
@ -137,7 +137,8 @@ JS_BEGIN_EXTERN_C
|
|||
* TOK_BITXOR binary pn_left: left-assoc ^ expr, pn_right: & expr
|
||||
* TOK_BITAND binary pn_left: left-assoc & expr, pn_right: EQ expr
|
||||
* TOK_EQOP binary pn_left: left-assoc EQ expr, pn_right: REL expr
|
||||
* pn_op: JSOP_EQ, JSOP_NE, JSOP_NEW_EQ, JSOP_NEW_NE
|
||||
* pn_op: JSOP_EQ, JSOP_NE,
|
||||
* JSOP_STRICTEQ, JSOP_STRICTNE
|
||||
* TOK_RELOP binary pn_left: left-assoc REL expr, pn_right: SH expr
|
||||
* pn_op: JSOP_LT, JSOP_LE, JSOP_GT, JSOP_GE
|
||||
* TOK_SHOP binary pn_left: left-assoc SH expr, pn_right: ADD expr
|
||||
|
|
|
@ -1581,7 +1581,7 @@ retry:
|
|||
|
||||
case '=':
|
||||
if (MatchChar(ts, c)) {
|
||||
tp->t_op = MatchChar(ts, c) ? JSOP_NEW_EQ : (JSOp)cx->jsop_eq;
|
||||
tp->t_op = MatchChar(ts, c) ? JSOP_STRICTEQ : (JSOp)cx->jsop_eq;
|
||||
tt = TOK_EQOP;
|
||||
} else {
|
||||
tp->t_op = JSOP_NOP;
|
||||
|
@ -1591,7 +1591,7 @@ retry:
|
|||
|
||||
case '!':
|
||||
if (MatchChar(ts, '=')) {
|
||||
tp->t_op = MatchChar(ts, '=') ? JSOP_NEW_NE : (JSOp)cx->jsop_ne;
|
||||
tp->t_op = MatchChar(ts, '=') ? JSOP_STRICTNE : (JSOp)cx->jsop_ne;
|
||||
tt = TOK_EQOP;
|
||||
} else {
|
||||
tp->t_op = JSOP_NOT;
|
||||
|
|
Загрузка…
Ссылка в новой задаче