remove dynamic equality

This commit is contained in:
2025-06-16 13:48:09 -05:00
parent 9c0565d34f
commit 794baf8598
70 changed files with 462 additions and 461 deletions

View File

@@ -14967,6 +14967,16 @@ static BOOL js_strict_eq2(JSContext *ctx, JSValue op1, JSValue op2,
tag1 = JS_VALUE_GET_NORM_TAG(op1);
tag2 = JS_VALUE_GET_NORM_TAG(op2);
/* throw on any mismatched non-numeric tags */
if (tag1 != tag2
&& !((tag1 == JS_TAG_INT || tag1 == JS_TAG_FLOAT64)
&& (tag2 == JS_TAG_INT || tag2 == JS_TAG_FLOAT64))) {
JS_ThrowTypeError(ctx,
"Strict equality: cannot compare two differing types");
goto done_no_free;
}
switch(tag1) {
case JS_TAG_BOOL:
if (tag1 != tag2) {
@@ -21768,13 +21778,8 @@ static __exception int next_token(JSParseState *s)
break;
case '=':
if (p[1] == '=') {
if (p[2] == '=') {
p += 3;
s->token.val = TOK_STRICT_EQ;
} else {
p += 2;
s->token.val = TOK_EQ;
}
p += 2;
s->token.val = TOK_STRICT_EQ;
} else if (p[1] == '>') {
p += 2;
s->token.val = TOK_ARROW;
@@ -21784,13 +21789,8 @@ static __exception int next_token(JSParseState *s)
break;
case '!':
if (p[1] == '=') {
if (p[2] == '=') {
p += 3;
s->token.val = TOK_STRICT_NEQ;
} else {
p += 2;
s->token.val = TOK_NEQ;
}
p += 2;
s->token.val = TOK_STRICT_NEQ;
} else {
goto def_token;
}
@@ -26424,12 +26424,6 @@ static __exception int js_parse_expr_binary(JSParseState *s, int level,
break;
case 5:
switch(op) {
case TOK_EQ:
opcode = OP_eq;
break;
case TOK_NEQ:
opcode = OP_neq;
break;
case TOK_STRICT_EQ:
opcode = OP_strict_eq;
break;