js: Check that script is marked as yielding when using procedure that yields

This commit is contained in:
Thomas Weber committed 2021-02-15 00:10:53 -06:00
1 parent 1c79d335f2
commit 3cf9398bde
1 file changed
+3
+3
View File
@@ -893,6 +893,9 @@ class JSGenerator {
}
if (procedureData.yields) {
this.source += 'yield* ';
if (!this.script.yields) {
throw new Error('Script uses yielding procedure but is not marked as yielding.');
}
}
this.source += `thread.procedures["${sanitize(procedureCode)}"](`;
// Only include arguments if the procedure accepts any.