diff --git a/ts2panda/src/index.ts b/ts2panda/src/index.ts index e243c78b0d2e4615206e0435985e8a5be7ff6307..bc87b8b9ce0beb85cd9602828bf3177c83fce4fc 100644 --- a/ts2panda/src/index.ts +++ b/ts2panda/src/index.ts @@ -209,9 +209,9 @@ const es2abcBase64Input = "--base64Input"; const es2abcDebuggerEvaluateFlag = "--debugger-evaluate-expression"; const es2abcBase64Output = "--base64Output"; -function callEs2pandaToolChain(ideIputStr: string) { - let commandLine = es2abcBinaryPath + es2abcBinaryName + " " + es2abcBase64Input + " \"" + ideIputStr + "\" " + - es2abcDebuggerEvaluateFlag + " " + es2abcBase64Output; +function callEs2pandaToolChain(ideInputStr: string) { + let commandLine = "\"" + es2abcBinaryPath + es2abcBinaryName + "\" " + es2abcBase64Input + " \"" + ideInputStr + + "\" " + es2abcDebuggerEvaluateFlag + " " + es2abcBase64Output; var exec = require('child_process').exec; exec(`${commandLine}`, function(error, stdout) { if (error) { @@ -223,18 +223,18 @@ function callEs2pandaToolChain(ideIputStr: string) { } function updateWatchJsFile() { - let ideIputStr = CmdOptions.getEvaluateExpression(); + let ideInputStr = CmdOptions.getEvaluateExpression(); if (CmdOptions.watchViaEs2pandaToolchain()) { - callEs2pandaToolChain(ideIputStr); + callEs2pandaToolChain(ideInputStr); return; } - if (!isBase64Str(ideIputStr)) { + if (!isBase64Str(ideInputStr)) { throw new Error("Passed expression string for evaluating is not base64 style."); } let watchAbcFileTimeOut = watchAbcFileDefaultTimeOut; if (CmdOptions.getWatchTimeOutValue() != 0) { watchAbcFileTimeOut = CmdOptions.getWatchTimeOutValue(); } let watchFilePrefix = CmdOptions.getWatchJsPath() + path.sep + watchFileName; - let originExpre = Buffer.from(ideIputStr, 'base64').toString(); + let originExpre = Buffer.from(ideInputStr, 'base64').toString(); let jsFileName = watchFilePrefix + ".js"; let abcFileName = watchFilePrefix + ".abc"; let errorMsgFileName = watchFilePrefix + ".err";