js-executor: ScriptMap optimize work
This commit is contained in:
parent
41391dbef8
commit
ab5f1b5b63
@ -196,8 +196,9 @@ JsInvokeMessageProcessor.prototype.sendResponse = function (requestId, responseT
|
|||||||
JsInvokeMessageProcessor.prototype.getOrCompileScript = function (scriptId, scriptBody) {
|
JsInvokeMessageProcessor.prototype.getOrCompileScript = function (scriptId, scriptBody) {
|
||||||
var self = this;
|
var self = this;
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
if (self.scriptMap.has(scriptId)) {
|
const script = self.scriptMap.get(scriptId);
|
||||||
resolve(self.scriptMap.get(scriptId));
|
if (script !== undefined) {
|
||||||
|
resolve(script);
|
||||||
} else {
|
} else {
|
||||||
self.executor.compileScript(scriptBody).then(
|
self.executor.compileScript(scriptBody).then(
|
||||||
(script) => {
|
(script) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user