Skip to content

Commit c8f6d32

Browse files
committed
make JSRuntime.importValue consistent with ImportValueNode
1 parent 8f6edf5 commit c8f6d32

File tree

2 files changed

+3
-3
lines changed
  • graal-js/src

2 files changed

+3
-3
lines changed

graal-js/src/com.oracle.truffle.js.test/src/com/oracle/truffle/js/test/runtime/JSRuntimeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void testImportValue() {
165165
assertSame(42, JSRuntime.importValue((short) 42));
166166

167167
assertSame(42, JSRuntime.importValue(42L));
168-
assertEquals(BigInt.valueOf(Long.MAX_VALUE), JSRuntime.importValue(Long.MAX_VALUE));
168+
assertEquals(Long.MAX_VALUE, JSRuntime.importValue(Long.MAX_VALUE));
169169
assertEquals(42.0, (double) JSRuntime.importValue((float) 42), BIGDELTA);
170170

171171
try {

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSRuntime.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2816,7 +2816,7 @@ public static Object[] exportValueArray(Object[] arr) {
28162816

28172817
/**
28182818
* Convert the value to a type valid in Graal.js, from something received via TruffleInterop.
2819-
* Use JSForeignToJSTypeNode where possible.
2819+
* Use ImportValueNode where possible.
28202820
*/
28212821
@TruffleBoundary
28222822
public static Object importValue(Object value) {
@@ -2831,7 +2831,7 @@ public static Object importValue(Object value) {
28312831
if (longIsRepresentableAsInt(longValue)) {
28322832
return (int) longValue;
28332833
} else {
2834-
return BigInt.valueOf(longValue);
2834+
return longValue;
28352835
}
28362836
} else if (value instanceof Byte || value instanceof Short) {
28372837
return ((Number) value).intValue();

0 commit comments

Comments
 (0)