diff options
author | bobzel <zzzman@gmail.com> | 2022-06-09 00:27:52 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-06-09 00:29:07 -0400 |
commit | 8d78df55532b0044edd61ed379f6c469554805f2 (patch) | |
tree | d2ee7383d38873c51df8e362c87c71751d097acd /src | |
parent | 629302e544cc0a83fc73d217e081cf086a78a4b5 (diff) |
restored multi-line scripting by not adding 'return' to scripts when it's not requested.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/Scripting.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/util/Scripting.ts b/src/client/util/Scripting.ts index 3b0a47b54..223b0268c 100644 --- a/src/client/util/Scripting.ts +++ b/src/client/util/Scripting.ts @@ -223,7 +223,7 @@ export function CompileScript(script: string, options: ScriptOptions = {}): Comp paramList.push(`${key}: ${typeof val === "object" ? Object.getPrototypeOf(val).constructor.name : typeof val}`); } const paramString = paramList.join(", "); - const body = addReturn ? `return ${script};` : `return ${script};`; + const body = addReturn ? `return ${script};` : script; const reqTypes = requiredType ? `: ${requiredType}` : ''; const funcScript = `(function(${paramString})${reqTypes} { ${body} })`; host.writeFile("file.ts", funcScript); |