Emit warning when double registering a space script function

pull/774/head
Zef Hemel 2024-02-28 10:54:47 +01:00
parent 0940eb1d15
commit ff9b39cb5e
1 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,9 @@ export class ScriptEnvironment {
);
arg = { name: arg };
}
if (this.functions[arg.name]) {
console.warn(`Function ${arg.name} already registered, overwriting`);
}
this.functions[arg.name] = fn;
}