From c7fffa9cda2f9721ae9dd0dd2d076c12c31ad718 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 19 Sep 2024 10:46:55 -0600 Subject: [PATCH 1/4] Editorial: replace uses of the Type macro with is-a tests --- source | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/source b/source index f27cfb126c9..b247570aa98 100644 --- a/source +++ b/source @@ -2996,7 +2996,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The Pattern production
  • The Script production
  • -
  • The Type notation
  • The Completion Record specification type
  • The List and Record specification types
  • @@ -3063,6 +3062,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The RegExpBuiltinExec abstract operation
  • The RegExpCreate abstract operation
  • The RunJobs abstract operation
  • +
  • The SameType abstract operation
  • The SameValue abstract operation
  • The ScriptEvaluation abstract operation
  • The SetImmutablePrototype abstract operation
  • @@ -9559,12 +9559,11 @@ interface DOMStringList {
  • Let deep be false.

  • -
  • If Type(value) is Undefined, Null, Boolean, - Number, BigInt, or String, then return { [[Type]]: "primitive", - [[Value]]: value }.

  • +
  • If value is undefined, null, a Boolean, a Number, a BigInt, or a String, then + return { [[Type]]: "primitive", [[Value]]: value }.

  • -
  • If Type(value) is Symbol, then throw a - "DataCloneError" DOMException.

  • +
  • If value is a Symbol, then throw a "DataCloneError" + DOMException.

  • Let serialized be an uninitialized value.

  • @@ -12063,7 +12062,7 @@ document.createElement("bad-1"); // (2) "prototype").

  • -

    If Type(prototype) is not Object, then:

    +

    If prototype is not an Object, then:

    1. Let realm be ? GetFunctionRealm(NewTarget).

    2. @@ -71120,10 +71119,10 @@ interface OffscreenCanvasRenderingContext2D {

      If type is an image format that supports variable quality (such as "image/jpeg"), quality is given, and type is not - "image/png", then, if Type(quality) is - Number, and quality is in the range 0.0 to 1.0 inclusive, the user agent must treat - quality as the desired quality level. Otherwise, the user agent must use its default - quality value, as if the quality argument had not been given.

      + "image/png", then, if quality is a Number in the range 0.0 to 1.0 + inclusive, the user agent must treat quality as the desired quality level. Otherwise, + the user agent must use its default quality value, as if the quality argument had not + been given.

      The use of type-testing here, instead of simply declaring quality as a Web IDL double, is a historical artifact.

      @@ -72346,8 +72345,8 @@ dictionary ElementDefinitionOptions {
    3. Let prototype be ? Get(constructor, "prototype").

    4. -
    5. If Type(prototype) is not Object, then throw a - TypeError exception.

    6. +
    7. If prototype is not an Object, then throw a TypeError + exception.

    8. Let lifecycleCallbacks be a map with the keys "connectedCallback", "disconnectedCallback", " Date: Thu, 19 Sep 2024 10:47:34 -0600 Subject: [PATCH 2/4] turns out SameType isn't even used --- source | 1 - 1 file changed, 1 deletion(-) diff --git a/source b/source index b247570aa98..ef8ba8e0c7d 100644 --- a/source +++ b/source @@ -3062,7 +3062,6 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

    9. The RegExpBuiltinExec abstract operation
    10. The RegExpCreate abstract operation
    11. The RunJobs abstract operation
    12. -
    13. The SameType abstract operation
    14. The SameValue abstract operation
    15. The ScriptEvaluation abstract operation
    16. The SetImmutablePrototype abstract operation
    17. From 76079f8cf2ea2ac3790c739be87577cbf8a57830 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 25 Oct 2024 18:11:15 -0600 Subject: [PATCH 3/4] add links to ECMA-262 for JS types --- source | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/source b/source index ef8ba8e0c7d..ac17d21c202 100644 --- a/source +++ b/source @@ -2996,6 +2996,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
    18. The Pattern production
    19. The Script production
    20. +
    21. The + BigInt, + Boolean, + Number, + String, + Symbol, + and Object ECMAScript language types
    22. The Completion Record specification type
    23. The List and Record specification types
    24. @@ -9558,11 +9565,13 @@ interface DOMStringList {
    25. Let deep be false.

    26. -
    27. If value is undefined, null, a Boolean, a Number, a BigInt, or a String, then - return { [[Type]]: "primitive", [[Value]]: value }.

    28. +
    29. If value is undefined, null, a Boolean, a Number, a BigInt, or a String, then return { [[Type]]: "primitive", [[Value]]: + value }.

    30. -
    31. If value is a Symbol, then throw a "DataCloneError" - DOMException.

    32. +
    33. If value is a Symbol, then throw a + "DataCloneError" DOMException.

    34. Let serialized be an uninitialized value.

    35. @@ -12061,7 +12070,7 @@ document.createElement("bad-1"); // (2)
      "prototype").

    36. -

      If prototype is not an Object, then:

      +

      If prototype is not an Object, then:

      1. Let realm be ? GetFunctionRealm(NewTarget).

      2. @@ -71118,10 +71127,10 @@ interface OffscreenCanvasRenderingContext2D {

        If type is an image format that supports variable quality (such as "image/jpeg"), quality is given, and type is not - "image/png", then, if quality is a Number in the range 0.0 to 1.0 - inclusive, the user agent must treat quality as the desired quality level. Otherwise, - the user agent must use its default quality value, as if the quality argument had not - been given.

        + "image/png", then, if quality is a Number + in the range 0.0 to 1.0 inclusive, the user agent must treat quality as the desired + quality level. Otherwise, the user agent must use its default quality value, as if the + quality argument had not been given.

        The use of type-testing here, instead of simply declaring quality as a Web IDL double, is a historical artifact.

        @@ -72344,8 +72353,8 @@ dictionary ElementDefinitionOptions {
      3. Let prototype be ? Get(constructor, "prototype").

      4. -
      5. If prototype is not an Object, then throw a TypeError - exception.

      6. +
      7. If prototype is not an Object, then throw a + TypeError exception.

      8. Let lifecycleCallbacks be a map with the keys "connectedCallback", "disconnectedCallback", " Date: Fri, 25 Oct 2024 18:16:31 -0600 Subject: [PATCH 4/4] add my name to the acknowledgements section --- source | 1 + 1 file changed, 1 insertion(+) diff --git a/source b/source index ac17d21c202..730c5f713eb 100644 --- a/source +++ b/source @@ -144781,6 +144781,7 @@ INSERT INTERFACES HERE Michael Day, Michael Dyck, Michael Enright, + Michael Ficarra, Michael Gratton, Michael Kohler, Michael McKelvey,