fix corner cases with import (#4709)

fixes #4708
This commit is contained in:
Alex Lam S.L
2021-02-28 23:13:49 +00:00
committed by GitHub
parent 81254f67e4
commit ec0440f264
4 changed files with 67 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ exports.patch_module_statements = function(code) {
symbols = symbols.replace(/[{}]/g, "").trim().replace(/\s*,\s*/g, ",");
symbols = symbols.replace(/\*/, '"*"').replace(/\bas\s+(?!$|,|as\s)/g, ":");
imports.push([
"var {",
"const {",
symbols,
"} = new Proxy(Object.create(null), { get(_, value) { return { value }; } });",
].join(""));