aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Scripting.ts
diff options
context:
space:
mode:
authorJoanne <zehan_ding@brown.edu>2025-05-12 20:58:01 -0400
committerJoanne <zehan_ding@brown.edu>2025-05-12 20:58:01 -0400
commitcd93c88b8fee83a99342eac4dc60f7b4373fa843 (patch)
treeb00d1f46c802752c90e54bb21be785a05e05195e /src/client/util/Scripting.ts
parent4997c3de20a381eac30224a7a550afa66174f07d (diff)
parent3a733aa0fd24517e83649824dec0fc8bcc0bde43 (diff)
added tutorial tool, still need to integrate with metadatatool
Diffstat (limited to 'src/client/util/Scripting.ts')
-rw-r--r--src/client/util/Scripting.ts8
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];