Changeset 227649 in webkit


Ignore:
Timestamp:
Jan 25, 2018 6:42:14 PM (6 years ago)
Author:
Yusuke Suzuki
Message:

imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html crashes
https://bugs.webkit.org/show_bug.cgi?id=181980

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

  • web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error-expected.txt:
  • web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling-expected.txt: Added.

Source/JavaScriptCore:

We accidentally failed to propagate errored promise in instantiate and satify phase if entry.{instantiate,satisfy}
promises are set. Since we just returned entry, it becomes succeeded promise even if the dependent fetch, instantiate,
and satisfy promises are failed. This patch fixes error propagation by returning entry.instantiate and entry.satisfy
correctly.

  • builtins/ModuleLoaderPrototype.js:

(requestInstantiate):
(requestSatisfy):

LayoutTests:

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r227631 r227649  
     12018-01-25  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=181980
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * TestExpectations:
     9
    1102018-01-25  Jer Noble  <jer.noble@apple.com>
    211
  • trunk/LayoutTests/TestExpectations

    r227605 r227649  
    14051405webkit.org/b/165764 http/tests/misc/module-script-async.html [ Pass Timeout ]
    14061406
    1407 webkit.org/b/181980 imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html [ Crash ]
    1408 
    14091407# After rebasing WPT, we should investigate deterministic error handling, which is the updated spec.
    14101408imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/compilation-error-1.html [ Pass Failure ]
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r227639 r227649  
     12018-01-25  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=181980
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error-expected.txt:
     9        * web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling-expected.txt: Added.
     10
    1112018-01-25  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error-expected.txt

    r227471 r227649  
    11
    22PASS import() must reject when there is a parse error
    3 FAIL import() must reject with the same error object for each import when there is a parse error assert_throws: It must reject the second time function "function () { throw e }" threw object "TypeError: Type error" ("TypeError") expected object "SyntaxError" ("SyntaxError")
     3PASS import() must reject with the same error object for each import when there is a parse error
    44PASS import() must reject when there is a bad module specifier
    55PASS import() must reject with different error objects for each import when there is a bad module specifier
    66PASS import() must reject when there is a bad module specifier in a dependency
    7 FAIL import() must reject with the same error object for each import when there is a bad module specifier in a dependency assert_equals: The error objects must be equal expected object "TypeError: Type error" but got object "TypeError: Module specifier does not start with "/", "./", or "../"."
     7PASS import() must reject with the same error object for each import when there is a bad module specifier in a dependency
    88PASS import() must reject when there is a instantiation error
    99PASS import() must reject with the same error object for each import when there is a instantiation error
    1010PASS import() must reject when there is a evaluation error
    11 FAIL import() must reject with the same error object for each import when there is a evaluation error assert_unreached: Should have rejected: It must reject the first time Reached unreachable code
     11FAIL import() must reject with the same error object for each import when there is a evaluation error assert_unreached: Should have rejected: It must reject the second time Reached unreachable code
    1212PASS import()ing a module with an evaluation error must stop evaluation
    1313
  • trunk/Source/JavaScriptCore/ChangeLog

    r227644 r227649  
     12018-01-25  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=181980
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        We accidentally failed to propagate errored promise in instantiate and satify phase if entry.{instantiate,satisfy}
     9        promises are set. Since we just returned `entry`, it becomes succeeded promise even if the dependent fetch, instantiate,
     10        and satisfy promises are failed. This patch fixes error propagation by returning `entry.instantiate` and `entry.satisfy`
     11        correctly.
     12
     13        * builtins/ModuleLoaderPrototype.js:
     14        (requestInstantiate):
     15        (requestSatisfy):
     16
    1172018-01-25  Mark Lam  <mark.lam@apple.com>
    218
  • trunk/Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js

    r224662 r227649  
    194194        // Instantiation won't be retried.
    195195        if (entry.instantiate)
    196             return entry;
     196            return entry.instantiate;
    197197        entry.instantiate = instantiatePromise;
    198198
     
    230230    var satisfyPromise = this.requestInstantiate(entry, parameters, fetcher).then((entry) => {
    231231        if (entry.satisfy)
    232             return entry;
     232            return entry.satisfy;
    233233
    234234        var depLoads = @newArrayWithSize(entry.dependencies.length);
Note: See TracChangeset for help on using the changeset viewer.