diff --git a/source b/source index cf487e9120d..b13c0964e93 100644 --- a/source +++ b/source @@ -2764,19 +2764,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute @@isConcatSpreadable, @@toPrimitive, and @@toStringTag +
  • NativeError
  • Well-Known Intrinsic Objects, including %Array.prototype%, %Error.prototype%, - %EvalError.prototype%, + %AggregateError.prototype%, %Function.prototype%, %JSON.parse%, %Object.prototype%, - %Object.prototype.valueOf%, - %RangeError.prototype%, - %ReferenceError.prototype%, - %SyntaxError.prototype%, - %TypeError.prototype%, and - %URIError.prototype%
  • + %Object.prototype.valueOf%.
  • The FunctionBody production
  • The Module production
  • @@ -2890,6 +2886,14 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The HostGetSupportedImportAssertions abstract operation
  • +

    User agents that support JavaScript must also implement the Error Cause + proposal. The following terms are defined there, and used in this specification:

    + + +

    The following terms are defined in the JSON modules proposal and used in this specification:

    @@ -2908,6 +2912,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute @@ -8325,26 +8330,35 @@ interface DOMStringList {
  • Let name be ? Get(value, "name").

  • -
  • If name is not one of "Error", "EvalError", "RangeError", "ReferenceError", - "SyntaxError", "TypeError", or "URIError", then set name to "Error".

  • +
  • If name is neither "AggregateError", nor one of the + NativeError names, nor one of the WebAssembly Error class + names, then set name to "Error".

  • + +
  • Let message be ? StructuredSerializeInternal(? Get(value, "message"), forStorage, + memory).

  • + +
  • Let cause be ? StructuredSerializeInternal(? Get(value, "cause"), forStorage, + memory).

  • -
  • Let valueMessageDesc be ? value.[[GetOwnProperty]]("message").

  • +
  • Let errors be undefined.

  • -
  • Let message be undefined if - IsDataDescriptor(valueMessageDesc) is false, and - ? ToString(valueMessageDesc.[[Value]]) otherwise.

  • +
  • If name is "AggregateError", then set errors to ? + StructuredSerializeInternal(? Get(value, + "errors"), forStorage, memory).

  • Set serialized to { [[Type]]: "Error", [[Name]]: name, - [[Message]]: message }.

  • + [[Message]]: message, [[Cause]]: cause, [[Errors]]: errors + }.

  • -

    User agents should attach a serialized representation of any interesting accompanying - data which are not yet specified, notably the stack property, to +

    User agents should attach a serialized representation of any interesting accompanying data + which are not yet specified, notably the stack property, to serialized.

    -

    See the Error Stacks proposal for in-progress work on - specifying this data.

    +

    See the Error Stacks proposal for in-progress work on specifying + this data.

  • @@ -8520,8 +8534,8 @@ interface DOMStringList {

    If ! HasOwnProperty(value, key) is true, then:

      -
    1. Let inputValue be ? value.[[Get]](key, - value).

    2. +
    3. Let inputValue be ? Get(value, + key).

    4. Let outputValue be ? StructuredSerializeInternal(inputValue, forStorage, @@ -8737,38 +8751,41 @@ o.myself = o;

      Otherwise, if serialized.[[Type]] is "Error", then:

        -
      1. Let prototype be %Error.prototype%.

      2. - -
      3. If serialized.[[Name]] is "EvalError", then set prototype to - %EvalError.prototype%.

      4. +
      5. Let name be serialized.[[Name]].

      6. -
      7. If serialized.[[Name]] is "RangeError", then set prototype - to %RangeError.prototype%.

      8. +
      9. Let prototype be + targetRealm.[[Intrinsics]].[[%name%.prototype]], or the equivalent if + name is a WebAssembly Error class name.

      10. -
      11. If serialized.[[Name]] is "ReferenceError", then set - prototype to %ReferenceError.prototype%.

      12. +
      13. Set value to ! ObjectCreate(prototype, « + [[ErrorData]] »).

      14. -
      15. If serialized.[[Name]] is "SyntaxError", then set prototype - to %SyntaxError.prototype%.

      16. +
      17. Let message be ? + StructuredDeserialize(serialized.[[Message]], targetRealm, + memory).

      18. -
      19. If serialized.[[Name]] is "TypeError", then set prototype to - %TypeError.prototype%.

      20. +
      21. Perform ! CreateNonEnumerableDataPropertyOrThrow(value, + "message", message).

      22. -
      23. If serialized.[[Name]] is "URIError", then set prototype to - %URIError.prototype%.

      24. +
      25. Let cause be ? + StructuredDeserialize(serialized.[[Cause]], targetRealm, + memory).

      26. -
      27. Let message be serialized.[[Message]].

      28. +
      29. Perform ! CreateNonEnumerableDataPropertyOrThrow(value, "cause", + cause).

      30. -
      31. Set value to ! ObjectCreate(prototype, « - [[ErrorData]] »).

      32. +
      33. +

        If name is "AggregateError", then:

        -
      34. Let messageDesc be PropertyDescriptor{ [[Value]]: - message, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true - }.

      35. +
          +
        1. Let errors be ? + StructuredDeserialize(serialized.[[Errors]], targetRealm, + memory).

        2. -
        3. If message is not undefined, then perform ! - OrdinaryDefineOwnProperty(value, "message", - messageDesc).

        4. +
        5. Perform ! CreateNonEnumerableDataPropertyOrThrow(value, + "errors", errors).

        6. +
        +
      36. Any interesting accompanying data attached to serialized should be deserialized and attached to value.

      37. @@ -125405,6 +125422,9 @@ INSERT INTERFACES HERE
        [JPEG]
        JPEG File Interchange Format, E. Hamilton.
        +
        [JSERRORCAUSE]
        +
        Error Cause. Ecma International.
        +
        [JSERRORSTACKS]
        (Non-normative) Error Stacks. Ecma International.
        @@ -125671,7 +125691,7 @@ INSERT INTERFACES HERE
        uuid, B. Coe, R. Kieffer, C. Tavan. WICG.
        [WASMJS]
        -
        (Non-normative) WebAssembly JavaScript Interface, D. Ehrenberg. W3C.
        +
        WebAssembly JavaScript Interface, D. Ehrenberg. W3C.
        [WCAG]
        (Non-normative) Web Content Accessibility Guidelines (WCAG), A. Kirkpatrick, J. O Connor, A. Campbell, M. Cooper. W3C.