summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index d098c25b1..9c6b7afea 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -438,7 +438,7 @@ impl JsRuntime {
fn get_context_data(
scope: &mut v8::HandleScope<()>,
context: v8::Local<v8::Context>,
- ) -> (Vec<v8::Global<v8::Module>>, v8::Global<v8::Object>) {
+ ) -> (Vec<v8::Global<v8::Module>>, v8::Global<v8::Array>) {
fn data_error_to_panic(err: v8::DataError) -> ! {
match err {
v8::DataError::BadType { actual, expected } => {
@@ -457,15 +457,11 @@ impl JsRuntime {
// The 0th element is the module map itself, followed by X number of module
// handles. We need to deserialize the "next_module_id" field from the
// map to see how many module handles we expect.
- match scope.get_context_data_from_snapshot_once::<v8::Object>(0) {
+ match scope.get_context_data_from_snapshot_once::<v8::Array>(0) {
Ok(val) => {
let next_module_id = {
- let info_str = v8::String::new(&mut scope, "info").unwrap();
- let info_data: v8::Local<v8::Array> = val
- .get(&mut scope, info_str.into())
- .unwrap()
- .try_into()
- .unwrap();
+ let info_data: v8::Local<v8::Array> =
+ val.get_index(&mut scope, 1).unwrap().try_into().unwrap();
info_data.length()
};
@@ -3648,7 +3644,7 @@ pub mod tests {
main,
name: specifier.to_string(),
requests: vec![crate::modules::ModuleRequest {
- specifier: crate::resolve_url(&format!("file:///{prev}.js")).unwrap(),
+ specifier: format!("file:///{prev}.js"),
asserted_module_type: AssertedModuleType::JavaScriptOrWasm,
}],
module_type: ModuleType::JavaScript,