summaryrefslogtreecommitdiff
path: root/runtime/web_worker.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-19 21:36:35 +0100
committerGitHub <noreply@github.com>2024-08-19 22:36:35 +0200
commitb5051e25c219c188f17d499ee4e101a64eb62e37 (patch)
tree88c6ab12aefd491d52e638c6e5043728412bca9b /runtime/web_worker.rs
parentbf510544ef26b89d4c2ae935893eaf62995ed903 (diff)
feat: Deprecate "import assertions" with a warning (#24743)
This commit deprecates "import assertions" proposal that has been replaced with "import attributes". Any time an import assertion is encountered a warning will be printed to the terminal. This warning will be printed for both local and remote files (ie. user code and dependencies). Import assertions support will be removed in Deno 2.
Diffstat (limited to 'runtime/web_worker.rs')
-rw-r--r--runtime/web_worker.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index ed1e19c9e..3e95045db 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -538,6 +538,13 @@ impl WebWorker {
options.bootstrap.enable_op_summary_metrics,
options.strace_ops,
);
+ let import_assertions_support = if options.bootstrap.future {
+ deno_core::ImportAssertionsSupport::Error
+ } else {
+ deno_core::ImportAssertionsSupport::CustomCallback(Box::new(
+ crate::shared::import_assertion_callback,
+ ))
+ };
let mut js_runtime = JsRuntime::new(RuntimeOptions {
module_loader: Some(options.module_loader.clone()),
@@ -558,6 +565,7 @@ impl WebWorker {
validate_import_attributes_cb: Some(Box::new(
validate_import_attributes_callback,
)),
+ import_assertions_support,
..Default::default()
});