Skip to content

Commit

Permalink
Procedures -- Fix Empty Returns Compiler Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkPool-SP authored Nov 15, 2024
1 parent fb05e96 commit 3d3e584
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/compiler/jsgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,9 +955,7 @@ class JSGenerator {
let source = '(';
// Do not generate any code for empty procedures.
const procedureData = this.ir.procedures[procedureVariant];
if (procedureData.stack === null) {
break;
}
if (procedureData.stack === null) return new TypedInput('""', TYPE_STRING);

const yieldForRecursion = !this.isWarp && procedureCode === this.script.procedureCode;
const yieldForHat = this.isInHat;
Expand All @@ -983,7 +981,6 @@ class JSGenerator {
source += `))`;
// Variable input types may have changes after a procedure call.
this.resetVariableInputs();
console.log(source);
return new TypedInput(source, TYPE_UNKNOWN);
}

Expand Down

0 comments on commit 3d3e584

Please sign in to comment.