mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibJS: Fix mix-up when re-exporting an imported symbol with a new name
This makes https://cling.com/ load, and more of the animated elements on https://shopify.com/ start appearing.
This commit is contained in:
committed by
Andreas Kling
parent
427e6cec7b
commit
0f9444fa06
1
Tests/LibWeb/Text/expected/js-export-rename.txt
Normal file
1
Tests/LibWeb/Text/expected/js-export-rename.txt
Normal file
@@ -0,0 +1 @@
|
||||
PASS: 123
|
||||
2
Tests/LibWeb/Text/input/js-export-rename-helper.js
Normal file
2
Tests/LibWeb/Text/input/js-export-rename-helper.js
Normal file
@@ -0,0 +1,2 @@
|
||||
var value = 123;
|
||||
export { value };
|
||||
2
Tests/LibWeb/Text/input/js-export-rename-module.js
Normal file
2
Tests/LibWeb/Text/input/js-export-rename-module.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import { value } from "./js-export-rename-helper.js";
|
||||
export { value as renamedValue };
|
||||
13
Tests/LibWeb/Text/input/js-export-rename.html
Normal file
13
Tests/LibWeb/Text/input/js-export-rename.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
window.resultThingy = "FAIL";
|
||||
</script>
|
||||
<script type="module">
|
||||
import { renamedValue } from "./js-export-rename-module.js";
|
||||
window.resultThingy = "PASS: " + renamedValue;
|
||||
</script>
|
||||
<script>
|
||||
test(() => {
|
||||
println(resultThingy);
|
||||
});
|
||||
</script>
|
||||
@@ -217,7 +217,7 @@ Result<NonnullGCPtr<SourceTextModule>, Vector<ParserError>> SourceTextModule::pa
|
||||
else {
|
||||
// a. NOTE: This is a re-export of a single name.
|
||||
// b. Append the ExportEntry Record { [[ModuleRequest]]: ie.[[ModuleRequest]], [[ImportName]]: ie.[[ImportName]], [[LocalName]]: null, [[ExportName]]: ee.[[ExportName]] } to indirectExportEntries.
|
||||
indirect_export_entries.empend(ExportEntry::indirect_export_entry(import_entry.module_request(), import_entry.import_name, export_entry.export_name));
|
||||
indirect_export_entries.empend(ExportEntry::indirect_export_entry(import_entry.module_request(), export_entry.export_name, import_entry.import_name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user