Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should std:nonexistent cause parse error or fetch error? #159

Closed
hiroshige-g opened this issue Jul 15, 2019 · 2 comments
Closed

Should std:nonexistent cause parse error or fetch error? #159

hiroshige-g opened this issue Jul 15, 2019 · 2 comments

Comments

@hiroshige-g
Copy link
Collaborator

In some cases std:nonexistent causes parse errors and in other cases fetch errors.
This is probably fine, as we already have larger behavior differences between import statements and <script>'s src attributes (e.g. import maps are applied or not), but anyway creating an issue to track and explain this explicitly.

  • (1): with built-in modules but without import maps spec
  • (2) with import maps spec (current, HTML-spec based)
  • (3) with import maps spec (Fetch-spec based)
Request type error type (1) spec (1) error type (2) spec (2) error type (3)
<script type="module" src="std:nonexistent"> fetch error Fetching just fails fetch error Throw in validation fetch error
import 'std:nonexistent'; fetch error Fetching just fails parse error Throw in validation fetch error
import 'std:nonexistent'; + import map: "std:nonexistent": "std:nonexistent" N/A N/A parse error Throw in Step 1.1.2.2 of resolve-an-imports-match fetch error
import 'std-internal:some'; from non-internal N/A N/A parse error Throw in validation parse error?
@guybedford
Copy link
Collaborator

The fact that rows (2) and (3) in the table above are different does seem somewhat surprising, in that I would have expected that import maps only change behaviour at a resolution level, and not the overall resolution semantics.

The core of this discrepancy does exactly seem to be the 1.1.2.2 step in resolve-an-imports-match, which seems to be an early validation unlike we get at any other part of the resolver.

I can understand std-internal:some being an early validation as that is a sort of "resolver policy" restriction, which is a new lower-level layer though.

The reason for 1.1.2.2 seems to be this comment:

This condition is added to ensure that moduleMap[url] does not exist for unimplemented built-ins. Without this condition, fetch a single module script might be called and moduleMap[url] can be set to null, which might complicates the spec around built-ins.

@hiroshige-g could you clarify the concern here? I was under the impression the module map cached error results just like it caches import 'std:nonexistent'?

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 26, 2019
This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 29, 2019
This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
aarongable pushed a commit to chromium/chromium that referenced this issue Aug 29, 2019
This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691821}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 29, 2019
This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691821}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 29, 2019
This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691821}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 3, 2019
…n SecureContexts, a=testonly

Automatic update from web-platform-tests
Expose kv-storage built-in module only on SecureContexts

This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691821}

--

wpt-commits: cb808982deeb57212fb856858c1a7716d0ac2ecb
wpt-pr: 17863
dbaron pushed a commit to dbaron/gecko that referenced this issue Sep 4, 2019
…n SecureContexts, a=testonly

Automatic update from web-platform-tests
Expose kv-storage built-in module only on SecureContexts

This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691821}

--

wpt-commits: cb808982deeb57212fb856858c1a7716d0ac2ecb
wpt-pr: 17863
@domenic
Copy link
Collaborator

domenic commented Sep 23, 2019

Built-in module support was removed in #176 so this is no longer applicable.

@domenic domenic closed this as completed Sep 23, 2019
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…n SecureContexts, a=testonly

Automatic update from web-platform-tests
Expose kv-storage built-in module only on SecureContexts

This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshigechromium.org>
Reviewed-by: Kouhei Ueno <kouheichromium.org>
Cr-Commit-Position: refs/heads/master{#691821}

--

wpt-commits: cb808982deeb57212fb856858c1a7716d0ac2ecb
wpt-pr: 17863

UltraBlame original commit: c1d0da7bf6a9c3b42d025aaedd5f352b6fd1345a
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…n SecureContexts, a=testonly

Automatic update from web-platform-tests
Expose kv-storage built-in module only on SecureContexts

This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshigechromium.org>
Reviewed-by: Kouhei Ueno <kouheichromium.org>
Cr-Commit-Position: refs/heads/master{#691821}

--

wpt-commits: cb808982deeb57212fb856858c1a7716d0ac2ecb
wpt-pr: 17863

UltraBlame original commit: c1d0da7bf6a9c3b42d025aaedd5f352b6fd1345a
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…n SecureContexts, a=testonly

Automatic update from web-platform-tests
Expose kv-storage built-in module only on SecureContexts

This CL adds actual restriction in Blink implementation.

This CL also modifies tests and expectations to match with
the current Blink built-in/import maps infra.

A subtest in WPT test `import-statement.html` is failing
because the current Blink implementation is based on
pre-import-map spec and thus
importing unavailable built-in causes fetch error.
See 'import 'std:nonexistent';' row of
WICG/import-maps#159.

Bug: 977470
Change-Id: I107f60ed95e1f91d62f468c29c5d741eef13f4f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1702754
Commit-Queue: Hiroshige Hayashizaki <hiroshigechromium.org>
Reviewed-by: Kouhei Ueno <kouheichromium.org>
Cr-Commit-Position: refs/heads/master{#691821}

--

wpt-commits: cb808982deeb57212fb856858c1a7716d0ac2ecb
wpt-pr: 17863

UltraBlame original commit: c1d0da7bf6a9c3b42d025aaedd5f352b6fd1345a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants