From 52456165cec5bbc362364b8f5601269af4def32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Fri, 25 Aug 2023 17:49:51 +0800 Subject: [PATCH] web: fix module name not quoted --- doric-web/dist/index.js | 2 +- doric-web/src/DoricDriver.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doric-web/dist/index.js b/doric-web/dist/index.js index 18823826..a94fa834 100644 --- a/doric-web/dist/index.js +++ b/doric-web/dist/index.js @@ -8440,7 +8440,7 @@ var doric_web = (function (exports, axios, sandbox) { document.body.appendChild(scriptElement); } function packageModuleScript(name, content) { - return `Reflect.apply(doric.jsRegisterModule,this,[${name},Reflect.apply(function(__module){(function(module,exports,require,setTimeout,setInterval,clearTimeout,clearInterval){ + return `Reflect.apply(doric.jsRegisterModule,this,["${name}",Reflect.apply(function(__module){(function(module,exports,require,setTimeout,setInterval,clearTimeout,clearInterval){ ${content} })(__module,__module.exports,doric.__require__,doricSetTimeout,doricSetInterval,doricClearTimeout,doricClearInterval); return __module.exports;},this,[{exports:{}}])])`; diff --git a/doric-web/src/DoricDriver.ts b/doric-web/src/DoricDriver.ts index e3e43706..284e8959 100644 --- a/doric-web/src/DoricDriver.ts +++ b/doric-web/src/DoricDriver.ts @@ -26,7 +26,7 @@ export function loadJS(contextId: string, script: string) { } function packageModuleScript(name: string, content: string) { - return `Reflect.apply(doric.jsRegisterModule,this,[${name},Reflect.apply(function(__module){(function(module,exports,require,setTimeout,setInterval,clearTimeout,clearInterval){ + return `Reflect.apply(doric.jsRegisterModule,this,["${name}",Reflect.apply(function(__module){(function(module,exports,require,setTimeout,setInterval,clearTimeout,clearInterval){ ${content} })(__module,__module.exports,doric.__require__,doricSetTimeout,doricSetInterval,doricClearTimeout,doricClearInterval); return __module.exports;},this,[{exports:{}}])])`