Commit aab74b2f authored by Dan Clark's avatar Dan Clark Committed by Chromium LUCI CQ

Remove DCHECK expecting at most one import assertion

We've decided to remove V8's behavior of filtering the import assertions
to only those expected by the embedder.  The interop guarantees provided
by doing the filtering in V8 are probably not worth the added
complexity. Going forward, hosts will no longer need to provide a list
of supported assertions, and they will be expected to ignore unknown
assertions received from V8.

The Blink code is already written such that unexpected assertions are
ignored, so the only thing that needs to be done on this side is to
remove the DCHECK that expects at most one assertion.

Once the V8-side changes are made to remove the filtering, Blink can
then stop setting
v8::Isolate::CreateParams::supported_import_assertions.

Change-Id: I40578c40ff4c97cd64b6bb0840b72163e9c5a2f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643059Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#846179}
parent f456efff
...@@ -7,12 +7,6 @@ ...@@ -7,12 +7,6 @@
namespace blink { namespace blink {
String ModuleRequest::GetModuleTypeString() const { String ModuleRequest::GetModuleTypeString() const {
// Currently, Blink will get at most the single "type" assertion because
// that's the only one requested from V8 (see
// gin::IsoalteHolder::kSupportedImportAssertions). So this doesn't actually
// have to be written as a loop at all unless more import assertions are
// added. But, it's written as a loop anyway to be more future proof.
DCHECK_LE(import_assertions.size(), 1U);
for (const ImportAssertion& import_assertion : import_assertions) { for (const ImportAssertion& import_assertion : import_assertions) {
if (import_assertion.key == "type") { if (import_assertion.key == "type") {
DCHECK(!import_assertion.value.IsNull()); DCHECK(!import_assertion.value.IsNull());
......
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