Changeset 256716 in webkit


Ignore:
Timestamp:
Feb 16, 2020, 5:41:27 PM (5 years ago)
Author:
Alexey Shvayka
Message:

Implement EventTarget constructor
https://bugs.webkit.org/show_bug.cgi?id=174313

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

  • web-platform-tests/WebIDL/ecmascript-binding/constructors-expected.txt:
  • web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
  • web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt:
  • web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt:
  • web-platform-tests/dom/events/event-global-extra.window-expected.txt:
  • web-platform-tests/dom/idlharness.any.worker-expected.txt:
  • web-platform-tests/dom/idlharness.window-expected.txt:

Source/WebCore:

Currently, EventTarget can't be directly constructed or be subclassed in JavaScript.
The spec for EventTarget was updated (https://github.com/whatwg/dom/pull/467) to allow
constructing and subclassing EventTarget. This feature was shipped in Chrome 64 and Firefox 59.

This patch introduces EventTargetConcrete class, a user-constructable version of EventTarget,
exposed as "EventTarget" to JavaScript. We don't use EventTarget directly because it is an abstract
class and making it non-abstract is unfavorable due to size increase of EventTarget and all of its
subclasses with code that is mostly unnecessary for them, resulting in a performance decrease.

To prevent definition of specific to EventTargetConcrete toJS and toJSNewlyCreated functions,
we don't define EventTargetConcrete interface type, but rather tweak make_event_factory.pl to
default to base interface (like it does for Event).

To allow subclassing of all DOM constructors, non-custom ones replace structures of newly created
wrapper objects with ones returned by InternalFunction::createSubclassStructure. Per WebIDL spec [1],
setSubclassStructureIfNeeded helper uses realm of newTarget for default prototypes.

This approach was chosen because a) detecting Construct with callFrame->newTarget() is
unreliable outside constructor, and b) passing newTarget down to createWrapper via
toJSNewlyCreated is quite awkward and would result in massive code change.

[1] https://heycam.github.io/webidl/#internally-create-a-new-object-implementing-the-interface
(step 3.3.2)

Tests: fast/dom/dom-constructors.html

imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/constructors.html
imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html
imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any.html
imported/w3c/web-platform-tests/dom/idlharness.window.html

  • Headers.cmake:
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMWrapperCache.h:

(WebCore::setSubclassStructureIfNeeded):

  • bindings/js/JSEventTargetCustom.cpp:

(WebCore::toJSNewlyCreated):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateConstructorDefinition):

  • bindings/scripts/InFilesCompiler.pm:

(generateInterfacesHeader):

  • bindings/scripts/test/JS/*: Adjust bindings expectations.
  • dom/EventTarget.cpp:

(WebCore::EventTarget::create):

  • dom/EventTarget.h:
  • dom/EventTarget.idl:
  • dom/EventTargetConcrete.cpp: Added.
  • dom/EventTargetConcrete.h: Added.
  • dom/make_event_factory.pl:

(generateImplementation):

LayoutTests:

  • fast/dom/dom-constructors-expected.txt:
  • fast/dom/dom-constructors.html:
  • platform/ios/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt: Removed.
Location:
trunk
Files:
2 added
1 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r256714 r256716  
     12020-02-16  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Implement EventTarget constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=174313
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/dom/dom-constructors-expected.txt:
     9        * fast/dom/dom-constructors.html:
     10        * platform/ios/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt: Removed.
     11
    1122020-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/LayoutTests/fast/dom/dom-constructors-expected.txt

    r207767 r256716  
    99PASS TryAllocate('DocumentType') is 'exception'
    1010PASS TryAllocate('Element') is 'exception'
    11 PASS TryAllocate('EventTarget') is 'exception'
    1211PASS TryAllocate('HTMLDocument') is 'exception'
    1312PASS TryAllocate('Node') is 'exception'
     
    132131PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
    133132PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
     133PASS TryAllocate('EventTarget') is '[object EventTarget]'
     134PASS TryAllocate('EventTarget') is '[object EventTarget]'
     135PASS TryAllocate('EventTarget') is '[object EventTarget]'
    134136PASS TryAllocate('Range') is '[object Range]'
    135137PASS TryAllocate('Range') is '[object Range]'
  • trunk/LayoutTests/fast/dom/dom-constructors.html

    r207767 r256716  
    1919    'DocumentType',
    2020    'Element',
    21     'EventTarget',
    2221    'HTMLDocument',
    2322    'Node',
     
    133132    'Document',
    134133    'DocumentFragment',
     134    'EventTarget',
    135135    'Range',
    136136    'Text',
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r256649 r256716  
     12020-02-16  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Implement EventTarget constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=174313
     5
     6        Reviewed by Darin Adler.
     7
     8        * web-platform-tests/WebIDL/ecmascript-binding/constructors-expected.txt:
     9        * web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
     10        * web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt:
     11        * web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt:
     12        * web-platform-tests/dom/events/event-global-extra.window-expected.txt:
     13        * web-platform-tests/dom/idlharness.any.worker-expected.txt:
     14        * web-platform-tests/dom/idlharness.window-expected.txt:
     15
    1162020-02-14  Rossana Monteriso  <rmonteriso@igalia.com>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/constructors-expected.txt

    r253783 r256716  
    33PASS Normal constructor in parent window
    44PASS Normal constructor in child window
    5 FAIL Constructor in child window with normal NewTarget from parent window assert_equals: expected object "[object DOMParserPrototype]" but got object "[object DOMParserPrototype]"
    6 FAIL Constructor in parent window with normal NewTarget from child window assert_equals: expected object "[object DOMParserPrototype]" but got object "[object DOMParserPrototype]"
    7 FAIL Subclass constructor in parent window assert_equals: expected object "[object Object]" but got object "[object DOMParserPrototype]"
    8 FAIL Subclass constructor in child window assert_equals: expected object "[object Object]" but got object "[object DOMParserPrototype]"
    9 FAIL Subclass constructor in parent window with parent class in child window assert_equals: expected object "[object Object]" but got object "[object DOMParserPrototype]"
    10 FAIL Subclass constructor in child window with parent class in parent window assert_equals: expected object "[object Object]" but got object "[object DOMParserPrototype]"
    11 FAIL Constructor in child window with bad NewTarget from parent window assert_equals: expected object "[object DOMParserPrototype]" but got object "[object DOMParserPrototype]"
    12 FAIL Constructor in parent window with bad NewTarget from child window assert_equals: expected object "[object DOMParserPrototype]" but got object "[object DOMParserPrototype]"
     5PASS Constructor in child window with normal NewTarget from parent window
     6PASS Constructor in parent window with normal NewTarget from child window
     7PASS Subclass constructor in parent window
     8PASS Subclass constructor in child window
     9PASS Subclass constructor in parent window with parent class in child window
     10PASS Subclass constructor in child window with parent class in parent window
     11PASS Constructor in child window with bad NewTarget from parent window
     12PASS Constructor in parent window with bad NewTarget from child window
    1313FAIL Constructor in parent window with bad NewTarget from parent window that's a bound child window function assert_equals: expected object "[object DOMParserPrototype]" but got object "[object DOMParserPrototype]"
    1414FAIL Constructor in child window with bad NewTarget from child window that's a bound parent window function assert_equals: expected object "[object DOMParserPrototype]" but got object "[object DOMParserPrototype]"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt

    r229544 r256716  
    4242PASS CompositionEvent constructor (argument with default values)
    4343PASS CompositionEvent constructor (argument with non-default values)
    44 FAIL SubclassedEvent constructor (no argument) assert_true: expected true got false
    45 FAIL SubclassedEvent constructor (undefined argument) assert_true: expected true got false
    46 FAIL SubclassedEvent constructor (null argument) assert_true: expected true got false
    47 FAIL SubclassedEvent constructor (empty argument) assert_true: expected true got false
    48 FAIL SubclassedEvent constructor (argument with default values) assert_true: expected true got false
    49 FAIL SubclassedEvent constructor (argument with non-default values) assert_true: expected true got false
     44PASS SubclassedEvent constructor (no argument)
     45PASS SubclassedEvent constructor (undefined argument)
     46PASS SubclassedEvent constructor (null argument)
     47PASS SubclassedEvent constructor (empty argument)
     48PASS SubclassedEvent constructor (argument with default values)
     49PASS SubclassedEvent constructor (argument with non-default values)
    5050PASS UIEvent constructor (view argument with wrong type)
    5151
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt

    r220772 r256716  
    11
    2 FAIL A constructed EventTarget can be used as expected function is not a constructor (evaluating 'new EventTarget()')
    3 FAIL EventTarget can be subclassed function is not a constructor (evaluating 'super(...args)')
     2PASS A constructed EventTarget can be used as expected
     3PASS EventTarget can be subclassed
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt

    r220772 r256716  
    11
    2 FAIL A constructed EventTarget can be used as expected function is not a constructor (evaluating 'new EventTarget()')
    3 FAIL EventTarget can be subclassed function is not a constructor (evaluating 'super(...args)')
     2PASS A constructed EventTarget can be used as expected
     3PASS EventTarget can be subclassed
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-extra.window-expected.txt

    r248647 r256716  
    11
    2 FAIL window.event for constructors from another global: EventTarget function is not a constructor (evaluating 'new otherWindow[constructorName]()')
     2FAIL window.event for constructors from another global: EventTarget assert_equals: expected (undefined) undefined but got (object) object "[object Event]"
    33FAIL window.event for constructors from another global: XMLHttpRequest assert_equals: expected (undefined) undefined but got (object) object "[object Event]"
    44PASS window.event and element from another document
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/idlharness.any.worker-expected.txt

    r253630 r256716  
    134134PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, [object Object],[object Object])
    135135PASS EventTarget interface: operation dispatchEvent(Event)
    136 FAIL EventTarget must be primary interface of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    137 FAIL Stringification of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    138 FAIL EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    139 FAIL EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    140 FAIL EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    141 FAIL EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    142 FAIL EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    143 FAIL EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
     136PASS EventTarget must be primary interface of new EventTarget()
     137PASS Stringification of new EventTarget()
     138PASS EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type
     139PASS EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError
     140PASS EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type
     141PASS EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError
     142PASS EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type
     143PASS EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError
    144144PASS EventListener interface: existence and properties of interface object
    145145PASS AbortController interface: existence and properties of interface object
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/idlharness.window-expected.txt

    r254182 r256716  
    159159PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, [object Object],[object Object])
    160160PASS EventTarget interface: operation dispatchEvent(Event)
    161 FAIL EventTarget must be primary interface of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    162 FAIL Stringification of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    163 FAIL EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    164 FAIL EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    165 FAIL EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    166 FAIL EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    167 FAIL EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
    168 FAIL EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
     161PASS EventTarget must be primary interface of new EventTarget()
     162PASS Stringification of new EventTarget()
     163PASS EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type
     164PASS EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError
     165PASS EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type
     166PASS EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError
     167PASS EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type
     168PASS EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError
    169169PASS EventListener interface: existence and properties of interface object
    170170PASS EventListener interface: existence and properties of interface prototype object
  • trunk/Source/WebCore/ChangeLog

    r256715 r256716  
     12020-02-16  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Implement EventTarget constructor
     4        https://bugs.webkit.org/show_bug.cgi?id=174313
     5
     6        Reviewed by Darin Adler.
     7
     8        Currently, EventTarget can't be directly constructed or be subclassed in JavaScript.
     9        The spec for EventTarget was updated (https://github.com/whatwg/dom/pull/467) to allow
     10        constructing and subclassing EventTarget. This feature was shipped in Chrome 64 and Firefox 59.
     11
     12        This patch introduces EventTargetConcrete class, a user-constructable version of EventTarget,
     13        exposed as "EventTarget" to JavaScript. We don't use EventTarget directly because it is an abstract
     14        class and making it non-abstract is unfavorable due to size increase of EventTarget and all of its
     15        subclasses with code that is mostly unnecessary for them, resulting in a performance decrease.
     16
     17        To prevent definition of specific to EventTargetConcrete `toJS` and `toJSNewlyCreated` functions,
     18        we don't define EventTargetConcrete interface type, but rather tweak make_event_factory.pl to
     19        default to base interface (like it does for Event).
     20
     21        To allow subclassing of all DOM constructors, non-custom ones replace structures of newly created
     22        wrapper objects with ones returned by InternalFunction::createSubclassStructure. Per WebIDL spec [1],
     23        `setSubclassStructureIfNeeded` helper uses realm of `newTarget` for default prototypes.
     24
     25        This approach was chosen because a) detecting [[Construct]] with callFrame->newTarget() is
     26        unreliable outside constructor, and b) passing `newTarget` down to `createWrapper` via
     27        `toJSNewlyCreated` is quite awkward and would result in massive code change.
     28
     29        [1] https://heycam.github.io/webidl/#internally-create-a-new-object-implementing-the-interface
     30        (step 3.3.2)
     31
     32        Tests: fast/dom/dom-constructors.html
     33               imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/constructors.html
     34               imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html
     35               imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any.html
     36               imported/w3c/web-platform-tests/dom/idlharness.window.html
     37
     38        * Headers.cmake:
     39        * Sources.txt:
     40        * WebCore.xcodeproj/project.pbxproj:
     41        * bindings/js/JSDOMWrapperCache.h:
     42        (WebCore::setSubclassStructureIfNeeded):
     43        * bindings/js/JSEventTargetCustom.cpp:
     44        (WebCore::toJSNewlyCreated):
     45        * bindings/scripts/CodeGeneratorJS.pm:
     46        (GenerateConstructorDefinition):
     47        * bindings/scripts/InFilesCompiler.pm:
     48        (generateInterfacesHeader):
     49        * bindings/scripts/test/JS/*: Adjust bindings expectations.
     50        * dom/EventTarget.cpp:
     51        (WebCore::EventTarget::create):
     52        * dom/EventTarget.h:
     53        * dom/EventTarget.idl:
     54        * dom/EventTargetConcrete.cpp: Added.
     55        * dom/EventTargetConcrete.h: Added.
     56        * dom/make_event_factory.pl:
     57        (generateImplementation):
     58
    1592020-02-16  Brady Eidson  <beidson@apple.com>
    260
  • trunk/Source/WebCore/Headers.cmake

    r256621 r256716  
    404404    dom/EventQueue.h
    405405    dom/EventTarget.h
     406    dom/EventTargetConcrete.h
    406407    dom/Exception.h
    407408    dom/ExceptionCode.h
  • trunk/Source/WebCore/Sources.txt

    r256658 r256716  
    883883dom/EventPath.cpp
    884884dom/EventTarget.cpp
     885dom/EventTargetConcrete.cpp
    885886dom/ExceptionData.cpp
    886887dom/ExtensionStyleSheets.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r256658 r256716  
    25192519                84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F3C0FC7DFF000955300 /* SourceAlpha.h */; };
    25202520                84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F400FC7E02700955300 /* SourceGraphic.h */; };
     2521                84B349A222F86E7500D47BCF /* EventTargetConcrete.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B349A022F86E7400D47BCF /* EventTargetConcrete.h */; };
    25212522                84B6B978120F13E500B8EFAF /* SVGPathSegListSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */; };
    25222523                84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C5B2F91216DC810088B53A /* SVGPathTraversalStateBuilder.h */; };
     
    1039710398                84A81F400FC7E02700955300 /* SourceGraphic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceGraphic.h; sourceTree = "<group>"; };
    1039810399                84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SSLKeyGeneratorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     10400                84B349A022F86E7400D47BCF /* EventTargetConcrete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTargetConcrete.h; sourceTree = "<group>"; };
     10401                84B349A322F86E8200D47BCF /* EventTargetConcrete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTargetConcrete.cpp; sourceTree = "<group>"; };
    1039910402                84B62684133138F90095A489 /* FontPlatformData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontPlatformData.cpp; sourceTree = "<group>"; };
    1040010403                84B6B975120F13E500B8EFAF /* SVGPathSegListSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListSource.cpp; sourceTree = "<group>"; };
     
    2813328136                                E12EDB7A0B308A78002704B6 /* EventTarget.h */,
    2813428137                                85AFA7420AAF298400E84305 /* EventTarget.idl */,
     28138                                84B349A322F86E8200D47BCF /* EventTargetConcrete.cpp */,
     28139                                84B349A022F86E7400D47BCF /* EventTargetConcrete.h */,
    2813528140                                CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */,
    2813628141                                93D196321D6CAB8200FC7E47 /* Exception.h */,
     
    2979429799                                E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */,
    2979529800                                E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */,
     29801                                84B349A222F86E7500D47BCF /* EventTargetConcrete.h in Headers */,
    2979629802                                97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */,
    2979729803                                97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */,
  • trunk/Source/WebCore/bindings/js/JSDOMWrapperCache.h

    r251425 r256716  
    202202}
    203203
     204template<typename DOMClass> inline void setSubclassStructureIfNeeded(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, JSC::JSObject* jsObject)
     205{
     206    JSC::JSObject* newTarget = callFrame->newTarget().getObject();
     207    JSC::JSObject* constructor = callFrame->jsCallee();
     208    if (!newTarget || newTarget == constructor)
     209        return;
     210
     211    using WrapperClass = typename JSDOMWrapperConverterTraits<DOMClass>::WrapperClass;
     212
     213    JSC::VM& vm = lexicalGlobalObject->vm();
     214    auto scope = DECLARE_THROW_SCOPE(vm);
     215
     216    auto* newTargetGlobalObject = JSC::jsCast<JSDOMGlobalObject*>(newTarget->globalObject(vm));
     217    auto* baseStructure = getDOMStructure<WrapperClass>(vm, *newTargetGlobalObject);
     218    auto* subclassStructure = JSC::InternalFunction::createSubclassStructure(lexicalGlobalObject, constructor, newTarget, baseStructure);
     219    RETURN_IF_EXCEPTION(scope, void());
     220    jsObject->setStructure(vm, subclassStructure);
     221}
     222
    204223} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSEventTargetCustom.cpp

    r251630 r256716  
    4444using namespace JSC;
    4545
     46JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<EventTarget>&& value)
     47{
     48    return createWrapper<EventTarget>(globalObject, WTFMove(value));
     49}
     50
    4651EventTarget* JSEventTarget::toWrapped(VM& vm, JSValue value)
    4752{
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r255365 r256716  
    73347334            push(@$outputArray, "    VM& vm = lexicalGlobalObject->vm();\n");
    73357335            push(@$outputArray, "    auto throwScope = DECLARE_THROW_SCOPE(vm);\n");
    7336             push(@$outputArray, "    UNUSED_PARAM(throwScope);\n");
    73377336            push(@$outputArray, "    auto* castedThis = jsCast<${constructorClassName}*>(callFrame->jsCallee());\n");
    73387337            push(@$outputArray, "    ASSERT(castedThis);\n");
     
    73557354
    73567355            my $IDLType = GetIDLType($interface, $interface->type);
     7356            my $implType = GetImplClassName($interface);
    73577357
    73587358            AddToImplIncludes("JSDOMConvertInterface.h");
     
    73647364            push(@constructionConversionArguments, "WTFMove(object)");
    73657365
    7366             push(@$outputArray, "    return JSValue::encode(toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . "));\n");
     7366            # FIXME: toJSNewlyCreated should return JSObject* instead of JSValue.
     7367            push(@$outputArray, "    auto jsValue = toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . ");\n");
     7368            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n") if $interface->extendedAttributes->{ConstructorMayThrowException};
     7369            push(@$outputArray, "    setSubclassStructureIfNeeded<${implType}>(lexicalGlobalObject, callFrame, asObject(jsValue));\n");
     7370            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n");
     7371            push(@$outputArray, "    return JSValue::encode(jsValue);\n");
    73677372            push(@$outputArray, "}\n\n");
    73687373        }
  • trunk/Source/WebCore/bindings/scripts/InFilesCompiler.pm

    r233443 r256716  
    244244    }
    245245
     246    if ($namespace eq "EventTarget") {
     247        print F "    ${suffix} = $count,\n";
     248        $count++;
     249    }
     250
    246251    for my $interface (sort keys %unconditionalInterfaces) {
    247252        print F "    ${interface}${suffix} = $count,\n";
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp

    r255126 r256716  
    160160    VM& vm = lexicalGlobalObject->vm();
    161161    auto throwScope = DECLARE_THROW_SCOPE(vm);
    162     UNUSED_PARAM(throwScope);
    163162    auto* castedThis = jsCast<JSTestEventConstructorConstructor*>(callFrame->jsCallee());
    164163    ASSERT(castedThis);
     
    170169    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    171170    auto object = TestEventConstructor::create(WTFMove(type), WTFMove(eventInitDict));
    172     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     171    auto jsValue = toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     172    setSubclassStructureIfNeeded<TestEventConstructor>(lexicalGlobalObject, callFrame, asObject(jsValue));
     173    RETURN_IF_EXCEPTION(throwScope, { });
     174    return JSValue::encode(jsValue);
    173175}
    174176
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp

    r254252 r256716  
    259259    VM& vm = lexicalGlobalObject->vm();
    260260    auto throwScope = DECLARE_THROW_SCOPE(vm);
    261     UNUSED_PARAM(throwScope);
    262261    auto* castedThis = jsCast<JSTestInterfaceConstructor*>(callFrame->jsCallee());
    263262    ASSERT(castedThis);
     
    272271    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    273272    auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2));
    274     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestInterface>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)));
     273    auto jsValue = toJSNewlyCreated<IDLInterface<TestInterface>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
     274    RETURN_IF_EXCEPTION(throwScope, { });
     275    setSubclassStructureIfNeeded<TestInterface>(lexicalGlobalObject, callFrame, asObject(jsValue));
     276    RETURN_IF_EXCEPTION(throwScope, { });
     277    return JSValue::encode(jsValue);
    275278}
    276279
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp

    r255126 r256716  
    9595    VM& vm = lexicalGlobalObject->vm();
    9696    auto throwScope = DECLARE_THROW_SCOPE(vm);
    97     UNUSED_PARAM(throwScope);
    9897    auto* castedThis = jsCast<JSTestNamedConstructorNamedConstructor*>(callFrame->jsCallee());
    9998    ASSERT(castedThis);
     
    107106    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    108107    auto object = TestNamedConstructor::createForJSConstructor(WTFMove(str1), WTFMove(str2), WTFMove(str3));
    109     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)));
     108    auto jsValue = toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
     109    RETURN_IF_EXCEPTION(throwScope, { });
     110    setSubclassStructureIfNeeded<TestNamedConstructor>(lexicalGlobalObject, callFrame, asObject(jsValue));
     111    RETURN_IF_EXCEPTION(throwScope, { });
     112    return JSValue::encode(jsValue);
    110113}
    111114
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp

    r255126 r256716  
    103103    VM& vm = lexicalGlobalObject->vm();
    104104    auto throwScope = DECLARE_THROW_SCOPE(vm);
    105     UNUSED_PARAM(throwScope);
    106105    auto* castedThis = jsCast<JSTestNodeConstructor*>(callFrame->jsCallee());
    107106    ASSERT(castedThis);
    108107    auto object = TestNode::create();
    109     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestNode>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     108    auto jsValue = toJSNewlyCreated<IDLInterface<TestNode>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     109    setSubclassStructureIfNeeded<TestNode>(lexicalGlobalObject, callFrame, asObject(jsValue));
     110    RETURN_IF_EXCEPTION(throwScope, { });
     111    return JSValue::encode(jsValue);
    110112}
    111113
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r255224 r256716  
    19491949    VM& vm = lexicalGlobalObject->vm();
    19501950    auto throwScope = DECLARE_THROW_SCOPE(vm);
    1951     UNUSED_PARAM(throwScope);
    19521951    auto* castedThis = jsCast<JSTestObjConstructor*>(callFrame->jsCallee());
    19531952    ASSERT(castedThis);
     
    19641963    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    19651964    auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull());
    1966     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     1965    auto jsValue = toJSNewlyCreated<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     1966    setSubclassStructureIfNeeded<TestObj>(lexicalGlobalObject, callFrame, asObject(jsValue));
     1967    RETURN_IF_EXCEPTION(throwScope, { });
     1968    return JSValue::encode(jsValue);
    19671969}
    19681970
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp

    r255126 r256716  
    8282    VM& vm = lexicalGlobalObject->vm();
    8383    auto throwScope = DECLARE_THROW_SCOPE(vm);
    84     UNUSED_PARAM(throwScope);
    8584    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
    8685    ASSERT(castedThis);
     
    8887    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    8988    auto object = TestOverloadedConstructors::create(*arrayBuffer);
    90     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     89    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     90    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue));
     91    RETURN_IF_EXCEPTION(throwScope, { });
     92    return JSValue::encode(jsValue);
    9193}
    9294
     
    9597    VM& vm = lexicalGlobalObject->vm();
    9698    auto throwScope = DECLARE_THROW_SCOPE(vm);
    97     UNUSED_PARAM(throwScope);
    9899    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
    99100    ASSERT(castedThis);
     
    101102    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    102103    auto object = TestOverloadedConstructors::create(arrayBufferView.releaseNonNull());
    103     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     104    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     105    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue));
     106    RETURN_IF_EXCEPTION(throwScope, { });
     107    return JSValue::encode(jsValue);
    104108}
    105109
     
    108112    VM& vm = lexicalGlobalObject->vm();
    109113    auto throwScope = DECLARE_THROW_SCOPE(vm);
    110     UNUSED_PARAM(throwScope);
    111114    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
    112115    ASSERT(castedThis);
     
    114117    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    115118    auto object = TestOverloadedConstructors::create(*blob);
    116     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     119    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     120    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue));
     121    RETURN_IF_EXCEPTION(throwScope, { });
     122    return JSValue::encode(jsValue);
    117123}
    118124
     
    121127    VM& vm = lexicalGlobalObject->vm();
    122128    auto throwScope = DECLARE_THROW_SCOPE(vm);
    123     UNUSED_PARAM(throwScope);
    124129    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
    125130    ASSERT(castedThis);
     
    127132    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    128133    auto object = TestOverloadedConstructors::create(WTFMove(string));
    129     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     134    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     135    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue));
     136    RETURN_IF_EXCEPTION(throwScope, { });
     137    return JSValue::encode(jsValue);
    130138}
    131139
     
    134142    VM& vm = lexicalGlobalObject->vm();
    135143    auto throwScope = DECLARE_THROW_SCOPE(vm);
    136     UNUSED_PARAM(throwScope);
    137144    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
    138145    ASSERT(castedThis);
     
    140147    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    141148    auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
    142     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     149    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     150    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, asObject(jsValue));
     151    RETURN_IF_EXCEPTION(throwScope, { });
     152    return JSValue::encode(jsValue);
    143153}
    144154
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp

    r255126 r256716  
    8181    VM& vm = lexicalGlobalObject->vm();
    8282    auto throwScope = DECLARE_THROW_SCOPE(vm);
    83     UNUSED_PARAM(throwScope);
    8483    auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(callFrame->jsCallee());
    8584    ASSERT(castedThis);
     
    8786    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    8887    auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
    89     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     88    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     89    setSubclassStructureIfNeeded<TestOverloadedConstructorsWithSequence>(lexicalGlobalObject, callFrame, asObject(jsValue));
     90    RETURN_IF_EXCEPTION(throwScope, { });
     91    return JSValue::encode(jsValue);
    9092}
    9193
     
    9496    VM& vm = lexicalGlobalObject->vm();
    9597    auto throwScope = DECLARE_THROW_SCOPE(vm);
    96     UNUSED_PARAM(throwScope);
    9798    auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(callFrame->jsCallee());
    9899    ASSERT(castedThis);
     
    100101    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    101102    auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(string));
    102     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     103    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     104    setSubclassStructureIfNeeded<TestOverloadedConstructorsWithSequence>(lexicalGlobalObject, callFrame, asObject(jsValue));
     105    RETURN_IF_EXCEPTION(throwScope, { });
     106    return JSValue::encode(jsValue);
    103107}
    104108
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp

    r255126 r256716  
    161161    VM& vm = lexicalGlobalObject->vm();
    162162    auto throwScope = DECLARE_THROW_SCOPE(vm);
    163     UNUSED_PARAM(throwScope);
    164163    auto* castedThis = jsCast<JSTestPromiseRejectionEventConstructor*>(callFrame->jsCallee());
    165164    ASSERT(castedThis);
     
    171170    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    172171    auto object = TestPromiseRejectionEvent::create(*castedThis->globalObject(), WTFMove(type), WTFMove(eventInitDict));
    173     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     172    auto jsValue = toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     173    setSubclassStructureIfNeeded<TestPromiseRejectionEvent>(lexicalGlobalObject, callFrame, asObject(jsValue));
     174    RETURN_IF_EXCEPTION(throwScope, { });
     175    return JSValue::encode(jsValue);
    174176}
    175177
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

    r255126 r256716  
    149149    VM& vm = lexicalGlobalObject->vm();
    150150    auto throwScope = DECLARE_THROW_SCOPE(vm);
    151     UNUSED_PARAM(throwScope);
    152151    auto* castedThis = jsCast<JSTestTypedefsConstructor*>(callFrame->jsCallee());
    153152    ASSERT(castedThis);
     
    161160    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    162161    auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull());
    163     return JSValue::encode(toJSNewlyCreated<IDLInterface<TestTypedefs>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
     162    auto jsValue = toJSNewlyCreated<IDLInterface<TestTypedefs>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
     163    setSubclassStructureIfNeeded<TestTypedefs>(lexicalGlobalObject, callFrame, asObject(jsValue));
     164    RETURN_IF_EXCEPTION(throwScope, { });
     165    return JSValue::encode(jsValue);
    164166}
    165167
  • trunk/Source/WebCore/dom/EventTarget.cpp

    r255499 r256716  
    3535#include "DOMWrapperWorld.h"
    3636#include "EventNames.h"
     37#include "EventTargetConcrete.h"
    3738#include "HTMLBodyElement.h"
    3839#include "HTMLHtmlElement.h"
     
    5960WTF_MAKE_ISO_ALLOCATED_IMPL(EventTargetWithInlineData);
    6061
     62Ref<EventTarget> EventTarget::create(ScriptExecutionContext& context)
     63{
     64    return EventTargetConcrete::create(context);
     65}
     66
    6167bool EventTarget::isNode() const
    6268{
  • trunk/Source/WebCore/dom/EventTarget.h

    r247860 r256716  
    5555    WTF_MAKE_ISO_ALLOCATED(EventTarget);
    5656public:
     57    static Ref<EventTarget> create(ScriptExecutionContext&);
     58
    5759    void ref() { refEventTarget(); }
    5860    void deref() { derefEventTarget(); }
  • trunk/Source/WebCore/dom/EventTarget.idl

    r246490 r256716  
    2020
    2121[
     22    Constructor,
     23    ConstructorCallWith=ScriptExecutionContext,
    2224    CustomToJSObject,
    2325    Exposed=(Window,Worker),
  • trunk/Source/WebCore/dom/make_event_factory.pl

    r251425 r256716  
    105105        print F "{\n";
    106106        print F "    switch (impl.${interfaceMethodName}()) {\n";
     107        print F "    case EventTargetInterfaceType:\n";
     108        print F "        break;\n";
    107109    }
    108110
     
    140142        print F "    return createWrapper<$namespace>(globalObject, WTFMove(impl));\n";
    141143    } else {
    142         print F "    ASSERT_NOT_REACHED();\n";
    143         print F "    return JSC::jsNull();\n";
     144        print F "    return wrap(state, globalObject, impl);\n";
    144145    }
    145146    print F "}\n";
Note: See TracChangeset for help on using the changeset viewer.