Skip to content

Commit 3c49212

Browse files
committed
implement pr comments
1 parent cbcdb84 commit 3c49212

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

sdk/src/org.graalvm.webimage.api/src/org/graalvm/webimage/api/JSNumber.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,39 +122,39 @@ public int hashCode() {
122122

123123
@JS.Coerce
124124
@JS(value = "return isFinite(number);")
125-
public native static boolean isFinite(JSNumber number);
125+
public static native boolean isFinite(JSNumber number);
126126

127127
@JS.Coerce
128128
@JS(value = "return isFinite(number);")
129-
public native static boolean isFinite(double number);
129+
public static native boolean isFinite(double number);
130130

131131
@JS.Coerce
132132
@JS(value = "return Number.isInteger(number);")
133-
public native static boolean isInteger(JSNumber number);
133+
public static native boolean isInteger(JSNumber number);
134134

135135
@JS.Coerce
136136
@JS(value = "return Number.isInteger(number);")
137-
public native static boolean isInteger(double number);
137+
public static native boolean isInteger(double number);
138138

139139
@JS.Coerce
140140
@JS(value = "return isNaN(number);")
141-
public native static boolean isNaN(JSNumber number);
141+
public static native boolean isNaN(JSNumber number);
142142

143143
@JS.Coerce
144144
@JS(value = "return isNaN(number);")
145-
public native static boolean isNaN(double number);
145+
public static native boolean isNaN(double number);
146146

147147
@JS.Coerce
148148
@JS(value = "return Number.isSafeInteger(number);")
149-
public native static boolean isSafeInteger(JSNumber number);
149+
public static native boolean isSafeInteger(JSNumber number);
150150

151151
@JS.Coerce
152152
@JS(value = "return Number.isSafeInteger(number);")
153-
public native static boolean isSafeInteger(double number);
153+
public static native boolean isSafeInteger(double number);
154154

155155
@JS.Coerce
156156
@JS(value = "return Number.parseFloat(number);")
157-
public native static double parseFloat(String number);
157+
public static native double parseFloat(String number);
158158

159159
@JS.Coerce
160160
@JS(value = "return Number.parseInt(number);")
@@ -182,35 +182,35 @@ public static long parseInt(String number, int radix) {
182182

183183
@JS.Coerce
184184
@JS(value = "return Number.EPSILON;")
185-
public native static double EPSILON();
185+
public static native double epsilon();
186186

187187
@JS.Coerce
188188
@JS(value = "return Number.MAX_SAFE_INTEGER;")
189-
public native static long MAX_SAFE_INTEGER();
189+
public static native long maxSafeInteger();
190190

191191
@JS.Coerce
192192
@JS(value = "return Number.MAX_VALUE;")
193-
public native static double MAX_VALUE();
193+
public static native double maxValue();
194194

195195
@JS.Coerce
196196
@JS(value = "return Number.MIN_SAFE_INTEGER;")
197-
public native static long MIN_SAFE_INTEGER();
197+
public static native long minSafeInteger();
198198

199199
@JS.Coerce
200200
@JS(value = "return Number.MIN_VALUE;")
201-
public native static double MIN_VALUE();
201+
public static native double minValue();
202202

203203
@JS.Coerce
204204
@JS(value = "return Number.NaN;")
205-
public native static double NaN();
205+
public static native double nan();
206206

207207
@JS.Coerce
208208
@JS(value = "return Number.NEGATIVE_INFINITY;")
209-
public native static double NEGATIVE_INFINITY();
209+
public static native double negativeInfinity();
210210

211211
@JS.Coerce
212212
@JS(value = "return Number.POSITIVE_INFINITY;")
213-
public native static double POSITIVE_INFINITY();
213+
public static native double positiveInfinity();
214214

215215
@JS.Coerce
216216
@JS(value = "return this.toExponential();")

sdk/src/org.graalvm.webimage.api/src/org/graalvm/webimage/api/JSObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ public boolean equalsJavaScript(JSObject that) {
590590

591591
@JS.Coerce
592592
@JS(value = "return Object.groupBy(items, callback);")
593-
public native static JSObject groupBy(JSObject items, JSValue callback);
593+
public static native JSObject groupBy(JSObject items, JSValue callback);
594594

595595
@JS.Coerce
596596
@JS(value = "return Object.hasOwn(obj, prop);")

web-image/src/com.oracle.svm.webimage.jtt/src/com/oracle/svm/webimage/jtt/api/JSNumberTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ public static void testIsSafeInteger() {
9999
}
100100

101101
public static void testConstants() {
102-
assertEquals(Math.ulp(1.0), JSNumber.EPSILON(), DELTA);
103-
assertEquals(9007199254740991L, JSNumber.MAX_SAFE_INTEGER(), DELTA);
104-
assertEquals(Double.MAX_VALUE, JSNumber.MAX_VALUE(), DELTA);
105-
assertEquals(-9007199254740991L, JSNumber.MIN_SAFE_INTEGER(), DELTA);
106-
assertEquals(Double.MIN_VALUE, JSNumber.MIN_VALUE(), DELTA);
107-
assertEquals(Double.NaN, JSNumber.NaN(), DELTA);
108-
assertEquals(Double.NEGATIVE_INFINITY, JSNumber.NEGATIVE_INFINITY(), DELTA);
109-
assertEquals(Double.POSITIVE_INFINITY, JSNumber.POSITIVE_INFINITY(), DELTA);
102+
assertEquals(Math.ulp(1.0), JSNumber.epsilon(), DELTA);
103+
assertEquals(9007199254740991L, JSNumber.maxSafeInteger(), DELTA);
104+
assertEquals(Double.MAX_VALUE, JSNumber.maxValue(), DELTA);
105+
assertEquals(-9007199254740991L, JSNumber.minSafeInteger(), DELTA);
106+
assertEquals(Double.MIN_VALUE, JSNumber.minValue(), DELTA);
107+
assertEquals(Double.NaN, JSNumber.nan(), DELTA);
108+
assertEquals(Double.NEGATIVE_INFINITY, JSNumber.negativeInfinity(), DELTA);
109+
assertEquals(Double.POSITIVE_INFINITY, JSNumber.positiveInfinity(), DELTA);
110110

111111
}
112112

0 commit comments

Comments
 (0)