diff --git a/src/compiler/jsgen.js b/src/compiler/jsgen.js index 757f0fca..8ccdcd91 100644 --- a/src/compiler/jsgen.js +++ b/src/compiler/jsgen.js @@ -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.