Commit 4ae35a7e authored by Daniel Clark's avatar Daniel Clark Committed by Commit Bot

Loosen DHCECK to allow for no HostImportModuleDynamically callback to be set

The DCHECK is firing because the fuzzer doesn't set any
HostImportModuleDynamically callback.  Previously
RunHostImportModuleDynamicallyCallback would not assert for this and
would just return a rejected promise.  After
https://chromium-review.googlesource.com/c/v8/v8/+/2620578, this results
in a failed DCHECK.

This change restores the old behavior by loosening the DCHECK such that
it only fails if both the deprecated and the new callback are set.

Bug: chromium:1172121
Change-Id: Ifda28eb28572a40d3752928997edf25d607b61c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2659505Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#72462}
parent e12ffa65
......@@ -4157,9 +4157,9 @@ MaybeHandle<JSPromise> Isolate::RunHostImportModuleDynamicallyCallback(
MaybeHandle<Object> maybe_import_assertions_argument) {
v8::Local<v8::Context> api_context =
v8::Utils::ToLocal(Handle<Context>(native_context()));
DCHECK_EQ(host_import_module_dynamically_callback_ != nullptr,
host_import_module_dynamically_with_import_assertions_callback_ ==
nullptr);
DCHECK(host_import_module_dynamically_callback_ == nullptr ||
host_import_module_dynamically_with_import_assertions_callback_ ==
nullptr);
if (host_import_module_dynamically_callback_ == nullptr &&
host_import_module_dynamically_with_import_assertions_callback_ ==
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment