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

[ES6 Module] Reflect Spec PR 2991 to make error handling deterministic #8527

Merged
merged 1 commit into from
Dec 19, 2017

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 1, 2017

Spec update: whatwg/html#2991
V8-side change: https://chromium-review.googlesource.com/763369

Data members for errors are restructured:

Removed module script's "is errored" #concept-module-script-is-errored
=> Removed ModuleScript::IsErrored().

Removed module script's "error" #concept-module-script-error
=> Removed Modulator::GetError(), ModuleScript::CreateError(), and
ModuleScript::CreateErrorInternal().

Removed "set the pre-instantiation error"
#concept-module-script-set-pre-instantiation-error
=> Removed ModuleScript::SetErrorAndClearRecord().

Introduced script's "error to rethrow" #concept-script-error-to-rethrow
=> Added ModuleScript::error_to_rethrow_ and its accessors.
Also renamed ModuleScript::preinstantiation_error_ to
parse_error_, and added its accessors,

HTML/Blink no longer checks modules' status:

Removed references to [[Status]] and [[ErrorCompletion]] field.
=> Removed Modulator::GetRecordStatus(), ModuleScript::RecordStatus(),
and calls to ScriptModule::ErrorCompletion().

Removed module script's "has instantiated"
#concept-module-script-has-instantiated
=> Removed ModuleScript::HasInstantiated().

A subsequent CL will do further cleanup:
https://chromium-review.googlesource.com/802465

Error handling algorithms in the HTML spec were updated:

  • #creating-a-module-script
  • #run-a-module-script
  • [FFPE] #finding-the-first-parse-error
  • [IMSGF] #internal-module-script-graph-fetching-procedure
  • [FD] #fetch-the-descendants-of-a-module-script
  • [FDaI] #fetch-the-descendants-of-and-instantiate-a-module-script
  • #hostresolveimportedmodule(referencingscriptormodule,-specifier)

And thus this CL updates the following accordingly:

  • ModuleScript::Create()
  • ModulatorImplBase::ExecuteModule()
  • ModuleTreeLinker.cpp
  • ScriptModuleResolverImpl::Resolve()

The behavior changes are:

  • User-facing: the error reported (to window.onerror etc.) is changed
    and made deterministic, as intended by the spec update.
  • V8-facing: this CL
    • invokes module instantiation of a module graph
      with existing instantiation/evaluation errors.
    • invokes evaluation of a module graph with existing evaluation errors.
      These cases already occur, but this CL does these intentionally.

Bug: 763597
Change-Id: Ia02bb484290c5c07ab27e9c966db19a6e8d2596f
Reviewed-on: https://chromium-review.googlesource.com/698467
Commit-Queue: Hiroshige Hayashizaki hiroshige@chromium.org
Reviewed-by: Kouhei Ueno kouhei@chromium.org
Cr-Commit-Position: refs/heads/master@{#525168}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

@ghost
Copy link

ghost commented Dec 1, 2017

Build PASSED

Started: 2017-12-19 23:04:08
Finished: 2017-12-19 23:08:26

Failing Jobs

  • chrome:unstable

View more information about this build on:

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-698467 branch 3 times, most recently from e7d1146 to 8da0f9e Compare December 18, 2017 23:27
Spec update: whatwg/html#2991
V8-side change: https://chromium-review.googlesource.com/763369

Data members for errors are restructured:

Removed module script's "is errored" #concept-module-script-is-errored
  => Removed ModuleScript::IsErrored().

Removed module script's "error" #concept-module-script-error
  => Removed Modulator::GetError(), ModuleScript::CreateError(), and
     ModuleScript::CreateErrorInternal().

Removed "set the pre-instantiation error"
  #concept-module-script-set-pre-instantiation-error
  => Removed ModuleScript::SetErrorAndClearRecord().

Introduced script's "error to rethrow" #concept-script-error-to-rethrow
  => Added ModuleScript::error_to_rethrow_ and its accessors.
     Also renamed ModuleScript::preinstantiation_error_ to
     parse_error_, and added its accessors,

HTML/Blink no longer checks modules' status:

Removed references to [[Status]] and [[ErrorCompletion]] field.
  => Removed Modulator::GetRecordStatus(), ModuleScript::RecordStatus(),
     and calls to ScriptModule::ErrorCompletion().

Removed module script's "has instantiated"
  #concept-module-script-has-instantiated
  => Removed ModuleScript::HasInstantiated().

A subsequent CL will do further cleanup:
https://chromium-review.googlesource.com/802465

Error handling algorithms in the HTML spec were updated:
- #creating-a-module-script
- #run-a-module-script
- [FFPE] #finding-the-first-parse-error
- [IMSGF] #internal-module-script-graph-fetching-procedure
- [FD] #fetch-the-descendants-of-a-module-script
- [FDaI] #fetch-the-descendants-of-and-instantiate-a-module-script
- #hostresolveimportedmodule(referencingscriptormodule,-specifier)

And thus this CL updates the following accordingly:
- ModuleScript::Create()
- ModulatorImplBase::ExecuteModule()
- ModuleTreeLinker.cpp
- ScriptModuleResolverImpl::Resolve()

The behavior changes are:
- User-facing: the error reported (to window.onerror etc.) is changed
  and made deterministic, as intended by the spec update.
- V8-facing: this CL
  - invokes module instantiation of a module graph
    with existing instantiation/evaluation errors.
  - invokes evaluation of a module graph with existing evaluation errors.
  These cases already occur, but this CL does these intentionally.

Bug: 763597
Change-Id: Ia02bb484290c5c07ab27e9c966db19a6e8d2596f
Reviewed-on: https://chromium-review.googlesource.com/698467
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525168}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants