summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bindings.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/bindings.rs b/core/bindings.rs
index 82cce7102..a28618571 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -363,8 +363,14 @@ fn import_meta_resolve(
let module_map = module_map_rc.borrow();
module_map.loader.clone()
};
- match loader.resolve(&specifier.to_rust_string_lossy(scope), &referrer, false)
- {
+ let specifier_str = specifier.to_rust_string_lossy(scope);
+
+ if specifier_str.starts_with("npm:") {
+ throw_type_error(scope, "\"npm:\" specifiers are currently not supported in import.meta.resolve()");
+ return;
+ }
+
+ match loader.resolve(&specifier_str, &referrer, false) {
Ok(resolved) => {
let resolved_val = serde_v8::to_v8(scope, resolved.as_str()).unwrap();
rv.set(resolved_val);