Skip to content

Commit

Permalink
Make interpreted mode consistently return integers too
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrail committed Aug 23, 2024
1 parent 8b7b580 commit c743a3f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions rhino/src/main/java/org/mozilla/javascript/Interpreter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2150,13 +2150,11 @@ private static Object interpretLoop(Context cx, CallFrame frame, Object throwabl
}
case Icode_ZERO:
++stackTop;
stack[stackTop] = DBL_MRK;
sDbl[stackTop] = 0;
stack[stackTop] = Integer.valueOf(0);
continue Loop;
case Icode_ONE:
++stackTop;
stack[stackTop] = DBL_MRK;
sDbl[stackTop] = 1;
stack[stackTop] = Integer.valueOf(1);
continue Loop;
case Token.NULL:
stack[++stackTop] = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class NumericSeparatorTest {
/** Special Tokenizer test for numeric constant at end. */
@Test
public void numericAtEndOneDigit() {
Utils.assertWithAllOptimizationLevelsES6(1.0, "1");
Utils.assertWithAllOptimizationLevelsES6(1, "1");
}

/** Special Tokenizer test for numeric constant at end. */
Expand Down
1 change: 0 additions & 1 deletion tests/testsrc/test262.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6187,7 +6187,6 @@ language/expressions/object 867/1169 (74.17%)
accessor-name-literal-numeric-exponent.js {strict: [-1], non-strict: [-1]}
accessor-name-literal-numeric-hex.js {strict: [-1], non-strict: [-1]}
accessor-name-literal-numeric-octal.js {strict: [-1], non-strict: [-1]}
accessor-name-literal-numeric-zero.js
computed-__proto__.js
concise-generator.js
cpn-obj-lit-computed-property-name-from-assignment-expression-coalesce.js
Expand Down

0 comments on commit c743a3f

Please sign in to comment.