mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
fix tests, sprinkle more async/await (#809)
This commit is contained in:
parent
ea7b2d7670
commit
7ba86cf584
2 changed files with 6 additions and 6 deletions
|
|
@ -3,7 +3,7 @@ const { getClass, getFormattedId } = require("./objects");
|
|||
const interpret = require("./virtualMachine");
|
||||
const { printCommand } = require("./prettyPrinter");
|
||||
|
||||
function main({ runtime, data, system, log, logger }) {
|
||||
async function main({ runtime, data, system, log, logger }) {
|
||||
const program = parse(data);
|
||||
|
||||
// Replace class hashes with actual JavaScript classes from the runtime
|
||||
|
|
@ -29,8 +29,8 @@ function main({ runtime, data, system, log, logger }) {
|
|||
// const logger = log ? printCommand : logger;
|
||||
// TODO: Handle disposing of this.
|
||||
// TODO: Handle passing in variables.
|
||||
variable.hook(method.name, () => {
|
||||
interpret(commandOffset, program, [], { logger });
|
||||
variable.hook(method.name, async () => {
|
||||
await interpret(commandOffset, program, [], { logger });
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ function main({ runtime, data, system, log, logger }) {
|
|||
// Set the System global
|
||||
// TODO: We could confirm that this variable has the "system" flag set.
|
||||
program.variables[0].setValue(system);
|
||||
system.js_start();
|
||||
await system.js_start();
|
||||
}
|
||||
|
||||
module.exports = main;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ class System extends MakiObject {
|
|||
return "System";
|
||||
}
|
||||
|
||||
js_start() {
|
||||
this.js_trigger("onScriptLoaded");
|
||||
async js_start() {
|
||||
await this.js_trigger("onScriptLoaded");
|
||||
}
|
||||
|
||||
getScriptGroup() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue