mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 11:04:00 +00:00
Be consistent with ordering of a and b, even when it does not matter
Interestingly this changes the order of << but tests still pass
This commit is contained in:
parent
5a7489db4e
commit
05362da4a3
1 changed files with 4 additions and 4 deletions
|
|
@ -49,7 +49,7 @@ async function interpret(start, program, stack = [], { logger = null }) {
|
|||
let aValue = a instanceof Variable ? a.getValue() : a;
|
||||
let bValue = b instanceof Variable ? b.getValue() : b;
|
||||
aValue = coerceTypes(a, b, aValue, bValue);
|
||||
stack.push(aValue === bValue);
|
||||
stack.push(bValue === aValue);
|
||||
break;
|
||||
}
|
||||
// !=
|
||||
|
|
@ -59,7 +59,7 @@ async function interpret(start, program, stack = [], { logger = null }) {
|
|||
let aValue = a instanceof Variable ? a.getValue() : a;
|
||||
let bValue = b instanceof Variable ? b.getValue() : b;
|
||||
aValue = coerceTypes(a, b, aValue, bValue);
|
||||
stack.push(aValue !== bValue);
|
||||
stack.push(bValue !== aValue);
|
||||
break;
|
||||
}
|
||||
// >
|
||||
|
|
@ -214,7 +214,7 @@ async function interpret(start, program, stack = [], { logger = null }) {
|
|||
case 64: {
|
||||
const a = stack.pop();
|
||||
const b = stack.pop();
|
||||
stack.push(a.getValue() + b.getValue());
|
||||
stack.push(b.getValue() + a.getValue());
|
||||
break;
|
||||
}
|
||||
// - (subtract)
|
||||
|
|
@ -322,7 +322,7 @@ async function interpret(start, program, stack = [], { logger = null }) {
|
|||
const b = stack.pop();
|
||||
const aValue = a instanceof Variable ? a.getValue() : a;
|
||||
const bValue = b instanceof Variable ? b.getValue() : b;
|
||||
stack.push(aValue << bValue);
|
||||
stack.push(bValue << aValue);
|
||||
break;
|
||||
}
|
||||
// >>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue