From eb2b318af8eb8ff5e6dd4e45f53db8acd6ae30c2 Mon Sep 17 00:00:00 2001 From: jberg Date: Mon, 26 Aug 2019 09:13:35 -0700 Subject: [PATCH] Remove script loading from initialize (#889) --- modern/src/Actions.ts | 5 +++-- modern/src/initialize.js | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modern/src/Actions.ts b/modern/src/Actions.ts index eb20a086..c18e65a6 100644 --- a/modern/src/Actions.ts +++ b/modern/src/Actions.ts @@ -57,7 +57,7 @@ export function gotSkinZip(zip: JSZip, store: ModernStore) { const makiTree = await initialize(zip, xmlTree, store); // Execute scripts - await Utils.asyncTreeFlatMap(makiTree, node => { + await Utils.asyncTreeFlatMap(makiTree, async node => { switch (node.name) { case "groupdef": { // removes groupdefs from consideration (only run scripts when actually referenced by group) @@ -73,9 +73,10 @@ export function gotSkinZip(zip: JSZip, store: ModernStore) { new Set(["group", "WinampAbstractionLayer", "WasabiXML"]) ); const system = new System(scriptGroup, store); + const script = await Utils.readUint8array(zip, node.attributes.file); run({ runtime, - data: node.js_annotations.script, + data: script, system, log: false, }); diff --git a/modern/src/initialize.js b/modern/src/initialize.js index 91557660..623628f8 100644 --- a/modern/src/initialize.js +++ b/modern/src/initialize.js @@ -121,10 +121,7 @@ const parsers = { menu: noop, albumart: noop, playlistplus: noop, - async script(node, parent, zip, store) { - const script = await Utils.readUint8array(zip, node.attributes.file); - return new MakiObject(node, parent, { script }, store); - }, + script: noop, }; async function parseChildren(node, children, zip, store) {