Merge pull request 'fix: mutate.test.ts: pre-existing isValid > stack underflow failure (#810)' (#848) from fix/issue-810 into master
This commit is contained in:
commit
3e5cbea7f7
1 changed files with 2 additions and 4 deletions
|
|
@ -31,15 +31,13 @@ function emit(state: TranspilerState, line: string): void {
|
|||
|
||||
function dpop(state: TranspilerState, ctx: string): string {
|
||||
const v = state.dStack.pop();
|
||||
// Stack underflow → Push3 no-op semantics: treat missing value as 0
|
||||
if (v === undefined) return '0';
|
||||
if (v === undefined) throw new Error(`DYADIC stack underflow at ${ctx}`);
|
||||
return v;
|
||||
}
|
||||
|
||||
function bpop(state: TranspilerState, ctx: string): string {
|
||||
const v = state.bStack.pop();
|
||||
// Stack underflow → Push3 no-op semantics: treat missing bool as false
|
||||
if (v === undefined) return 'false';
|
||||
if (v === undefined) throw new Error(`BOOLEAN stack underflow at ${ctx}`);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue