From dce96dbec7f267d155247e9af26046e83a57116d Mon Sep 17 00:00:00 2001 From: HarlonWang <81813780@qq.com> Date: Sun, 17 Sep 2023 23:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wrapper-js/src/index.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wrapper-js/src/index.mjs b/wrapper-js/src/index.mjs index 8d5d6df..3ce3b5e 100644 --- a/wrapper-js/src/index.mjs +++ b/wrapper-js/src/index.mjs @@ -5,10 +5,10 @@ const TAB = " " const DIR_EXTEND_LIBRARIES = "./wrapper-js/extend/libraries/" const DIR_CPP = "./native/cpp/" -const FILE_CPP = DIR_CPP + "quickjs_extend_libraries.h" +const FILE_H = DIR_CPP + "quickjs_extend_libraries.h" -if (existDir(FILE_CPP)) { - removeFile(FILE_CPP) +if (existDir(FILE_H)) { + removeFile(FILE_H) } (function init() { @@ -52,7 +52,7 @@ if (existDir(FILE_CPP)) { code += TAB code += `JS_Eval(ctx, ${datePVarName}, strlen(${datePVarName}), "date-polyfill.js", JS_EVAL_TYPE_GLOBAL);` code += LINE - + code += TAB code += `JS_FreeValue(ctx, JS_Eval(ctx, ${consoleVarName}, strlen(${consoleVarName}), "console.js", JS_EVAL_TYPE_GLOBAL));` code += LINE @@ -63,5 +63,5 @@ if (existDir(FILE_CPP)) { code += LINE.repeat(2) code += "#endif //QUICKJS_EXTEND_LIBRARIES" - writeToFile(FILE_CPP, code) + writeToFile(FILE_H, code) })()