[Streams API] Add support for JS builtins constructor
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Sep 2015 09:18:15 +0000 (09:18 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Sep 2015 09:18:15 +0000 (09:18 +0000)
commit2bc9f0bee417a89b68becf8fa39ce61a0937b7a9
treecae748678546f05a4cf59210a76839455434903c
parent9490e92d083e1defab710cb68addc6b46c8af57d
[Streams API] Add support for JS builtins constructor
https://bugs.webkit.org/show_bug.cgi?id=149497

Reviewed by Darin Adler.

Source/JavaScriptCore:

* runtime/JSFunction.h: exporting createBuiltinFunction.

Source/WebCore:

Covered by existing tests.

Making CountQueuingStrategy fully JS built-in implemented.
Adding support for calling a JS builtin initialization function just after creating the JSXX object.
This JS function must be named initializeXX and be in XX.Js file.
The JSBuiltinConstructor keyword is added to the binding generator.

* CMakeLists.txt: Adding CountQueuingStrategy.js, removing JSCountQueuingStrategyCustom.cpp.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* Modules/streams/CountQueuingStrategy.h: Making CountQueuingStrategy a dummy class.
(WebCore::CountQueuingStrategy::create):
(WebCore::CountQueuingStrategy::~CountQueuingStrategy):
(WebCore::CountQueuingStrategy::CountQueuingStrategy):
* Modules/streams/CountQueuingStrategy.idl:
* Modules/streams/CountQueuingStrategy.js: Added.
(size):
(initializeCountQueuingStrategy):
* WebCore.vcxproj/WebCore.vcxproj: Removing JSCountQueuingStrategyCustom.cpp.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSBindingsAllInOne.cpp: Ditto.
* bindings/js/JSCountQueuingStrategyCustom.cpp: Removed.
* bindings/js/JSDOMBinding.cpp: Adding support for DOMConstructorJSBuiltinObject.
(WebCore::callInitializeFunction):
(WebCore::DOMConstructorJSBuiltinObject::visitChildren):
* bindings/js/JSDOMBinding.h: Diitto.
(WebCore::createFromJSBuiltin):
(WebCore::DOMConstructorJSBuiltinObject::DOMConstructorJSBuiltinObject):
* bindings/js/WebCoreJSClientData.h: Adding support for CQS builtins functions.
(WebCore::WebCoreJSClientData::WebCoreJSClientData):
(WebCore::WebCoreJSClientData::countQueuingStrategyBuiltins):
* bindings/scripts/CodeGeneratorJS.pm:
(GetJSBuiltinFunctionName):
(GetFunctionName):
(InstanceNeedsVisitChildren): Generating visitChildren method in case of JSBuiltinConstructor.
(GetParentConstructorClassName): Refactoring to make JSXXConstructor derive from DOMConstructorJSBuiltinObject in case of JSBuiltinConstructor.
(GenerateConstructorDeclaration): Ditto.
(GenerateConstructorDefinition): Generate specific constructor in case of JSBuiltinConstructor.
(GenerateConstructorHelperMethods): Refactoring to use Base class.
(IsConstructable): Ditto.
(ConstructorHasProperties): Deleted.
* bindings/scripts/IDLAttributes.txt: Adding JSBuiltinConstructor.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectConstructor::JSTestActiveDOMObjectConstructor):
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallbackConstructor::JSTestCallbackConstructor):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetterConstructor::JSTestCustomNamedGetterConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::JSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetConstructor::JSTestEventTargetConstructor):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionConstructor::JSTestExceptionConstructor):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableConstructor::JSTestGenerateIsReachableConstructor):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::JSTestInterfaceConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::JSTestMediaQueryListListenerConstructor):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorConstructor::JSTestNamedConstructorConstructor):
(WebCore::JSTestNamedConstructorNamedConstructor::JSTestNamedConstructorNamedConstructor):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::JSTestNodeConstructor):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministicConstructor::JSTestNondeterministicConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::JSTestObjConstructor):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::JSTestOverloadedConstructorsConstructor):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsConstructor::JSTestOverrideBuiltinsConstructor):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::JSTestTypedefsConstructor):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattributeConstructor::JSattributeConstructor):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::JSreadonlyConstructor::JSreadonlyConstructor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSFunction.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/streams/CountQueuingStrategy.h
Source/WebCore/Modules/streams/CountQueuingStrategy.idl
Source/WebCore/Modules/streams/CountQueuingStrategy.js [new file with mode: 0644]
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSCountQueuingStrategyCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/WebCoreJSClientData.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp