From 164bebb1cb45ab34250b87b080ed6e3cb28f1cf2 Mon Sep 17 00:00:00 2001 From: trentfridey Date: Mon, 5 Feb 2024 05:08:46 -0500 Subject: [PATCH] remove package; is a future reserved word https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#future_reserved_words (#50) --- include/pyjs/pre_js/load_pkg.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/include/pyjs/pre_js/load_pkg.js b/include/pyjs/pre_js/load_pkg.js index ade635c..772a08d 100644 --- a/include/pyjs/pre_js/load_pkg.js +++ b/include/pyjs/pre_js/load_pkg.js @@ -88,8 +88,6 @@ async function bootstrap_python(prefix, package_tarballs_root_url, python_packag } - - Module["bootstrap_from_empack_packed_environment"] = async function ( packages_json_url, @@ -129,12 +127,12 @@ Module["bootstrap_from_empack_packed_environment"] = async function ( package_tarballs_root_url, python_is_ready_promise, - package + pkg ) { - let package_url = `${package_tarballs_root_url}/${package.filename}` - console.log(`fetching pkg ${package.name} from ${package_url}`) + let package_url = `${package_tarballs_root_url}/${pkg.filename}` + console.log(`fetching pkg ${pkg.name} from ${package_url}`) let byte_array = await fetchByteArray(package_url) - const tarball_path = `/package_tarballs/${package.filename}`; + const tarball_path = `/package_tarballs/${pkg.filename}`; Module.FS.writeFile(tarball_path, byte_array); console.log(`extract ${tarball_path} (${byte_array.length} bytes)`) await python_is_ready_promise; @@ -162,7 +160,7 @@ Module["bootstrap_from_empack_packed_environment"] = async function let python_is_ready_promise = bootstrap_python(prefix, package_tarballs_root_url, python_package); // create array with size - let shared_libs = await Promise.all(packages.map(package => fetchAndUntar(package_tarballs_root_url, python_is_ready_promise, package))) + let shared_libs = await Promise.all(packages.map(pkg => fetchAndUntar(package_tarballs_root_url, python_is_ready_promise, pkg))) if(!skip_loading_shared_libs){ // instantiate all packages