Skip to content

Commit

Permalink
Update worker.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed May 6, 2024
1 parent d6d8b60 commit 4b2dad4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ globalThis.require = __internalCreateRequire____("{}");"#,
let default_export = module
.get(&mut scope, default_key)
.ok_or(Error::FailedToGetV8Value)?
.to_object(&mut scope)
.ok_or(Error::FailedToGetV8Value)?;
let inner_exports = default_export
.get_property_names(&mut scope, GetPropertyNamesArgs::default())
.ok_or(Error::FailedToGetV8Value)?;
let inner_exports = from_v8::<Vec<String>>(&mut scope, inner_exports.into())?;
all_exports.extend_from_slice(&inner_exports);
.to_object(&mut scope);
if let Some(default_export) = default_export {
let inner_exports = default_export
.get_property_names(&mut scope, GetPropertyNamesArgs::default())
.ok_or(Error::FailedToGetV8Value)?;
let inner_exports = from_v8::<Vec<String>>(&mut scope, inner_exports.into())?;
all_exports.extend_from_slice(&inner_exports);
}
all_exports
}
};
Expand Down

0 comments on commit 4b2dad4

Please sign in to comment.