Changed buttons that used <span> elements to use <button> elements. Allowed processing for modules that are dynamically imported from URL

This commit is contained in:
danielyxie
2018-10-03 12:50:39 -05:00
parent 59f525f08b
commit 781f2f09b4
5 changed files with 167185 additions and 203 deletions
+3 -3
View File
@@ -54,14 +54,13 @@ export async function executeJSScript(scripts = [], workerScript) {
//
// - script -- the script for whom we are getting a URL.
// - scripts -- all the scripts available on this server
// - envHeader -- the preamble that goes at the start of every NSJS script.
// - seen -- The modules above this one -- to prevent mutual dependency.
//
// TODO We don't make any effort to cache a given module when it is imported at
// different parts of the tree. That hasn't presented any problem with during
// testing, but it might be an idea for the future. Would require a topo-sort
// then url-izing from leaf-most to root-most.
function _getScriptUrls(script, scripts, seen) {
export function _getScriptUrls(script, scripts, seen) {
// Inspired by: https://stackoverflow.com/a/43834063/91401
const urlStack = [];
seen.push(script);
@@ -90,7 +89,8 @@ function _getScriptUrls(script, scripts, seen) {
// The top url in the stack is the replacement import file for this script.
urlStack.push(...urls);
return [prefix, urls[urls.length - 1], suffix].join('');
});
}
);
// If we successfully transformed the code, create a blob url for it and