From 54b1c9527027ea943628c9f6561e65c0adf3110c Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Mon, 22 Jul 2019 17:32:35 +0930 Subject: [PATCH] document.createVariable return float instead of string --- src/scriptrunner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scriptrunner.cpp b/src/scriptrunner.cpp index 0f6b8abb..3de8fb52 100644 --- a/src/scriptrunner.cpp +++ b/src/scriptrunner.cpp @@ -199,7 +199,7 @@ static JSValue js_createVariable(JSContext *context, JSValueConst thisValue, JS_FreeCString(context, name); JS_FreeCString(context, defaultValue); - return JS_NewString(context, mergedValue.toUtf8().constData()); + return JS_NewFloat64(context, mergedValue.toDouble()); fail: JS_FreeCString(context, name);