mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Convert null MAKI objects to global NULL value (#866)
* Coerce null MAKI objects to 0 * use global NULL value
This commit is contained in:
parent
e58647964b
commit
0297eb726a
2 changed files with 9 additions and 3 deletions
|
|
@ -161,11 +161,17 @@ export function* interpret(start, program, stack = []) {
|
|||
}
|
||||
const obj = popStackValue();
|
||||
const ret = obj[methodName](...methodArgs);
|
||||
let value;
|
||||
if (isPromise(ret)) {
|
||||
stack.push(yield ret);
|
||||
value = yield ret;
|
||||
} else {
|
||||
stack.push(ret);
|
||||
value = ret;
|
||||
}
|
||||
if (value === null) {
|
||||
// variables[1] holds global NULL value
|
||||
value = variables[1];
|
||||
}
|
||||
stack.push(value);
|
||||
break;
|
||||
}
|
||||
// callGlobal
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Variable {
|
|||
if (this._unsubscribeFromValue != null) {
|
||||
this._unsubscribeFromValue();
|
||||
}
|
||||
if (this.global && this.typeName === "OBJECT" && value !== null) {
|
||||
if (this.global && this.typeName === "OBJECT" && value !== 0) {
|
||||
this._unsubscribeFromValue = value.js_listenToAll(
|
||||
(eventName, ...args) => {
|
||||
this._emitter.trigger(eventName.toLowerCase(), ...args);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue