Skip to content

Commit 4e1ae12

Browse files
committed
Make interpreted mode consistently return integers too
1 parent 950fa43 commit 4e1ae12

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

rhino/src/main/java/org/mozilla/javascript/Interpreter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,13 +2150,11 @@ private static Object interpretLoop(Context cx, CallFrame frame, Object throwabl
21502150
}
21512151
case Icode_ZERO:
21522152
++stackTop;
2153-
stack[stackTop] = DBL_MRK;
2154-
sDbl[stackTop] = 0;
2153+
stack[stackTop] = Integer.valueOf(0);
21552154
continue Loop;
21562155
case Icode_ONE:
21572156
++stackTop;
2158-
stack[stackTop] = DBL_MRK;
2159-
sDbl[stackTop] = 1;
2157+
stack[stackTop] = Integer.valueOf(1);
21602158
continue Loop;
21612159
case Token.NULL:
21622160
stack[++stackTop] = null;

tests/src/test/java/org/mozilla/javascript/tests/es6/NumericSeparatorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class NumericSeparatorTest {
1616
/** Special Tokenizer test for numeric constant at end. */
1717
@Test
1818
public void numericAtEndOneDigit() {
19-
Utils.assertWithAllOptimizationLevelsES6(1.0, "1");
19+
Utils.assertWithAllOptimizationLevelsES6(1, "1");
2020
}
2121

2222
/** Special Tokenizer test for numeric constant at end. */

tests/testsrc/test262.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6187,7 +6187,6 @@ language/expressions/object 867/1169 (74.17%)
61876187
accessor-name-literal-numeric-exponent.js {strict: [-1], non-strict: [-1]}
61886188
accessor-name-literal-numeric-hex.js {strict: [-1], non-strict: [-1]}
61896189
accessor-name-literal-numeric-octal.js {strict: [-1], non-strict: [-1]}
6190-
accessor-name-literal-numeric-zero.js
61916190
computed-__proto__.js
61926191
concise-generator.js
61936192
cpn-obj-lit-computed-property-name-from-assignment-expression-coalesce.js

0 commit comments

Comments
 (0)