Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (211891 => 211892)
--- trunk/Source/WebCore/CMakeLists.txt 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/CMakeLists.txt 2017-02-08 20:24:37 UTC (rev 211892)
@@ -1107,7 +1107,9 @@
bindings/js/JSCustomXPathNSResolver.cpp
bindings/js/JSDOMBinding.cpp
bindings/js/JSDOMBindingSecurity.cpp
- bindings/js/JSDOMConstructor.cpp
+ bindings/js/JSDOMBuiltinConstructorBase.cpp
+ bindings/js/JSDOMConstructorBase.cpp
+ bindings/js/JSDOMConstructorWithDocument.cpp
bindings/js/JSDOMExceptionHandling.cpp
bindings/js/JSDOMGlobalObject.cpp
bindings/js/JSDOMGlobalObjectTask.cpp
Modified: trunk/Source/WebCore/ChangeLog (211891 => 211892)
--- trunk/Source/WebCore/ChangeLog 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/ChangeLog 2017-02-08 20:24:37 UTC (rev 211892)
@@ -1,3 +1,61 @@
+2017-02-08 Sam Weinig <[email protected]>
+
+ Split JSDOMConstructor.h/cpp up by class
+ https://bugs.webkit.org/show_bug.cgi?id=167958
+
+ Reviewed by Tim Horton.
+
+ Splits JSDOMConstructor up by class.
+ - Renames DOMConstructorObject to JSDOMConstructorBase.
+ - Renames DOMConstructorWithDocument to JSDOMConstructorWithDocument.
+ - Renames DOMConstructorJSBuiltinObject to JSDOMBuiltinConstructorBase.
+ - Renames JSBuiltinConstructor to JSDOMBuiltinConstructor.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSBindingsAllInOne.cpp:
+ Add new files.
+
+ * bindings/js/JSDOMBinding.h:
+ (WebCore::propertyNameToString): Deleted.
+ (WebCore::propertyNameToAtomicString): Deleted.
+ * bindings/js/JSDOMBuiltinConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
+ * bindings/js/JSDOMBuiltinConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
+ * bindings/js/JSDOMBuiltinConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
+ * bindings/js/JSDOMConstructor.cpp: Removed.
+ * bindings/js/JSDOMConstructor.h: Remove all classes other than JSDOMConstructor.
+ * bindings/js/JSDOMConstructorBase.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
+ * bindings/js/JSDOMConstructorBase.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
+ * bindings/js/JSDOMConstructorNotConstructable.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
+ * bindings/js/JSDOMConstructorWithDocument.cpp: Copied from Source/WebCore/bindings/js/JSDOMConstructor.cpp.
+ * bindings/js/JSDOMConstructorWithDocument.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
+ * bindings/js/JSDOMNamedConstructor.h: Copied from Source/WebCore/bindings/js/JSDOMConstructor.h.
+
+ * bindings/js/JSDOMConvertStrings.h:
+ (WebCore::propertyNameToString):
+ (WebCore::propertyNameToAtomicString):
+ Move these here from JSDOMBinding.
+
+ * bindings/js/JSHTMLElementCustom.cpp:
+ (WebCore::constructJSHTMLElement):
+ * bindings/js/JSMutationObserverCustom.cpp:
+ (WebCore::constructJSMutationObserver):
+ * bindings/js/JSReadableStreamPrivateConstructors.cpp:
+ * bindings/js/JSStorageCustom.cpp:
+ * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp:
+ (WebCore::JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate):
+ * bindings/js/JSWorkerCustom.cpp:
+ (WebCore::constructJSWorker):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GetConstructorTemplateClassName):
+ (GenerateConstructorDeclaration):
+ Update includes/names.
+
+ * dom/StaticRange.cpp:
+ (WebCore::StaticRange::~StaticRange):
+ * dom/StaticRange.h:
+ Add out-of-line destructor, so Node.h does not have to be included.
+
2017-02-08 Joseph Pecoraro <[email protected]>
Initialize the main RunLoop in iOS WebKitLegacy
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (211891 => 211892)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2017-02-08 20:24:37 UTC (rev 211892)
@@ -2856,7 +2856,6 @@
7C3F01C21C8E5AC200ADD962 /* UserContentProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3F01BF1C8E5AB100ADD962 /* UserContentProvider.cpp */; };
7C45C9CF1E3EFDF700AAB558 /* JSDOMBindingSecurity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C45C9CA1E3E8D2E00AAB558 /* JSDOMBindingSecurity.cpp */; };
7C45C9D01E3EFDFB00AAB558 /* JSDOMWrapperCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C45C9CB1E3E8E4900AAB558 /* JSDOMWrapperCache.cpp */; };
- 7C45C9D11E3EFE0500AAB558 /* JSDOMConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C45C9CD1E3E900B00AAB558 /* JSDOMConstructor.cpp */; };
7C45C9D21E3EFE0800AAB558 /* JSDOMExceptionHandling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C45C9CC1E3E8F0800AAB558 /* JSDOMExceptionHandling.cpp */; };
7C45C9D31E3FCBD700AAB558 /* JSDOMWrapperCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C45C9C81E3E8B5100AAB558 /* JSDOMWrapperCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
7C45C9D41E3FCBDF00AAB558 /* JSDOMBindingSecurity.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C45C9C91E3E8CD700AAB558 /* JSDOMBindingSecurity.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2954,6 +2953,9 @@
7C93F34E1AA6BF0700A98BAB /* ContentExtensionCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C93F34C1AA6BF0700A98BAB /* ContentExtensionCompiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
7C9DBFED1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C9DBFEB1A9C49B1000D6B25 /* JSHTMLAttachmentElement.cpp */; };
7C9DBFEE1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C9DBFEC1A9C49B1000D6B25 /* JSHTMLAttachmentElement.h */; };
+ 7CC01D0A1E4A7B0400E529CC /* JSDOMBuiltinConstructorBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C0CEF2E1E4A5832008DEB80 /* JSDOMBuiltinConstructorBase.cpp */; };
+ 7CC01D0B1E4A7B0400E529CC /* JSDOMConstructorBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C0CEF2F1E4A58AD008DEB80 /* JSDOMConstructorBase.cpp */; };
+ 7CC01D0C1E4A7B0400E529CC /* JSDOMConstructorWithDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C0CEF301E4A58F1008DEB80 /* JSDOMConstructorWithDocument.cpp */; };
7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = CDEE393817974274001D7580 /* URLRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
7CC564B818BABEA6001B9652 /* TelephoneNumberDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CC564B618BABEA6001B9652 /* TelephoneNumberDetector.h */; };
7CC564BA18BAC720001B9652 /* TelephoneNumberDetectorCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CC564B918BAC720001B9652 /* TelephoneNumberDetectorCocoa.cpp */; };
@@ -10435,6 +10437,15 @@
7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegionList.cpp; sourceTree = "<group>"; };
7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegionList.h; sourceTree = "<group>"; };
7C0406121C66EE9C00AF0711 /* NSScrollerImpSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSScrollerImpSPI.h; sourceTree = "<group>"; };
+ 7C0CEF281E4A542C008DEB80 /* JSDOMConstructorBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMConstructorBase.h; sourceTree = "<group>"; };
+ 7C0CEF291E4A54D3008DEB80 /* JSDOMConstructorWithDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMConstructorWithDocument.h; sourceTree = "<group>"; };
+ 7C0CEF2A1E4A556C008DEB80 /* JSDOMBuiltinConstructorBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMBuiltinConstructorBase.h; sourceTree = "<group>"; };
+ 7C0CEF2B1E4A55C3008DEB80 /* JSDOMConstructorNotConstructable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMConstructorNotConstructable.h; sourceTree = "<group>"; };
+ 7C0CEF2C1E4A564D008DEB80 /* JSDOMNamedConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMNamedConstructor.h; sourceTree = "<group>"; };
+ 7C0CEF2D1E4A56C5008DEB80 /* JSDOMBuiltinConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMBuiltinConstructor.h; sourceTree = "<group>"; };
+ 7C0CEF2E1E4A5832008DEB80 /* JSDOMBuiltinConstructorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMBuiltinConstructorBase.cpp; sourceTree = "<group>"; };
+ 7C0CEF2F1E4A58AD008DEB80 /* JSDOMConstructorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMConstructorBase.cpp; sourceTree = "<group>"; };
+ 7C0CEF301E4A58F1008DEB80 /* JSDOMConstructorWithDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMConstructorWithDocument.cpp; sourceTree = "<group>"; };
7C1843FB1C8B7283002EB973 /* Autofill.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autofill.cpp; sourceTree = "<group>"; };
7C1843FC1C8B7283002EB973 /* Autofill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Autofill.h; sourceTree = "<group>"; };
7C1E97251A9F9834007BF0FB /* AutoFillButtonElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AutoFillButtonElement.cpp; sourceTree = "<group>"; };
@@ -10479,7 +10490,6 @@
7C45C9CA1E3E8D2E00AAB558 /* JSDOMBindingSecurity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMBindingSecurity.cpp; sourceTree = "<group>"; };
7C45C9CB1E3E8E4900AAB558 /* JSDOMWrapperCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWrapperCache.cpp; sourceTree = "<group>"; };
7C45C9CC1E3E8F0800AAB558 /* JSDOMExceptionHandling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMExceptionHandling.cpp; sourceTree = "<group>"; };
- 7C45C9CD1E3E900B00AAB558 /* JSDOMConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMConstructor.cpp; sourceTree = "<group>"; };
7C48A6CE191C9D6500026674 /* WebKitNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitNamespace.cpp; sourceTree = "<group>"; };
7C48A6CF191C9D6500026674 /* WebKitNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitNamespace.h; sourceTree = "<group>"; };
7C48A6D2191C9D8E00026674 /* WebKitNamespace.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebKitNamespace.idl; sourceTree = "<group>"; };
@@ -22407,8 +22417,6 @@
7C45C9C61E3E8ABA00AAB558 /* JSDOMBindingCaller.h */,
7C45C9CA1E3E8D2E00AAB558 /* JSDOMBindingSecurity.cpp */,
7C45C9C91E3E8CD700AAB558 /* JSDOMBindingSecurity.h */,
- 7C45C9CD1E3E900B00AAB558 /* JSDOMConstructor.cpp */,
- 413C2C331BC29A7B0075204C /* JSDOMConstructor.h */,
7C45C9CC1E3E8F0800AAB558 /* JSDOMExceptionHandling.cpp */,
7C45C9C71E3E8AFF00AAB558 /* JSDOMExceptionHandling.h */,
E1C36CBC0EB08062007410BC /* JSDOMGlobalObject.cpp */,
@@ -22855,6 +22863,16 @@
isa = PBXGroup;
children = (
CE261694187E6469007955F3 /* ios */,
+ 7C0CEF2D1E4A56C5008DEB80 /* JSDOMBuiltinConstructor.h */,
+ 7C0CEF2E1E4A5832008DEB80 /* JSDOMBuiltinConstructorBase.cpp */,
+ 7C0CEF2A1E4A556C008DEB80 /* JSDOMBuiltinConstructorBase.h */,
+ 413C2C331BC29A7B0075204C /* JSDOMConstructor.h */,
+ 7C0CEF2F1E4A58AD008DEB80 /* JSDOMConstructorBase.cpp */,
+ 7C0CEF281E4A542C008DEB80 /* JSDOMConstructorBase.h */,
+ 7C0CEF2B1E4A55C3008DEB80 /* JSDOMConstructorNotConstructable.h */,
+ 7C0CEF301E4A58F1008DEB80 /* JSDOMConstructorWithDocument.cpp */,
+ 7C0CEF291E4A54D3008DEB80 /* JSDOMConstructorWithDocument.h */,
+ 7C0CEF2C1E4A564D008DEB80 /* JSDOMNamedConstructor.h */,
);
name = Constructors;
sourceTree = "<group>";
@@ -29513,6 +29531,7 @@
975CA28A130365F800E99AD9 /* Crypto.cpp in Sources */,
E172AF6D180F24C600FBADB9 /* CryptoAlgorithm.cpp in Sources */,
E125F8411824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp in Sources */,
+ 7CC01D0C1E4A7B0400E529CC /* JSDOMConstructorWithDocument.cpp in Sources */,
E125F845182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp in Sources */,
E1FE137A184D21BB00892F13 /* CryptoAlgorithmAES_KW.cpp in Sources */,
E1FE137E184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp in Sources */,
@@ -29556,6 +29575,7 @@
9444CBE31D8861980073A074 /* CSSCustomIdentValue.cpp in Sources */,
94D4AC621DC24C8E0080F02D /* CSSCustomPropertyValue.cpp in Sources */,
4A9CC81716BB9AC600EC645A /* CSSDefaultStyleSheets.cpp in Sources */,
+ 7CC01D0A1E4A7B0400E529CC /* JSDOMBuiltinConstructorBase.cpp in Sources */,
94476BDA1DFCAC0300690E23 /* CSSDeferredParser.cpp in Sources */,
FBB0C5B717BBD626003D3677 /* CSSFilterImageValue.cpp in Sources */,
BC64B4D50CB4298A005F2B62 /* CSSFontFace.cpp in Sources */,
@@ -30372,7 +30392,6 @@
1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */,
93B70D6309EB0C7C009D8468 /* JSDOMBinding.cpp in Sources */,
7C45C9CF1E3EFDF700AAB558 /* JSDOMBindingSecurity.cpp in Sources */,
- 7C45C9D11E3EFE0500AAB558 /* JSDOMConstructor.cpp in Sources */,
BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */,
FD67773B195CB1E60072E0D3 /* JSDOMCSSNamespace.cpp in Sources */,
40ECAE8116B8B68A00C36103 /* JSDOMError.cpp in Sources */,
@@ -31583,6 +31602,7 @@
FD3160AA12B026F700C1A359 /* ReverbConvolverStage.cpp in Sources */,
FD3160AC12B026F700C1A359 /* ReverbInputBuffer.cpp in Sources */,
BC74DA381013F3F7007987AD /* RGBColor.cpp in Sources */,
+ 7CC01D0B1E4A7B0400E529CC /* JSDOMConstructorBase.cpp in Sources */,
A8CFF5E70A155A05000A4234 /* RootInlineBox.cpp in Sources */,
49E911C80EF86D47009D0CAF /* RotateTransformOperation.cpp in Sources */,
A73F95FE12C97BFE0031AAF9 /* RoundedRect.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -46,7 +46,9 @@
#include "JSCustomXPathNSResolver.cpp"
#include "JSDOMBinding.cpp"
#include "JSDOMBindingSecurity.cpp"
-#include "JSDOMConstructor.cpp"
+#include "JSDOMBuiltinConstructorBase.cpp"
+#include "JSDOMConstructorBase.cpp"
+#include "JSDOMConstructorWithDocument.cpp"
#include "JSDOMExceptionHandling.cpp"
#include "JSDOMGlobalObject.cpp"
#include "JSDOMGlobalObjectTask.cpp"
Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -57,17 +57,6 @@
WEBCORE_EXPORT bool hasIteratorMethod(JSC::ExecState&, JSC::JSValue);
-inline String propertyNameToString(JSC::PropertyName propertyName)
-{
- ASSERT(!propertyName.isSymbol());
- return propertyName.uid() ? propertyName.uid() : propertyName.publicName();
-}
-
-inline AtomicString propertyNameToAtomicString(JSC::PropertyName propertyName)
-{
- return AtomicString(propertyName.uid() ? propertyName.uid() : propertyName.publicName());
-}
-
template<JSC::NativeFunction nativeFunction, int length> JSC::EncodedJSValue nonCachingStaticFunctionGetter(JSC::ExecState* exec, JSC::EncodedJSValue, JSC::PropertyName propertyName)
{
return JSC::JSValue::encode(JSC::JSFunction::create(exec->vm(), exec->lexicalGlobalObject(), length, propertyName.publicName(), nativeFunction));
Added: trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructor.h (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructor.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructor.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,131 @@
+/*
+ * Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "JSDOMBuiltinConstructorBase.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMWrapperCache.h"
+
+namespace WebCore {
+
+template<typename JSClass> class JSDOMBuiltinConstructor : public JSDOMBuiltinConstructorBase {
+public:
+ using Base = JSDOMBuiltinConstructorBase;
+
+ static JSDOMBuiltinConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
+ static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
+
+ DECLARE_INFO;
+
+ // Usually defined for each specialization class.
+ static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
+
+private:
+ JSDOMBuiltinConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : Base(structure, globalObject)
+ {
+ }
+
+ void finishCreation(JSC::VM&, JSDOMGlobalObject&);
+ static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
+ static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
+
+ JSC::EncodedJSValue callConstructor(JSC::ExecState&, JSC::JSObject&);
+ JSC::EncodedJSValue callConstructor(JSC::ExecState&, JSC::JSObject*);
+
+ // Usually defined for each specialization class.
+ void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
+ // Must be defined for each specialization class.
+ JSC::FunctionExecutable* initializeExecutable(JSC::VM&);
+};
+
+template<typename JSClass> inline JSDOMBuiltinConstructor<JSClass>* JSDOMBuiltinConstructor<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+{
+ JSDOMBuiltinConstructor* constructor = new (NotNull, JSC::allocateCell<JSDOMBuiltinConstructor>(vm.heap)) JSDOMBuiltinConstructor(structure, globalObject);
+ constructor->finishCreation(vm, globalObject);
+ return constructor;
+}
+
+template<typename JSClass> inline JSC::Structure* JSDOMBuiltinConstructor<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
+{
+ return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+}
+
+template<typename JSClass> inline void JSDOMBuiltinConstructor<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(vm, info()));
+ setInitializeFunction(vm, *JSC::JSFunction::createBuiltinFunction(vm, initializeExecutable(vm), &globalObject));
+ initializeProperties(vm, globalObject);
+}
+
+template<typename JSClass> inline JSC::EncodedJSValue JSDOMBuiltinConstructor<JSClass>::callConstructor(JSC::ExecState& state, JSC::JSObject& object)
+{
+ Base::callFunctionWithCurrentArguments(state, object, *initializeFunction());
+ return JSC::JSValue::encode(&object);
+}
+
+template<typename JSClass> inline JSC::EncodedJSValue JSDOMBuiltinConstructor<JSClass>::callConstructor(JSC::ExecState& state, JSC::JSObject* object)
+{
+ JSC::VM& vm = state.vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ if (!object)
+ return throwConstructorScriptExecutionContextUnavailableError(state, scope, info()->className);
+ return callConstructor(state, *object);
+}
+
+template<typename JSClass> inline
+typename std::enable_if<JSDOMObjectInspector<JSClass>::isSimpleWrapper, JSC::JSObject&>::type createJSObject(JSDOMBuiltinConstructor<JSClass>& constructor)
+{
+ auto& globalObject = *constructor.globalObject();
+ return *JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject, JSClass::DOMWrapped::create());
+}
+
+template<typename JSClass> inline
+typename std::enable_if<JSDOMObjectInspector<JSClass>::isBuiltin, JSC::JSObject&>::type createJSObject(JSDOMBuiltinConstructor<JSClass>& constructor)
+{
+ auto& globalObject = *constructor.globalObject();
+ return *JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject);
+}
+
+template<typename JSClass> inline
+typename std::enable_if<JSDOMObjectInspector<JSClass>::isComplexWrapper, JSC::JSObject*>::type createJSObject(JSDOMBuiltinConstructor<JSClass>& constructor)
+{
+ ScriptExecutionContext* context = constructor.scriptExecutionContext();
+ if (!context)
+ return nullptr;
+ auto& globalObject = *constructor.globalObject();
+ return JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject, JSClass::DOMWrapped::create(*context));
+}
+
+template<typename JSClass> inline JSC::EncodedJSValue JSC_HOST_CALL JSDOMBuiltinConstructor<JSClass>::construct(JSC::ExecState* state)
+{
+ ASSERT(state);
+ auto* castedThis = JSC::jsCast<JSDOMBuiltinConstructor*>(state->jsCallee());
+ return castedThis->callConstructor(*state, createJSObject(*castedThis));
+}
+
+template<typename JSClass> inline JSC::ConstructType JSDOMBuiltinConstructor<JSClass>::getConstructData(JSC::JSCell*, JSC::ConstructData& constructData)
+{
+ constructData.native.function = construct;
+ return JSC::ConstructType::Host;
+}
+
+} // namespace WebCore
Copied: trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructorBase.cpp (from rev 211891, trunk/Source/WebCore/bindings/js/JSDOMConstructor.cpp) (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructorBase.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructorBase.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten ([email protected])
+ * Copyright (C) 2004-2011, 2013, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <[email protected]>
+ * Copyright (C) 2013 Michael Pruett <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "JSDOMBuiltinConstructorBase.h"
+
+#include <runtime/JSCInlines.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+void JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments(JSC::ExecState& state, JSC::JSObject& thisObject, JSC::JSFunction& function)
+{
+ JSC::CallData callData;
+ JSC::CallType callType = JSC::getCallData(&function, callData);
+ ASSERT(callType != CallType::None);
+
+ JSC::MarkedArgumentBuffer arguments;
+ for (unsigned i = 0; i < state.argumentCount(); ++i)
+ arguments.append(state.uncheckedArgument(i));
+ JSC::call(&state, &function, callType, callData, &thisObject, arguments);
+}
+
+void JSDOMBuiltinConstructorBase::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& visitor)
+{
+ auto* thisObject = jsCast<JSDOMBuiltinConstructorBase*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ Base::visitChildren(thisObject, visitor);
+ visitor.append(thisObject->m_initializeFunction);
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructorBase.h (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructorBase.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMBuiltinConstructorBase.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "JSDOMConstructorBase.h"
+
+namespace WebCore {
+
+class JSDOMBuiltinConstructorBase : public JSDOMConstructorBase {
+public:
+ using Base = JSDOMConstructorBase;
+
+protected:
+ JSDOMBuiltinConstructorBase(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : JSDOMConstructorBase(structure, globalObject)
+ {
+ }
+
+ static void visitChildren(JSC::JSCell*, JSC::SlotVisitor&);
+
+ JSC::JSFunction* initializeFunction();
+ void setInitializeFunction(JSC::VM&, JSC::JSFunction&);
+
+ static void callFunctionWithCurrentArguments(JSC::ExecState&, JSC::JSObject& thisObject, JSC::JSFunction&);
+
+private:
+ JSC::WriteBarrier<JSC::JSFunction> m_initializeFunction;
+};
+
+inline JSC::JSFunction* JSDOMBuiltinConstructorBase::initializeFunction()
+{
+ return m_initializeFunction.get();
+}
+
+inline void JSDOMBuiltinConstructorBase::setInitializeFunction(JSC::VM& vm, JSC::JSFunction& function)
+{
+ m_initializeFunction.set(vm, this, &function);
+}
+
+
+} // namespace WebCore
Deleted: trunk/Source/WebCore/bindings/js/JSDOMConstructor.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructor.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructor.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 1999-2001 Harri Porten ([email protected])
- * Copyright (C) 2004-2011, 2013, 2016 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Samuel Weinig <[email protected]>
- * Copyright (C) 2013 Michael Pruett <[email protected]>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "config.h"
-#include "JSDOMConstructor.h"
-
-#include <runtime/JSCInlines.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DOMConstructorObject);
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DOMConstructorWithDocument);
-
-void callFunctionWithCurrentArguments(JSC::ExecState& state, JSC::JSObject& thisObject, JSC::JSFunction& function)
-{
- JSC::CallData callData;
- JSC::CallType callType = JSC::getCallData(&function, callData);
- ASSERT(callType != CallType::None);
-
- JSC::MarkedArgumentBuffer arguments;
- for (unsigned i = 0; i < state.argumentCount(); ++i)
- arguments.append(state.uncheckedArgument(i));
- JSC::call(&state, &function, callType, callData, &thisObject, arguments);
-}
-
-void DOMConstructorJSBuiltinObject::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& visitor)
-{
- auto* thisObject = jsCast<DOMConstructorJSBuiltinObject*>(cell);
- ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- Base::visitChildren(thisObject, visitor);
- visitor.append(thisObject->m_initializeFunction);
-}
-
-static EncodedJSValue JSC_HOST_CALL callThrowTypeError(ExecState* exec)
-{
- VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
- throwTypeError(exec, scope, ASCIILiteral("Constructor requires 'new' operator"));
- return JSValue::encode(jsNull());
-}
-
-CallType DOMConstructorObject::getCallData(JSCell*, CallData& callData)
-{
- callData.native.function = callThrowTypeError;
- return CallType::Host;
-}
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSDOMConstructor.h (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructor.h 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructor.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -19,69 +19,15 @@
#pragma once
-#include "Document.h"
-#include "JSDOMExceptionHandling.h"
-#include "JSDOMWrapperCache.h"
+#include "JSDOMConstructorBase.h"
namespace WebCore {
-// Base class for all constructor objects in the JSC bindings.
-class DOMConstructorObject : public JSDOMObject {
+template<typename JSClass> class JSDOMConstructor : public JSDOMConstructorBase {
public:
- typedef JSDOMObject Base;
- static const unsigned StructureFlags = Base::StructureFlags | JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance | JSC::TypeOfShouldCallGetCallData;
- static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject*, JSC::JSValue);
+ using Base = JSDOMConstructorBase;
-protected:
- DOMConstructorObject(JSC::Structure*, JSDOMGlobalObject&);
-
- static String className(const JSObject*);
- static JSC::CallType getCallData(JSCell*, JSC::CallData&);
-};
-
-// Constructors using this base class depend on being in a Document and
-// can never be used from a WorkerGlobalScope.
-class DOMConstructorWithDocument : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
-public:
- Document* document() const
- {
- return downcast<Document>(scriptExecutionContext());
- }
-
-protected:
- DOMConstructorWithDocument(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
- : DOMConstructorObject(structure, globalObject)
- {
- }
-
- void finishCreation(JSDOMGlobalObject& globalObject)
- {
- Base::finishCreation(globalObject.vm());
- ASSERT(globalObject.scriptExecutionContext()->isDocument());
- }
-};
-
-class DOMConstructorJSBuiltinObject : public DOMConstructorObject {
-public:
- typedef DOMConstructorObject Base;
-
-protected:
- DOMConstructorJSBuiltinObject(JSC::Structure*, JSDOMGlobalObject&);
- static void visitChildren(JSC::JSCell*, JSC::SlotVisitor&);
-
- JSC::JSFunction* initializeFunction();
- void setInitializeFunction(JSC::VM&, JSC::JSFunction&);
-
-private:
- JSC::WriteBarrier<JSC::JSFunction> m_initializeFunction;
-};
-
-template<typename JSClass> class JSDOMConstructorNotConstructable : public DOMConstructorObject {
-public:
- typedef DOMConstructorObject Base;
-
- static JSDOMConstructorNotConstructable* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
+ static JSDOMConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
DECLARE_INFO;
@@ -90,41 +36,11 @@
static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
private:
- JSDOMConstructorNotConstructable(JSC::Structure* structure, JSDOMGlobalObject& globalObject) : Base(structure, globalObject) { }
- void finishCreation(JSC::VM&, JSDOMGlobalObject&);
-
- // Usually defined for each specialization class.
- void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
-
- static JSC::EncodedJSValue JSC_HOST_CALL callThrowTypeError(JSC::ExecState* exec)
+ JSDOMConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : Base(structure, globalObject)
{
- JSC::VM& vm = exec->vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
- JSC::throwTypeError(exec, scope, ASCIILiteral("Illegal constructor"));
- return JSC::JSValue::encode(JSC::jsNull());
}
- static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData& callData)
- {
- callData.native.function = callThrowTypeError;
- return JSC::CallType::Host;
- }
-};
-
-template<typename JSClass> class JSDOMConstructor : public DOMConstructorObject {
-public:
- typedef DOMConstructorObject Base;
-
- static JSDOMConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
- static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
-
- DECLARE_INFO;
-
- // Must be defined for each specialization class.
- static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
-
-private:
- JSDOMConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject) : Base(structure, globalObject) { }
void finishCreation(JSC::VM&, JSDOMGlobalObject&);
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
@@ -134,106 +50,6 @@
static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
};
-template<typename JSClass> class JSDOMNamedConstructor : public DOMConstructorWithDocument {
-public:
- typedef DOMConstructorWithDocument Base;
-
- static JSDOMNamedConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
- static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
-
- DECLARE_INFO;
-
- // Must be defined for each specialization class.
- static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
-
-private:
- JSDOMNamedConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject) : Base(structure, globalObject) { }
- void finishCreation(JSC::VM&, JSDOMGlobalObject&);
- static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
-
- // Usually defined for each specialization class.
- void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
- // Must be defined for each specialization class.
- static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
-};
-
-template<typename JSClass> class JSBuiltinConstructor : public DOMConstructorJSBuiltinObject {
-public:
- using Base = DOMConstructorJSBuiltinObject;
-
- static JSBuiltinConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
- static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
-
- DECLARE_INFO;
-
- // Usually defined for each specialization class.
- static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
-
-private:
- JSBuiltinConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject) : Base(structure, globalObject) { }
- void finishCreation(JSC::VM&, JSDOMGlobalObject&);
- static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
- static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
-
- JSC::EncodedJSValue callConstructor(JSC::ExecState&, JSC::JSObject&);
- JSC::EncodedJSValue callConstructor(JSC::ExecState&, JSC::JSObject*);
-
- // Usually defined for each specialization class.
- void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
- // Must be defined for each specialization class.
- JSC::FunctionExecutable* initializeExecutable(JSC::VM&);
-};
-
-inline JSC::Structure* DOMConstructorObject::createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
-{
- return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-}
-
-inline DOMConstructorObject::DOMConstructorObject(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
- : JSDOMObject(structure, globalObject)
-{
-}
-
-inline String DOMConstructorObject::className(const JSObject*)
-{
- return ASCIILiteral("Function");
-}
-
-inline DOMConstructorJSBuiltinObject::DOMConstructorJSBuiltinObject(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
- : DOMConstructorObject(structure, globalObject)
-{
-}
-
-inline JSC::JSFunction* DOMConstructorJSBuiltinObject::initializeFunction()
-{
- return m_initializeFunction.get();
-}
-
-inline void DOMConstructorJSBuiltinObject::setInitializeFunction(JSC::VM& vm, JSC::JSFunction& function)
-{
- m_initializeFunction.set(vm, this, &function);
-}
-
-
-template<typename JSClass> inline JSDOMConstructorNotConstructable<JSClass>* JSDOMConstructorNotConstructable<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
-{
- JSDOMConstructorNotConstructable* constructor = new (NotNull, JSC::allocateCell<JSDOMConstructorNotConstructable>(vm.heap)) JSDOMConstructorNotConstructable(structure, globalObject);
- constructor->finishCreation(vm, globalObject);
- return constructor;
-}
-
-template<typename JSClass> inline JSC::Structure* JSDOMConstructorNotConstructable<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
-{
- return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-}
-
-template<typename JSClass> inline void JSDOMConstructorNotConstructable<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
-{
- Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
- initializeProperties(vm, globalObject);
-}
-
template<typename JSClass> inline JSDOMConstructor<JSClass>* JSDOMConstructor<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
{
JSDOMConstructor* constructor = new (NotNull, JSC::allocateCell<JSDOMConstructor>(vm.heap)) JSDOMConstructor(structure, globalObject);
@@ -259,103 +75,5 @@
return JSC::ConstructType::Host;
}
-template<typename JSClass> inline JSDOMNamedConstructor<JSClass>* JSDOMNamedConstructor<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
-{
- JSDOMNamedConstructor* constructor = new (NotNull, JSC::allocateCell<JSDOMNamedConstructor>(vm.heap)) JSDOMNamedConstructor(structure, globalObject);
- constructor->finishCreation(vm, globalObject);
- return constructor;
-}
-template<typename JSClass> inline JSC::Structure* JSDOMNamedConstructor<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
-{
- return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-}
-
-template<typename JSClass> inline void JSDOMNamedConstructor<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
-{
- Base::finishCreation(globalObject);
- ASSERT(inherits(vm, info()));
- initializeProperties(vm, globalObject);
-}
-
-template<typename JSClass> inline JSC::ConstructType JSDOMNamedConstructor<JSClass>::getConstructData(JSC::JSCell*, JSC::ConstructData& constructData)
-{
- constructData.native.function = construct;
- return JSC::ConstructType::Host;
-}
-
-template<typename JSClass> inline JSBuiltinConstructor<JSClass>* JSBuiltinConstructor<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
-{
- JSBuiltinConstructor* constructor = new (NotNull, JSC::allocateCell<JSBuiltinConstructor>(vm.heap)) JSBuiltinConstructor(structure, globalObject);
- constructor->finishCreation(vm, globalObject);
- return constructor;
-}
-
-template<typename JSClass> inline JSC::Structure* JSBuiltinConstructor<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
-{
- return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
-}
-
-template<typename JSClass> inline void JSBuiltinConstructor<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
-{
- Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
- setInitializeFunction(vm, *JSC::JSFunction::createBuiltinFunction(vm, initializeExecutable(vm), &globalObject));
- initializeProperties(vm, globalObject);
-}
-
-void callFunctionWithCurrentArguments(JSC::ExecState&, JSC::JSObject& thisObject, JSC::JSFunction&);
-
-template<typename JSClass> inline JSC::EncodedJSValue JSBuiltinConstructor<JSClass>::callConstructor(JSC::ExecState& state, JSC::JSObject& object)
-{
- callFunctionWithCurrentArguments(state, object, *initializeFunction());
- return JSC::JSValue::encode(&object);
-}
-
-template<typename JSClass> inline JSC::EncodedJSValue JSBuiltinConstructor<JSClass>::callConstructor(JSC::ExecState& state, JSC::JSObject* object)
-{
- JSC::VM& vm = state.vm();
- auto scope = DECLARE_THROW_SCOPE(vm);
- if (!object)
- return throwConstructorScriptExecutionContextUnavailableError(state, scope, info()->className);
- return callConstructor(state, *object);
-}
-
-template<typename JSClass> inline
-typename std::enable_if<JSDOMObjectInspector<JSClass>::isSimpleWrapper, JSC::JSObject&>::type createJSObject(JSBuiltinConstructor<JSClass>& constructor)
-{
- auto& globalObject = *constructor.globalObject();
- return *JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject, JSClass::DOMWrapped::create());
-}
-
-template<typename JSClass> inline
-typename std::enable_if<JSDOMObjectInspector<JSClass>::isBuiltin, JSC::JSObject&>::type createJSObject(JSBuiltinConstructor<JSClass>& constructor)
-{
- auto& globalObject = *constructor.globalObject();
- return *JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject);
-}
-
-template<typename JSClass> inline
-typename std::enable_if<JSDOMObjectInspector<JSClass>::isComplexWrapper, JSC::JSObject*>::type createJSObject(JSBuiltinConstructor<JSClass>& constructor)
-{
- ScriptExecutionContext* context = constructor.scriptExecutionContext();
- if (!context)
- return nullptr;
- auto& globalObject = *constructor.globalObject();
- return JSClass::create(getDOMStructure<JSClass>(globalObject.vm(), globalObject), &globalObject, JSClass::DOMWrapped::create(*context));
-}
-
-template<typename JSClass> inline JSC::EncodedJSValue JSC_HOST_CALL JSBuiltinConstructor<JSClass>::construct(JSC::ExecState* state)
-{
- ASSERT(state);
- auto* castedThis = JSC::jsCast<JSBuiltinConstructor*>(state->jsCallee());
- return castedThis->callConstructor(*state, createJSObject(*castedThis));
-}
-
-template<typename JSClass> inline JSC::ConstructType JSBuiltinConstructor<JSClass>::getConstructData(JSC::JSCell*, JSC::ConstructData& constructData)
-{
- constructData.native.function = construct;
- return JSC::ConstructType::Host;
-}
-
} // namespace WebCore
Copied: trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.cpp (from rev 211891, trunk/Source/WebCore/bindings/js/JSDOMConstructor.cpp) (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten ([email protected])
+ * Copyright (C) 2004-2011, 2013, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <[email protected]>
+ * Copyright (C) 2013 Michael Pruett <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "JSDOMConstructor.h"
+
+#include <runtime/JSCInlines.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSDOMConstructorBase);
+
+static EncodedJSValue JSC_HOST_CALL callThrowTypeError(ExecState* exec)
+{
+ VM& vm = exec->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ throwTypeError(exec, scope, ASCIILiteral("Constructor requires 'new' operator"));
+ return JSValue::encode(jsNull());
+}
+
+CallType JSDOMConstructorBase::getCallData(JSCell*, CallData& callData)
+{
+ callData.native.function = callThrowTypeError;
+ return CallType::Host;
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.h (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "JSDOMWrapper.h"
+
+namespace WebCore {
+
+// Base class for all constructor objects in the JSC bindings.
+class JSDOMConstructorBase : public JSDOMObject {
+public:
+ using Base = JSDOMObject;
+
+ static const unsigned StructureFlags = Base::StructureFlags | JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance | JSC::TypeOfShouldCallGetCallData;
+ static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject*, JSC::JSValue);
+
+protected:
+ JSDOMConstructorBase(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : JSDOMObject(structure, globalObject)
+ {
+ }
+
+ static String className(const JSObject*);
+ static JSC::CallType getCallData(JSCell*, JSC::CallData&);
+};
+
+inline JSC::Structure* JSDOMConstructorBase::createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+{
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+}
+
+inline String JSDOMConstructorBase::className(const JSObject*)
+{
+ return ASCIILiteral("Function");
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/js/JSDOMConstructorNotConstructable.h (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructorNotConstructable.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructorNotConstructable.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "JSDOMConstructorBase.h"
+#include "JSDOMExceptionHandling.h"
+
+namespace WebCore {
+
+template<typename JSClass> class JSDOMConstructorNotConstructable : public JSDOMConstructorBase {
+public:
+ using Base = JSDOMConstructorBase;
+
+ static JSDOMConstructorNotConstructable* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
+ static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
+
+ DECLARE_INFO;
+
+ // Must be defined for each specialization class.
+ static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
+
+private:
+ JSDOMConstructorNotConstructable(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : Base(structure, globalObject)
+ {
+ }
+
+ void finishCreation(JSC::VM&, JSDOMGlobalObject&);
+
+ // Usually defined for each specialization class.
+ void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
+
+ static JSC::EncodedJSValue JSC_HOST_CALL callThrowTypeError(JSC::ExecState* exec)
+ {
+ JSC::VM& vm = exec->vm();
+ auto scope = DECLARE_THROW_SCOPE(vm);
+ JSC::throwTypeError(exec, scope, ASCIILiteral("Illegal constructor"));
+ return JSC::JSValue::encode(JSC::jsNull());
+ }
+
+ static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData& callData)
+ {
+ callData.native.function = callThrowTypeError;
+ return JSC::CallType::Host;
+ }
+};
+
+template<typename JSClass> inline JSDOMConstructorNotConstructable<JSClass>* JSDOMConstructorNotConstructable<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+{
+ JSDOMConstructorNotConstructable* constructor = new (NotNull, JSC::allocateCell<JSDOMConstructorNotConstructable>(vm.heap)) JSDOMConstructorNotConstructable(structure, globalObject);
+ constructor->finishCreation(vm, globalObject);
+ return constructor;
+}
+
+template<typename JSClass> inline JSC::Structure* JSDOMConstructorNotConstructable<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
+{
+ return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+}
+
+template<typename JSClass> inline void JSDOMConstructorNotConstructable<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(vm, info()));
+ initializeProperties(vm, globalObject);
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/js/JSDOMConstructorWithDocument.cpp (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructorWithDocument.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructorWithDocument.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 1999-2001 Harri Porten ([email protected])
+ * Copyright (C) 2004-2011, 2013, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Samuel Weinig <[email protected]>
+ * Copyright (C) 2013 Michael Pruett <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "JSDOMConstructorWithDocument.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSDOMConstructorWithDocument);
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/js/JSDOMConstructorWithDocument.h (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConstructorWithDocument.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMConstructorWithDocument.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "Document.h"
+#include "JSDOMConstructorBase.h"
+
+namespace WebCore {
+
+// Constructors using this base class depend on being in a Document and
+// can never be used from a WorkerGlobalScope.
+class JSDOMConstructorWithDocument : public JSDOMConstructorBase {
+public:
+ using Base = JSDOMConstructorBase;
+
+ Document* document() const
+ {
+ return downcast<Document>(scriptExecutionContext());
+ }
+
+protected:
+ JSDOMConstructorWithDocument(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : JSDOMConstructorBase(structure, globalObject)
+ {
+ }
+
+ void finishCreation(JSDOMGlobalObject& globalObject)
+ {
+ Base::finishCreation(globalObject.vm());
+ ASSERT(globalObject.scriptExecutionContext()->isDocument());
+ }
+};
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSDOMConvertStrings.h (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMConvertStrings.h 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvertStrings.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -45,6 +45,17 @@
WEBCORE_EXPORT String identifierToUSVString(JSC::ExecState&, const JSC::Identifier&);
WEBCORE_EXPORT String valueToUSVString(JSC::ExecState&, JSC::JSValue);
+inline String propertyNameToString(JSC::PropertyName propertyName)
+{
+ ASSERT(!propertyName.isSymbol());
+ return propertyName.uid() ? propertyName.uid() : propertyName.publicName();
+}
+
+inline AtomicString propertyNameToAtomicString(JSC::PropertyName propertyName)
+{
+ return AtomicString(propertyName.uid() ? propertyName.uid() : propertyName.publicName());
+}
+
// MARK: -
// MARK: String types
Added: trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h (0 => 211892)
--- trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSDOMNamedConstructor.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2015, 2016 Canon Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "JSDOMConstructorWithDocument.h"
+
+namespace WebCore {
+
+// FIMXE: Why can't named constructors be used with workers?
+template<typename JSClass> class JSDOMNamedConstructor : public JSDOMConstructorWithDocument {
+public:
+ using Base = JSDOMConstructorWithDocument;
+
+ static JSDOMNamedConstructor* create(JSC::VM&, JSC::Structure*, JSDOMGlobalObject&);
+ static JSC::Structure* createStructure(JSC::VM&, JSC::JSGlobalObject&, JSC::JSValue prototype);
+
+ DECLARE_INFO;
+
+ // Must be defined for each specialization class.
+ static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
+
+private:
+ JSDOMNamedConstructor(JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+ : Base(structure, globalObject)
+ {
+ }
+
+ void finishCreation(JSC::VM&, JSDOMGlobalObject&);
+ static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
+
+ // Usually defined for each specialization class.
+ void initializeProperties(JSC::VM&, JSDOMGlobalObject&) { }
+ // Must be defined for each specialization class.
+ static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
+};
+
+template<typename JSClass> inline JSDOMNamedConstructor<JSClass>* JSDOMNamedConstructor<JSClass>::create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject& globalObject)
+{
+ JSDOMNamedConstructor* constructor = new (NotNull, JSC::allocateCell<JSDOMNamedConstructor>(vm.heap)) JSDOMNamedConstructor(structure, globalObject);
+ constructor->finishCreation(vm, globalObject);
+ return constructor;
+}
+
+template<typename JSClass> inline JSC::Structure* JSDOMNamedConstructor<JSClass>::createStructure(JSC::VM& vm, JSC::JSGlobalObject& globalObject, JSC::JSValue prototype)
+{
+ return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+}
+
+template<typename JSClass> inline void JSDOMNamedConstructor<JSClass>::finishCreation(JSC::VM& vm, JSDOMGlobalObject& globalObject)
+{
+ Base::finishCreation(globalObject);
+ ASSERT(inherits(vm, info()));
+ initializeProperties(vm, globalObject);
+}
+
+template<typename JSClass> inline JSC::ConstructType JSDOMNamedConstructor<JSClass>::getConstructData(JSC::JSCell*, JSC::ConstructData& constructData)
+{
+ constructData.native.function = construct;
+ return JSC::ConstructType::Host;
+}
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -31,7 +31,7 @@
#include "Document.h"
#include "HTMLFormElement.h"
#include "JSCustomElementInterface.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorBase.h"
#include "JSNodeCustom.h"
#include "ScriptExecutionContext.h"
#include <runtime/InternalFunction.h>
@@ -46,7 +46,7 @@
VM& vm = exec.vm();
auto scope = DECLARE_THROW_SCOPE(vm);
- auto* jsConstructor = jsCast<DOMConstructorObject*>(exec.jsCallee());
+ auto* jsConstructor = jsCast<JSDOMConstructorBase*>(exec.jsCallee());
ASSERT(jsConstructor);
auto* context = jsConstructor->scriptExecutionContext();
Modified: trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -33,7 +33,7 @@
#include "JSMutationObserver.h"
#include "ExceptionCode.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorBase.h"
#include "JSMutationCallback.h"
#include "JSNodeCustom.h"
#include "MutationObserver.h"
@@ -57,7 +57,7 @@
if (!object || object->methodTable()->getCallData(object, callData) == CallType::None)
return throwArgumentTypeError(exec, scope, 0, "callback", "MutationObserver", nullptr, "MutationCallback");
- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.jsCallee());
+ auto* jsConstructor = jsCast<JSDOMConstructorBase*>(exec.jsCallee());
auto callback = JSMutationCallback::create(object, jsConstructor->globalObject());
JSObject* jsObserver = asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));
PrivateName propertyName;
Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -22,8 +22,7 @@
#if ENABLE(READABLE_STREAM_API)
-#include "JSDOMBinding.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMBuiltinConstructor.h"
#include "JSReadableByteStreamController.h"
#include "JSReadableStream.h"
#include "JSReadableStreamDefaultController.h"
@@ -31,6 +30,7 @@
#include "ReadableByteStreamInternalsBuiltins.h"
#include "ReadableStreamInternalsBuiltins.h"
#include "WebCoreJSClientData.h"
+#include <runtime/JSCInlines.h>
using namespace JSC;
@@ -71,11 +71,11 @@
}
// Private JS ReadableStreamDefaultReader and ReadableStreamDefaultController constructors.
-using JSBuiltinReadableStreamDefaultReaderPrivateConstructor = JSBuiltinConstructor<JSReadableStreamDefaultReader>;
-using JSBuiltinReadableStreamDefaultControllerPrivateConstructor = JSBuiltinConstructor<JSReadableStreamDefaultController>;
+using JSBuiltinReadableStreamDefaultReaderPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamDefaultReader>;
+using JSBuiltinReadableStreamDefaultControllerPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamDefaultController>;
#if ENABLE(READABLE_BYTE_STREAM_API)
// Private JS ReadableByteStreamController constructor.
-using JSBuiltinReadableByteStreamControllerPrivateConstructor = JSBuiltinConstructor<JSReadableByteStreamController>;
+using JSBuiltinReadableByteStreamControllerPrivateConstructor = JSDOMBuiltinConstructor<JSReadableByteStreamController>;
#endif
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamDefaultReaderPrivateConstructor);
Modified: trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -26,9 +26,9 @@
#include "config.h"
#include "JSStorage.h"
-#include "JSDOMBinding.h"
+#include "JSDOMConvertStrings.h"
#include "JSDOMExceptionHandling.h"
-#include <runtime/IdentifierInlines.h>
+#include <runtime/JSCInlines.h>
#include <runtime/PropertyNameArray.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebCore/bindings/js/JSUserMessageHandlersNamespaceCustom.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSUserMessageHandlersNamespaceCustom.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSUserMessageHandlersNamespaceCustom.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -28,8 +28,10 @@
#if ENABLE(USER_MESSAGE_HANDLERS)
-#include "JSDOMBinding.h"
+#include "JSDOMConvertInterface.h"
+#include "JSDOMConvertStrings.h"
#include "JSUserMessageHandler.h"
+#include <runtime/JSCInlines.h>
using namespace JSC;
@@ -37,8 +39,8 @@
bool JSUserMessageHandlersNamespace::getOwnPropertySlotDelegate(ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
- if (UserMessageHandler* handler = wrapped().handler(propertyNameToAtomicString(propertyName), globalObject()->world())) {
- slot.setValue(this, ReadOnly | DontDelete | DontEnum, toJS(exec, globalObject(), *handler));
+ if (auto* handler = wrapped().handler(propertyNameToAtomicString(propertyName), globalObject()->world())) {
+ slot.setValue(this, ReadOnly | DontDelete | DontEnum, toJS<IDLInterface<UserMessageHandler>>(*exec, *globalObject(), *handler));
return true;
}
return false;
Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -28,7 +28,8 @@
#include "JSWorker.h"
#include "Document.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorBase.h"
+#include "JSDOMConvertStrings.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMGlobalObject.h"
#include "JSDOMWindowCustom.h"
@@ -44,14 +45,14 @@
VM& vm = state.vm();
auto scope = DECLARE_THROW_SCOPE(vm);
- ASSERT(jsCast<DOMConstructorObject*>(state.jsCallee()));
- ASSERT(jsCast<DOMConstructorObject*>(state.jsCallee())->globalObject());
- auto& globalObject = *jsCast<DOMConstructorObject*>(state.jsCallee())->globalObject();
+ ASSERT(jsCast<JSDOMConstructorBase*>(state.jsCallee()));
+ ASSERT(jsCast<JSDOMConstructorBase*>(state.jsCallee())->globalObject());
+ auto& globalObject = *jsCast<JSDOMConstructorBase*>(state.jsCallee())->globalObject();
if (!state.argumentCount())
return throwVMError(&state, scope, createNotEnoughArgumentsError(&state));
- String scriptURL = state.uncheckedArgument(0).toWTFString(&state);
+ auto scriptURL = convert<IDLDOMString>(state, state.uncheckedArgument(0));
RETURN_IF_EXCEPTION(scope, encodedJSValue());
// See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2017-02-08 20:24:37 UTC (rev 211892)
@@ -6012,7 +6012,7 @@
my $interface = shift;
return "JSDOMConstructorNotConstructable" if $interface->extendedAttributes->{NamedConstructor};
return "JSDOMConstructorNotConstructable" unless IsConstructable($interface);
- return "JSBuiltinConstructor" if IsJSBuiltinConstructor($interface);
+ return "JSDOMBuiltinConstructor" if IsJSBuiltinConstructor($interface);
return "JSDOMConstructor";
}
@@ -6024,7 +6024,8 @@
my $constructorClassName = "${className}Constructor";
my $templateClassName = GetConstructorTemplateClassName($interface);
- $implIncludes{"JSDOMConstructor.h"} = 1;
+ AddToImplIncludes("${templateClassName}.h");
+ AddToImplIncludes("JSDOMNamedConstructor.h") if $interface->extendedAttributes->{NamedConstructor};
push(@$outputArray, "using $constructorClassName = $templateClassName<$className>;\n");
push(@$outputArray, "using JS${interfaceName}NamedConstructor = JSDOMNamedConstructor<$className>;\n") if $interface->extendedAttributes->{NamedConstructor};
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSInterfaceName.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
#include <runtime/FunctionPrototype.h>
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -24,7 +24,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
#include "JSDOMBindingSecurity.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactions.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -25,7 +25,7 @@
#include "HTMLNames.h"
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -24,7 +24,7 @@
#include "CustomElementReactionQueue.h"
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -24,7 +24,7 @@
#include "JSTestCallbackInterface.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMStringList.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMBuiltinConstructor.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
#include "TestClassWithJSBuiltinConstructorBuiltins.h"
@@ -64,7 +64,7 @@
void finishCreation(JSC::VM&);
};
-using JSTestClassWithJSBuiltinConstructorConstructor = JSBuiltinConstructor<JSTestClassWithJSBuiltinConstructor>;
+using JSTestClassWithJSBuiltinConstructorConstructor = JSDOMBuiltinConstructor<JSTestClassWithJSBuiltinConstructor>;
template<> JSValue JSTestClassWithJSBuiltinConstructorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
{
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -28,7 +28,7 @@
#include "DOMJITIDLTypeFilter.h"
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
#include <runtime/FunctionPrototype.h>
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestIterable.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMIterator.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMBuiltinConstructor.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
#include "TestJSBuiltinConstructorBuiltins.h"
@@ -72,7 +72,7 @@
void finishCreation(JSC::VM&);
};
-using JSTestJSBuiltinConstructorConstructor = JSBuiltinConstructor<JSTestJSBuiltinConstructor>;
+using JSTestJSBuiltinConstructorConstructor = JSDOMBuiltinConstructor<JSTestJSBuiltinConstructor>;
template<> JSValue JSTestJSBuiltinConstructorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
{
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,9 +23,10 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
+#include "JSDOMNamedConstructor.h"
#include "JSDOMWrapperCache.h"
#include <runtime/Error.h>
#include <runtime/FunctionPrototype.h>
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerialization.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -23,7 +23,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (211891 => 211892)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -26,7 +26,7 @@
#include "JSDOMBinding.h"
#include "JSDOMBindingCaller.h"
-#include "JSDOMConstructor.h"
+#include "JSDOMConstructorNotConstructable.h"
#include "JSDOMConvert.h"
#include "JSDOMExceptionHandling.h"
#include "JSDOMWrapperCache.h"
Modified: trunk/Source/WebCore/dom/StaticRange.cpp (211891 => 211892)
--- trunk/Source/WebCore/dom/StaticRange.cpp 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/dom/StaticRange.cpp 2017-02-08 20:24:37 UTC (rev 211892)
@@ -39,6 +39,10 @@
{
}
+StaticRange::~StaticRange()
+{
+}
+
Ref<StaticRange> StaticRange::create(Ref<Node>&& startContainer, unsigned startOffset, Ref<Node>&& endContainer, unsigned endOffset)
{
return adoptRef(*new StaticRange(WTFMove(startContainer), startOffset, WTFMove(endContainer), endOffset));
Modified: trunk/Source/WebCore/dom/StaticRange.h (211891 => 211892)
--- trunk/Source/WebCore/dom/StaticRange.h 2017-02-08 20:16:04 UTC (rev 211891)
+++ trunk/Source/WebCore/dom/StaticRange.h 2017-02-08 20:24:37 UTC (rev 211892)
@@ -35,6 +35,8 @@
class StaticRange : public RefCounted<StaticRange> {
public:
+ ~StaticRange();
+
static Ref<StaticRange> createFromRange(const Range&);
static Ref<StaticRange> create(Ref<Node>&& startContainer, unsigned startOffset, Ref<Node>&& endContainer, unsigned endOffset);