Changeset 253855 in webkit


Ignore:
Timestamp:
Dec 20, 2019 5:04:28 PM (4 years ago)
Author:
Chris Dumez
Message:

[Bindings] Add @@toStringTag to our iterator prototype object
https://bugs.webkit.org/show_bug.cgi?id=205516

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

  • web-platform-tests/WebIDL/ecmascript-binding/default-iterator-object-expected.txt:
  • web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object-expected.txt:

Source/WebCore:

Add @@ toStringTag to our iterator prototype object, as per:

No new tests, rebaselined existing tests.

  • bindings/js/JSDOMIterator.h:

(WebCore::IteratorTraits>::finishCreation):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r253832 r253855  
     12019-12-20  Chris Dumez  <cdumez@apple.com>
     2
     3        [Bindings] Add @@toStringTag to our iterator prototype object
     4        https://bugs.webkit.org/show_bug.cgi?id=205516
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline WPT tests that are now passing.
     9
     10        * web-platform-tests/WebIDL/ecmascript-binding/default-iterator-object-expected.txt:
     11        * web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object-expected.txt:
     12
    1132019-12-20  Truitt Savell  <tsavell@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/default-iterator-object-expected.txt

    r232641 r253855  
    22PASS Default iterator objects for an interface have the same prototype
    33PASS Object.prototype.toString returns correct value
    4 FAIL @@toStringTag has correct value from prototype assert_equals: expected (string) "URLSearchParams Iterator" but got (undefined) undefined
     4PASS @@toStringTag has correct value from prototype
    55
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/iterator-prototype-object-expected.txt

    r232641 r253855  
    44PASS next() throws TypeError when called on ineligible receiver
    55PASS Object.prototype.toString returns correct value
    6 FAIL @@toStringTag has correct value undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(iteratorProto, Symbol.toStringTag).value')
     6PASS @@toStringTag has correct value
    77PASS Is specific to an interface
    88
  • trunk/Source/WebCore/ChangeLog

    r253852 r253855  
     12019-12-20  Chris Dumez  <cdumez@apple.com>
     2
     3        [Bindings] Add @@toStringTag to our iterator prototype object
     4        https://bugs.webkit.org/show_bug.cgi?id=205516
     5
     6        Reviewed by Darin Adler.
     7
     8        Add @@ toStringTag to our iterator prototype object, as per:
     9        - https://heycam.github.io/webidl/#es-iterator-prototype-object
     10
     11        No new tests, rebaselined existing tests.
     12
     13        * bindings/js/JSDOMIterator.h:
     14        (WebCore::IteratorTraits>::finishCreation):
     15
    1162019-12-20  Jer Noble  <jer.noble@apple.com>
    217
  • trunk/Source/WebCore/bindings/js/JSDOMIterator.h

    r251425 r253855  
    2929#include "JSDOMConvert.h"
    3030#include <JavaScriptCore/IteratorPrototype.h>
     31#include <JavaScriptCore/PropertySlot.h>
    3132#include <type_traits>
    3233
     
    265266    ASSERT(inherits(vm, info()));
    266267
     268    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(vm, info()->className), JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly);
    267269    JSC_NATIVE_INTRINSIC_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->next, next, 0, 0, JSC::NoIntrinsic);
    268270}
Note: See TracChangeset for help on using the changeset viewer.