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:
parent
427e6cec7b
commit
0f9444fa06
Notes:
github-actions[bot]
2024-09-02 15:15:16 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/0f9444fa060 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1253
5 changed files with 19 additions and 1 deletions
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue