Skip to content

Commit ec59c5d

Browse files
committed
Fix porting of new js_atof
Re-apply quickjs-ng#319, use of js_number()
1 parent 4773a58 commit ec59c5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

quickjs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12054,7 +12054,7 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
1205412054
double d = INF;
1205512055
if (is_neg)
1205612056
d = -d;
12057-
val = JS_NewFloat64(ctx, d);
12057+
val = js_float64(d);
1205812058
goto done;
1205912059
}
1206012060
}
@@ -12129,7 +12129,7 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
1212912129
d = js_atod(buf, NULL, radix, is_float ? 0 : JS_ATOD_INT_ONLY,
1213012130
&atod_mem);
1213112131
/* return int or float64 */
12132-
val = JS_NewFloat64(ctx, d);
12132+
val = js_number(d);
1213312133
}
1213412134
break;
1213512135
case ATOD_TYPE_BIG_INT:

0 commit comments

Comments
 (0)