[webkit-changes] [WebKit/WebKit] b72b25: [WebIDL] Default toJSON() method should create res...

Alexey Shvayka noreply at github.com
Thu Sep 8 11:23:53 PDT 2022


  Branch: refs/heads/bug-244939
  Home:   https://github.com/WebKit/WebKit
  Commit: b72b25a70618874c27728d7aead33a5569801e92
      https://github.com/WebKit/WebKit/commit/b72b25a70618874c27728d7aead33a5569801e92
  Author: Alexey Shvayka <shvaikalesh at gmail.com>
  Date:   2022-09-08 (Thu, 08 Sep 2022)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/default-toJSON-cross-realm-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/default-toJSON-cross-realm.html
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSON.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONFilteredByExposed.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInherit.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp

  Log Message:
  -----------
  [WebIDL] Default toJSON() method should create result object in its realm
https://bugs.webkit.org/show_bug.cgi?id=244939

Reviewed by NOBODY (OOPS!).

Per ECMA-262 [1], %Object.prototype% notation points to current realm, which
is the realm of toJSON() function [2], and not the relevant one.

Aligns WebKit with Blink and Gecko.

[1] https://tc39.es/ecma262/#sec-well-known-intrinsic-objects (paragraph 2)
[2] https://webidl.spec.whatwg.org/#default-tojson-steps (step 4)

* LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/default-toJSON-cross-realm-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/default-toJSON-cross-realm.html: Added.
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultToJSONOperationDefinition):
* Source/WebCore/bindings/scripts/test/JS/*: Updated.




More information about the webkit-changes mailing list