Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): More efficient serde for ES modules in snapshot #17856

Merged
merged 7 commits into from
Feb 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
bartlomieju committed Feb 21, 2023
commit 653b2c3d2cc2919139a23d2764543bdf01426082
5 changes: 3 additions & 2 deletions core/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,12 +1051,13 @@ impl ModuleMap {
for (i, elem) in self.by_name.iter().enumerate() {
let arr = v8::Array::new(scope, 3);

let specifier = v8::String::new(scope, &elem.0 .0).unwrap();
let (specifier, asserted_module_type) = &elem.0;
let specifier = v8::String::new(scope, specifier).unwrap();
arr.set_index(scope, 0, specifier.into());

let asserted_module_type = v8::Integer::new(
scope,
match elem.0 .1 {
match asserted_module_type {
AssertedModuleType::JavaScriptOrWasm => 0,
AssertedModuleType::Json => 1,
},
Expand Down