From 1c5f1030fa929d1e8e1483f0626348316d5ac258 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 1 Feb 2024 01:35:43 +0100 Subject: [PATCH] deps: V8: cherry-pick 26fd1dfa9cd6 Original commit message: [import-attributes] Deprecate 'assert' for dynamic import as well Bug: v8:10958 Change-Id: I7847bdb5d2c79f057f4e1df99f8f5889788f09cb Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5249778 Commit-Queue: Shu-yu Guo Reviewed-by: Leszek Swirski Cr-Commit-Position: refs/heads/main@{#92123} Refs: https://github.com/v8/v8/commit/26fd1dfa9cd6d56eae8ecfc7a136fd6709fba161 --- common.gypi | 2 +- deps/v8/src/execution/isolate.cc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 04bab2bb84d597..1b45f13453aa0f 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.38', + 'v8_embedder_string': '-node.39', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/execution/isolate.cc b/deps/v8/src/execution/isolate.cc index 527b8acaaa3b24..033106fc5d98cf 100644 --- a/deps/v8/src/execution/isolate.cc +++ b/deps/v8/src/execution/isolate.cc @@ -4761,6 +4761,20 @@ MaybeHandle Isolate::GetImportAssertionsFromArgument( // an error. return MaybeHandle(); } + + if (V8_UNLIKELY(!import_assertions_object->IsUndefined())) { + MessageLocation* location = nullptr; + MessageLocation computed_location; + if (ComputeLocation(&computed_location)) { + location = &computed_location; + } + Handle message = MessageHandler::MakeMessageObject( + this, MessageTemplate::kImportAssertDeprecated, location, + factory()->NewStringFromAsciiChecked("a future version"), + Handle::null()); + message->set_error_level(v8::Isolate::kMessageWarning); + MessageHandler::ReportMessage(this, location, message); + } } // If there is no 'with' or 'assert' option in the options bag, it's not an