diff options
Diffstat (limited to 'src/client/util/Scripting.ts')
-rw-r--r-- | src/client/util/Scripting.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/util/Scripting.ts b/src/client/util/Scripting.ts index c6d98496a..2fa6e3059 100644 --- a/src/client/util/Scripting.ts +++ b/src/client/util/Scripting.ts @@ -51,9 +51,11 @@ function Run(script: string | undefined, customParams: string[], diagnostics: ts const errors = diagnostics.filter(diag => diag.category === ts.DiagnosticCategory.Error).filter(diag => // diag.code !== 2304 && diag.code !== 2339 && + diag.code !== 2314 && (diag.code !== 2552 ||!Object.keys(scriptingGlobals).includes(diagnostics[0].messageText.toString().match(/Cannot find name '([A-Za-z0-9$-_]+)'/)?.[1]??"-------")) ); // prettier-ignore if ((options.typecheck !== false && errors.length) || !script) { + console.log('Script Compile Failed: ' + script + ' ', errors); return { compiled: false, errors }; } @@ -228,10 +230,8 @@ export function CompileScript(script: string, options: ScriptOptions = {}): Comp } paramNames.push(...Object.keys(params).filter(p => p !== 'this' && !Object.keys(capturedVariables).includes(p))); - const paramList = paramNames.map(key => { - const val = typeof params[key] === 'string' && params[key].length && !'"\'`'.includes(params[key][0]) ? `"${params[key]}"` : params[key]; - return `${key}: ${val}`; - }); + const paramList = paramNames.map(key => `${key}: ${params[key] === Doc.name ? 'any' : params[key]}`); + for (const key in capturedVariables) { if (key !== 'this') { const val = capturedVariables[key]; |