Remove script loading from initialize (#889)

This commit is contained in:
jberg 2019-08-26 09:13:35 -07:00 committed by Jordan Eldredge
parent f10ca23501
commit eb2b318af8
2 changed files with 4 additions and 6 deletions

View file

@ -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,
});

View file

@ -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) {