Diff
Modified: trunk/Source/WebCore/ChangeLog (285195 => 285196)
--- trunk/Source/WebCore/ChangeLog 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/ChangeLog 2021-11-03 03:08:11 UTC (rev 285196)
@@ -1,3 +1,69 @@
+2021-11-02 Caitln Potter <ca...@igalia.com>
+
+ [WebIDL] Support [Exposed=*] extended attribute
+ https://bugs.webkit.org/show_bug.cgi?id=231082
+
+ Reviewed by Chris Dumez.
+
+ Adds a shorthand to expose interfaces/attributes on Window, Workers*,
+ and the forthcoming ShadowRealm global object.
+
+ See https://github.com/heycam/webidl/issues/468 and
+ https://github.com/heycam/webidl/pull/526 for details.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (shouldPropertyBeExposed):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateRuntimeEnableConditionalStringForExposed):
+ * bindings/scripts/IDLParser.pm:
+ (parseExtendedAttributeRest2):
+ * bindings/scripts/preprocess-idls.pl:
+ * bindings/scripts/test/AudioWorkletGlobalScopeConstructors.idl:
+ * bindings/scripts/test/DOMWindowConstructors.idl:
+ * bindings/scripts/test/DedicatedWorkerGlobalScopeConstructors.idl:
+ * bindings/scripts/test/ExposedStar.idl: Added.
+ * bindings/scripts/test/JS/JSDOMWindow.cpp:
+ (WebCore::jsDOMWindow_ExposedStarConstructorGetter):
+ (WebCore::JSC_DEFINE_CUSTOM_GETTER):
+ * bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp:
+ (WebCore::jsDedicatedWorkerGlobalScope_ExposedStarConstructorGetter):
+ (WebCore::JSC_DEFINE_CUSTOM_GETTER):
+ * bindings/scripts/test/JS/JSExposedStar.cpp: Added.
+ (WebCore::JSExposedStarDOMConstructor::prototypeForStructure):
+ (WebCore::JSExposedStarDOMConstructor::initializeProperties):
+ (WebCore::JSExposedStarPrototype::finishCreation):
+ (WebCore::JSExposedStar::JSExposedStar):
+ (WebCore::JSExposedStar::finishCreation):
+ (WebCore::JSExposedStar::createPrototype):
+ (WebCore::JSExposedStar::prototype):
+ (WebCore::JSExposedStar::getConstructor):
+ (WebCore::JSC_DEFINE_CUSTOM_GETTER):
+ (WebCore::jsExposedStarPrototypeFunction_operationForAllContextsBody):
+ (WebCore::JSC_DEFINE_HOST_FUNCTION):
+ (WebCore::jsExposedStarPrototypeFunction_operationJustForWindowContextsBody):
+ (WebCore::jsExposedStarPrototypeFunction_operationJustForWorkerContextsBody):
+ (WebCore::JSExposedStar::subspaceForImpl):
+ (WebCore::JSExposedStar::analyzeHeap):
+ (WebCore::toJSNewlyCreated):
+ (WebCore::toJS):
+ (WebCore::JSExposedStar::toWrapped):
+ * bindings/scripts/test/JS/JSExposedStar.h: Added.
+ (WebCore::JSExposedStar::create):
+ (WebCore::JSExposedStar::createStructure):
+ (WebCore::JSExposedStar::subspaceFor):
+ (WebCore::JSExposedStar::wrapped const):
+ (WebCore::toJS):
+ (WebCore::toJSNewlyCreated):
+ * bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp:
+ (WebCore::jsPaintWorkletGlobalScope_ExposedStarConstructorGetter):
+ (WebCore::JSC_DEFINE_CUSTOM_GETTER):
+ * bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp:
+ (WebCore::jsServiceWorkerGlobalScope_ExposedStarConstructorGetter):
+ (WebCore::JSC_DEFINE_CUSTOM_GETTER):
+ * bindings/scripts/test/PaintWorkletGlobalScopeConstructors.idl:
+ * bindings/scripts/test/ServiceWorkerGlobalScopeConstructors.idl:
+ * bindings/scripts/test/SupplementalDependencies.dep:
+
2021-11-02 Don Olmstead <don.olmst...@sony.com>
Non-unified build fixes early November 2021 edition
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2021-11-03 03:08:11 UTC (rev 285196)
@@ -488,12 +488,15 @@
}
# Attributes / Operations / Constants of supplemental interfaces can have an [Exposed=XX] attribute which restricts
-# on which global contexts they should be exposed.
+# on which global contexts they should be exposed. [Exposed=*] will expose the attribute on the interface for all
+# supported global contexts.
sub shouldPropertyBeExposed
{
my ($context, $target) = @_;
my $exposedAttribute = $target->extendedAttributes->{"Exposed"} || "Window";
+ return 1 if $exposedAttribute eq "*";
+
$exposedAttribute = substr($exposedAttribute, 1, -1) if substr($exposedAttribute, 0, 1) eq "(";
my @targetGlobalContexts = split(",", $exposedAttribute);
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2021-11-03 03:08:11 UTC (rev 285196)
@@ -3946,6 +3946,8 @@
AddToImplIncludes("ScriptExecutionContext.h");
my $exposed = $context->extendedAttributes->{Exposed};
+ return if $exposed eq "*";
+
if (ref($exposed) eq 'ARRAY') {
if (scalar(@$exposed) > 1) {
return;
Modified: trunk/Source/WebCore/bindings/scripts/IDLParser.pm (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/IDLParser.pm 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/IDLParser.pm 2021-11-03 03:08:11 UTC (rev 285196)
@@ -2372,6 +2372,10 @@
$self->assertTokenValue($self->getToken(), ")", __LINE__);
return \@arguments;
}
+ if ($next->value() eq "*") {
+ $self->assertTokenValue($self->getToken(), "*", __LINE__);
+ return "*";
+ }
if ($next->type() == IdentifierToken) {
my $name = $self->parseName();
return $self->parseExtendedAttributeRest3($name);
Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -55,6 +55,19 @@
my $idlAttributesFile;
my $verbose = 0;
+# List of contexts with the [Global] extended attribute.
+#
+# Must not contain partial interfaces used by other interfaces in the list,
+# in order to prevent the same attributes/interfaces being installed multiple
+# times when [Exposed=*] is used.
+my @supportedGlobalContexts = (
+ "Window",
+ "DedicatedWorker",
+ "ServiceWorker",
+ "PaintWorklet",
+ "AudioWorklet"
+);
+
# Toggle this to validate that the fast regular _expression_ based "parsing" used
# in this file produces the same results as the slower results produced by the
# complete IDLParser.
@@ -246,7 +259,11 @@
if (!$exposedAttribute) {
die "ERROR: No [Exposed] extended attribute specified for interface in $idlFileName";
}
+ if ($exposedAttribute eq "*") {
+ $exposedAttribute = "(" . join(',', @supportedGlobalContexts) . ")";
+ }
$exposedAttribute = substr($exposedAttribute, 1, -1) if substr($exposedAttribute, 0, 1) eq "(";
+
my @globalContexts = split(",", $exposedAttribute);
foreach my $globalContext (@globalContexts) {
my ($attributeCode, $windowAliases) = GenerateConstructorAttributes($interfaceName, $extendedAttributes, $globalContext);
Modified: trunk/Source/WebCore/bindings/scripts/test/AudioWorkletGlobalScopeConstructors.idl (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/AudioWorkletGlobalScopeConstructors.idl 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/AudioWorkletGlobalScopeConstructors.idl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -1,2 +1,3 @@
partial interface AudioWorkletGlobalScope {
+ attribute ExposedStarConstructor ExposedStar;
};
Modified: trunk/Source/WebCore/bindings/scripts/test/DOMWindowConstructors.idl (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/DOMWindowConstructors.idl 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/DOMWindowConstructors.idl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -1,5 +1,6 @@
partial interface DOMWindow {
attribute DOMWindowConstructor DOMWindow;
+ attribute ExposedStarConstructor ExposedStar;
attribute ExposedToWorkerAndWindowConstructor ExposedToWorkerAndWindow;
attribute TestConditionalIncludesConstructor TestConditionalIncludes;
attribute TestConditionallyReadWriteConstructor TestConditionallyReadWrite;
Modified: trunk/Source/WebCore/bindings/scripts/test/DedicatedWorkerGlobalScopeConstructors.idl (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/DedicatedWorkerGlobalScopeConstructors.idl 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/DedicatedWorkerGlobalScopeConstructors.idl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -1,3 +1,4 @@
partial interface DedicatedWorkerGlobalScope {
attribute DedicatedWorkerGlobalScopeConstructor DedicatedWorkerGlobalScope;
+ attribute ExposedStarConstructor ExposedStar;
};
Added: trunk/Source/WebCore/bindings/scripts/test/ExposedStar.idl (0 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/ExposedStar.idl (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/ExposedStar.idl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -0,0 +1,7 @@
+[
+ Exposed=*
+] interface ExposedStar : EventTarget {
+ [Exposed=*] undefined operationForAllContexts();
+ [Exposed=Window] undefined operationJustForWindowContexts();
+ [Exposed=Worker] undefined operationJustForWorkerContexts();
+};
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp 2021-11-03 03:08:11 UTC (rev 285196)
@@ -30,6 +30,7 @@
#include "JSDOMGlobalObjectInlines.h"
#include "JSDOMWindow.h"
#include "JSDOMWrapperCache.h"
+#include "JSExposedStar.h"
#include "JSExposedToWorkerAndWindow.h"
#include "JSTestConditionalIncludes.h"
#include "JSTestConditionallyReadWrite.h"
@@ -64,6 +65,7 @@
static JSC_DECLARE_CUSTOM_GETTER(jsDOMWindowConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsDOMWindow_DOMWindowConstructor);
+static JSC_DECLARE_CUSTOM_GETTER(jsDOMWindow_ExposedStarConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsDOMWindow_ExposedToWorkerAndWindowConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsDOMWindow_TestConditionalIncludesConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsDOMWindow_TestConditionallyReadWriteConstructor);
@@ -84,7 +86,7 @@
static const struct CompactHashIndex JSDOMWindowTableIndex[37] = {
{ -1, -1 },
- { 5, 35 },
+ { 6, 35 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
@@ -97,29 +99,29 @@
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { 4, 33 },
+ { 5, 33 },
{ -1, -1 },
- { 2, -1 },
- { 1, 32 },
+ { 3, -1 },
+ { 2, 32 },
{ 0, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
+ { 1, -1 },
{ -1, -1 },
+ { 10, -1 },
{ -1, -1 },
- { 9, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
{ -1, -1 },
- { -1, -1 },
- { 3, 34 },
- { 6, 36 },
- { 7, -1 },
+ { 4, 34 },
+ { 7, 36 },
{ 8, -1 },
- { 10, -1 },
+ { 9, -1 },
+ { 11, -1 },
};
@@ -126,6 +128,7 @@
static const HashTableValue JSDOMWindowTableValues[] =
{
{ "DOMWindow", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindow_DOMWindowConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+ { "ExposedStar", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindow_ExposedStarConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "ExposedToWorkerAndWindow", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindow_ExposedToWorkerAndWindowConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "TestConditionalIncludes", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindow_TestConditionalIncludesConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "TestConditionallyReadWrite", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindow_TestConditionallyReadWriteConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
@@ -142,7 +145,7 @@
{ "TestPromiseRejectionEvent", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDOMWindow_TestPromiseRejectionEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
-static const HashTable JSDOMWindowTable = { 11, 31, true, JSDOMWindow::info(), JSDOMWindowTableValues, JSDOMWindowTableIndex };
+static const HashTable JSDOMWindowTable = { 12, 31, true, JSDOMWindow::info(), JSDOMWindowTableValues, JSDOMWindowTableIndex };
template<> const ClassInfo JSDOMWindowDOMConstructor::s_info = { "DOMWindow", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMWindowDOMConstructor) };
template<> JSValue JSDOMWindowDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
@@ -225,6 +228,17 @@
return IDLAttribute<JSDOMWindow>::get<jsDOMWindow_DOMWindowConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
}
+static inline JSValue jsDOMWindow_ExposedStarConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSDOMWindow& thisObject)
+{
+ UNUSED_PARAM(lexicalGlobalObject);
+ return JSExposedStar::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
+}
+
+JSC_DEFINE_CUSTOM_GETTER(jsDOMWindow_ExposedStarConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ return IDLAttribute<JSDOMWindow>::get<jsDOMWindow_ExposedStarConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
+}
+
static inline JSValue jsDOMWindow_ExposedToWorkerAndWindowConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSDOMWindow& thisObject)
{
UNUSED_PARAM(lexicalGlobalObject);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.cpp 2021-11-03 03:08:11 UTC (rev 285196)
@@ -31,6 +31,7 @@
#include "JSDOMGlobalObjectInlines.h"
#include "JSDOMWrapperCache.h"
#include "JSDedicatedWorkerGlobalScope.h"
+#include "JSExposedStar.h"
#include "ScriptExecutionContext.h"
#include "WebCoreJSClientData.h"
#include <_javascript_Core/HeapAnalyzer.h>
@@ -50,14 +51,18 @@
static JSC_DECLARE_CUSTOM_GETTER(jsDedicatedWorkerGlobalScopeConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsDedicatedWorkerGlobalScope_DedicatedWorkerGlobalScopeConstructor);
+static JSC_DECLARE_CUSTOM_GETTER(jsDedicatedWorkerGlobalScope_ExposedStarConstructor);
using JSDedicatedWorkerGlobalScopeDOMConstructor = JSDOMConstructorNotConstructable<JSDedicatedWorkerGlobalScope>;
/* Hash table */
-static const struct CompactHashIndex JSDedicatedWorkerGlobalScopeTableIndex[2] = {
+static const struct CompactHashIndex JSDedicatedWorkerGlobalScopeTableIndex[5] = {
{ -1, -1 },
- { 0, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { 0, 4 },
+ { 1, -1 },
};
@@ -64,9 +69,10 @@
static const HashTableValue JSDedicatedWorkerGlobalScopeTableValues[] =
{
{ "DedicatedWorkerGlobalScope", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDedicatedWorkerGlobalScope_DedicatedWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+ { "ExposedStar", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDedicatedWorkerGlobalScope_ExposedStarConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
-static const HashTable JSDedicatedWorkerGlobalScopeTable = { 1, 1, true, JSDedicatedWorkerGlobalScope::info(), JSDedicatedWorkerGlobalScopeTableValues, JSDedicatedWorkerGlobalScopeTableIndex };
+static const HashTable JSDedicatedWorkerGlobalScopeTable = { 2, 3, true, JSDedicatedWorkerGlobalScope::info(), JSDedicatedWorkerGlobalScopeTableValues, JSDedicatedWorkerGlobalScopeTableIndex };
template<> const ClassInfo JSDedicatedWorkerGlobalScopeDOMConstructor::s_info = { "DedicatedWorkerGlobalScope", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDedicatedWorkerGlobalScopeDOMConstructor) };
template<> JSValue JSDedicatedWorkerGlobalScopeDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
@@ -147,6 +153,17 @@
return IDLAttribute<JSDedicatedWorkerGlobalScope>::get<jsDedicatedWorkerGlobalScope_DedicatedWorkerGlobalScopeConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
}
+static inline JSValue jsDedicatedWorkerGlobalScope_ExposedStarConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSDedicatedWorkerGlobalScope& thisObject)
+{
+ UNUSED_PARAM(lexicalGlobalObject);
+ return JSExposedStar::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
+}
+
+JSC_DEFINE_CUSTOM_GETTER(jsDedicatedWorkerGlobalScope_ExposedStarConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ return IDLAttribute<JSDedicatedWorkerGlobalScope>::get<jsDedicatedWorkerGlobalScope_ExposedStarConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
+}
+
JSC::IsoSubspace* JSDedicatedWorkerGlobalScope::subspaceForImpl(JSC::VM& vm)
{
auto& clientData = *static_cast<JSVMClientData*>(vm.clientData);
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp (0 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp 2021-11-03 03:08:11 UTC (rev 285196)
@@ -0,0 +1,308 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSExposedStar.h"
+
+#include "ActiveDOMObject.h"
+#include "DOMIsoSubspaces.h"
+#include "IDLTypes.h"
+#include "JSDOMBinding.h"
+#include "JSDOMConstructorNotConstructable.h"
+#include "JSDOMConvertBase.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSDOMGlobalObjectInlines.h"
+#include "JSDOMOperation.h"
+#include "JSDOMWrapperCache.h"
+#include "ScriptExecutionContext.h"
+#include "WebCoreJSClientData.h"
+#include <_javascript_Core/HeapAnalyzer.h>
+#include <_javascript_Core/JSCInlines.h>
+#include <_javascript_Core/JSDestructibleObjectHeapCellType.h>
+#include <_javascript_Core/SlotVisitorMacros.h>
+#include <_javascript_Core/SubspaceInlines.h>
+#include <wtf/GetPtr.h>
+#include <wtf/PointerPreparations.h>
+#include <wtf/URL.h>
+
+
+namespace WebCore {
+using namespace JSC;
+
+// Functions
+
+static JSC_DECLARE_HOST_FUNCTION(jsExposedStarPrototypeFunction_operationForAllContexts);
+static JSC_DECLARE_HOST_FUNCTION(jsExposedStarPrototypeFunction_operationJustForWindowContexts);
+static JSC_DECLARE_HOST_FUNCTION(jsExposedStarPrototypeFunction_operationJustForWorkerContexts);
+
+// Attributes
+
+static JSC_DECLARE_CUSTOM_GETTER(jsExposedStarConstructor);
+
+class JSExposedStarPrototype final : public JSC::JSNonFinalObject {
+public:
+ using Base = JSC::JSNonFinalObject;
+ static JSExposedStarPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSExposedStarPrototype* ptr = new (NotNull, JSC::allocateCell<JSExposedStarPrototype>(vm.heap)) JSExposedStarPrototype(vm, globalObject, structure);
+ ptr->finishCreation(vm);
+ return ptr;
+ }
+
+ DECLARE_INFO;
+ template<typename CellType, JSC::SubspaceAccess>
+ static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExposedStarPrototype, Base);
+ return &vm.plainObjectSpace;
+ }
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+ }
+
+private:
+ JSExposedStarPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+ : JSC::JSNonFinalObject(vm, structure)
+ {
+ }
+
+ void finishCreation(JSC::VM&);
+};
+STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSExposedStarPrototype, JSExposedStarPrototype::Base);
+
+using JSExposedStarDOMConstructor = JSDOMConstructorNotConstructable<JSExposedStar>;
+
+template<> const ClassInfo JSExposedStarDOMConstructor::s_info = { "ExposedStar", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSExposedStarDOMConstructor) };
+
+template<> JSValue JSExposedStarDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+ return JSEventTarget::getConstructor(vm, &globalObject);
+}
+
+template<> void JSExposedStarDOMConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+ JSString* nameString = jsNontrivialString(vm, "ExposedStar"_s);
+ m_originalName.set(vm, this, nameString);
+ putDirect(vm, vm.propertyNames->name, nameString, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
+ putDirect(vm, vm.propertyNames->prototype, JSExposedStar::prototype(vm, globalObject), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete);
+}
+
+/* Hash table for prototype */
+
+static const HashTableValue JSExposedStarPrototypeTableValues[] =
+{
+ { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsExposedStarConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+ { "operationForAllContexts", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsExposedStarPrototypeFunction_operationForAllContexts), (intptr_t) (0) } },
+ { "operationJustForWindowContexts", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsExposedStarPrototypeFunction_operationJustForWindowContexts), (intptr_t) (0) } },
+ { "operationJustForWorkerContexts", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsExposedStarPrototypeFunction_operationJustForWorkerContexts), (intptr_t) (0) } },
+};
+
+const ClassInfo JSExposedStarPrototype::s_info = { "ExposedStar", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSExposedStarPrototype) };
+
+void JSExposedStarPrototype::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ reifyStaticProperties(vm, JSExposedStar::info(), JSExposedStarPrototypeTableValues, *this);
+ bool hasDisabledRuntimeProperties = false;
+ if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isDocument()) {
+ hasDisabledRuntimeProperties = true;
+ auto propertyName = Identifier::fromString(vm, reinterpret_cast<const LChar*>("operationJustForWindowContexts"), strlen("operationJustForWindowContexts"));
+ VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+ DeletePropertySlot slot;
+ JSObject::deleteProperty(this, globalObject(), propertyName, slot);
+ }
+ if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->isWorkerGlobalScope()) {
+ hasDisabledRuntimeProperties = true;
+ auto propertyName = Identifier::fromString(vm, reinterpret_cast<const LChar*>("operationJustForWorkerContexts"), strlen("operationJustForWorkerContexts"));
+ VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
+ DeletePropertySlot slot;
+ JSObject::deleteProperty(this, globalObject(), propertyName, slot);
+ }
+ if (hasDisabledRuntimeProperties && structure()->isDictionary())
+ flattenDictionaryObject(vm);
+ JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
+}
+
+const ClassInfo JSExposedStar::s_info = { "ExposedStar", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSExposedStar) };
+
+JSExposedStar::JSExposedStar(Structure* structure, JSDOMGlobalObject& globalObject, Ref<ExposedStar>&& impl)
+ : JSEventTarget(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSExposedStar::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(vm, info()));
+
+ static_assert(!std::is_base_of<ActiveDOMObject, ExposedStar>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");
+
+}
+
+JSObject* JSExposedStar::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ return JSExposedStarPrototype::create(vm, &globalObject, JSExposedStarPrototype::createStructure(vm, &globalObject, JSEventTarget::prototype(vm, globalObject)));
+}
+
+JSObject* JSExposedStar::prototype(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ return getDOMPrototype<JSExposedStar>(vm, globalObject);
+}
+
+JSValue JSExposedStar::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSExposedStarDOMConstructor, DOMConstructorID::ExposedStar>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+JSC_DEFINE_CUSTOM_GETTER(jsExposedStarConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName))
+{
+ VM& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ auto* prototype = jsDynamicCast<JSExposedStarPrototype*>(vm, JSValue::decode(thisValue));
+ if (UNLIKELY(!prototype))
+ return throwVMTypeError(lexicalGlobalObject, throwScope);
+ return JSValue::encode(JSExposedStar::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject()));
+}
+
+static inline JSC::EncodedJSValue jsExposedStarPrototypeFunction_operationForAllContextsBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSExposedStar>::ClassParameter castedThis)
+{
+ auto& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(callFrame);
+ auto& impl = castedThis->wrapped();
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.operationForAllContexts(); })));
+}
+
+JSC_DEFINE_HOST_FUNCTION(jsExposedStarPrototypeFunction_operationForAllContexts, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame))
+{
+ return IDLOperation<JSExposedStar>::call<jsExposedStarPrototypeFunction_operationForAllContextsBody>(*lexicalGlobalObject, *callFrame, "operationForAllContexts");
+}
+
+static inline JSC::EncodedJSValue jsExposedStarPrototypeFunction_operationJustForWindowContextsBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSExposedStar>::ClassParameter castedThis)
+{
+ auto& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(callFrame);
+ auto& impl = castedThis->wrapped();
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.operationJustForWindowContexts(); })));
+}
+
+JSC_DEFINE_HOST_FUNCTION(jsExposedStarPrototypeFunction_operationJustForWindowContexts, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame))
+{
+ return IDLOperation<JSExposedStar>::call<jsExposedStarPrototypeFunction_operationJustForWindowContextsBody>(*lexicalGlobalObject, *callFrame, "operationJustForWindowContexts");
+}
+
+static inline JSC::EncodedJSValue jsExposedStarPrototypeFunction_operationJustForWorkerContextsBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSExposedStar>::ClassParameter castedThis)
+{
+ auto& vm = JSC::getVM(lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
+ UNUSED_PARAM(callFrame);
+ auto& impl = castedThis->wrapped();
+ RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.operationJustForWorkerContexts(); })));
+}
+
+JSC_DEFINE_HOST_FUNCTION(jsExposedStarPrototypeFunction_operationJustForWorkerContexts, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame))
+{
+ return IDLOperation<JSExposedStar>::call<jsExposedStarPrototypeFunction_operationJustForWorkerContextsBody>(*lexicalGlobalObject, *callFrame, "operationJustForWorkerContexts");
+}
+
+JSC::IsoSubspace* JSExposedStar::subspaceForImpl(JSC::VM& vm)
+{
+ auto& clientData = *static_cast<JSVMClientData*>(vm.clientData);
+ auto& spaces = clientData.subspaces();
+ if (auto* space = spaces.m_subspaceForExposedStar.get())
+ return space;
+ static_assert(std::is_base_of_v<JSC::JSDestructibleObject, JSExposedStar> || !JSExposedStar::needsDestruction);
+ if constexpr (std::is_base_of_v<JSC::JSDestructibleObject, JSExposedStar>)
+ spaces.m_subspaceForExposedStar = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSExposedStar);
+ else
+ spaces.m_subspaceForExposedStar = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSExposedStar);
+ auto* space = spaces.m_subspaceForExposedStar.get();
+IGNORE_WARNINGS_BEGIN("unreachable-code")
+IGNORE_WARNINGS_BEGIN("tautological-compare")
+ void (*myVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSExposedStar::visitOutputConstraints;
+ void (*jsCellVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSC::JSCell::visitOutputConstraints;
+ if (myVisitOutputConstraint != jsCellVisitOutputConstraint)
+ clientData.outputConstraintSpaces().append(space);
+IGNORE_WARNINGS_END
+IGNORE_WARNINGS_END
+ return space;
+}
+
+void JSExposedStar::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
+{
+ auto* thisObject = jsCast<JSExposedStar*>(cell);
+ analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped());
+ if (thisObject->scriptExecutionContext())
+ analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
+ Base::analyzeHeap(cell, analyzer);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7ExposedStar@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore11ExposedStarE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<ExposedStar>&& impl)
+{
+
+#if ENABLE(BINDING_INTEGRITY)
+ const void* actualVTablePointer = getVTablePointer(impl.ptr());
+#if PLATFORM(WIN)
+ void* expectedVTablePointer = __identifier("??_7ExposedStar@WebCore@@6B@");
+#else
+ void* expectedVTablePointer = &_ZTVN7WebCore11ExposedStarE[2];
+#endif
+
+ // If this fails ExposedStar does not have a vtable, so you need to add the
+ // ImplementationLacksVTable attribute to the interface definition
+ static_assert(std::is_polymorphic<ExposedStar>::value, "ExposedStar is not polymorphic");
+
+ // If you hit this assertion you either have a use after free bug, or
+ // ExposedStar has subclasses. If ExposedStar has subclasses that get passed
+ // to toJS() we currently require ExposedStar you to opt out of binding hardening
+ // by adding the SkipVTableValidation attribute to the interface IDL definition
+ RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+ return createWrapper<ExposedStar>(globalObject, WTFMove(impl));
+}
+
+JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, ExposedStar& impl)
+{
+ return wrap(lexicalGlobalObject, globalObject, impl);
+}
+
+ExposedStar* JSExposedStar::toWrapped(JSC::VM& vm, JSC::JSValue value)
+{
+ if (auto* wrapper = jsDynamicCast<JSExposedStar*>(vm, value))
+ return &wrapper->wrapped();
+ return nullptr;
+}
+
+}
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedStar.h (0 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedStar.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSExposedStar.h 2021-11-03 03:08:11 UTC (rev 285196)
@@ -0,0 +1,80 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "ExposedStar.h"
+#include "JSDOMWrapper.h"
+#include "JSEventTarget.h"
+
+namespace WebCore {
+
+class JSExposedStar : public JSEventTarget {
+public:
+ using Base = JSEventTarget;
+ using DOMWrapped = ExposedStar;
+ static JSExposedStar* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<ExposedStar>&& impl)
+ {
+ JSExposedStar* ptr = new (NotNull, JSC::allocateCell<JSExposedStar>(globalObject->vm().heap)) JSExposedStar(structure, *globalObject, WTFMove(impl));
+ ptr->finishCreation(globalObject->vm());
+ return ptr;
+ }
+
+ static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
+ static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
+ static ExposedStar* toWrapped(JSC::VM&, JSC::JSValue);
+
+ DECLARE_INFO;
+
+ static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info(), JSC::NonArray);
+ }
+
+ static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+ template<typename, JSC::SubspaceAccess mode> static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
+ {
+ if constexpr (mode == JSC::SubspaceAccess::Concurrently)
+ return nullptr;
+ return subspaceForImpl(vm);
+ }
+ static JSC::IsoSubspace* subspaceForImpl(JSC::VM& vm);
+ static void analyzeHeap(JSCell*, JSC::HeapAnalyzer&);
+ ExposedStar& wrapped() const
+ {
+ return static_cast<ExposedStar&>(Base::wrapped());
+ }
+protected:
+ JSExposedStar(JSC::Structure*, JSDOMGlobalObject&, Ref<ExposedStar>&&);
+
+ void finishCreation(JSC::VM&);
+};
+
+JSC::JSValue toJS(JSC::JSGlobalObject*, JSDOMGlobalObject*, ExposedStar&);
+inline JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, ExposedStar* impl) { return impl ? toJS(lexicalGlobalObject, globalObject, *impl) : JSC::jsNull(); }
+JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject*, Ref<ExposedStar>&&);
+inline JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, RefPtr<ExposedStar>&& impl) { return impl ? toJSNewlyCreated(lexicalGlobalObject, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
+
+template<> struct JSDOMWrapperConverterTraits<ExposedStar> {
+ using WrapperClass = JSExposedStar;
+ using ToWrappedReturnType = ExposedStar*;
+};
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.cpp 2021-11-03 03:08:11 UTC (rev 285196)
@@ -29,6 +29,7 @@
#include "JSDOMExceptionHandling.h"
#include "JSDOMGlobalObjectInlines.h"
#include "JSDOMWrapperCache.h"
+#include "JSExposedStar.h"
#include "JSPaintWorkletGlobalScope.h"
#include "PaintWorkletGlobalScope.h"
#include "ScriptExecutionContext.h"
@@ -49,6 +50,7 @@
// Attributes
static JSC_DECLARE_CUSTOM_GETTER(jsPaintWorkletGlobalScopeConstructor);
+static JSC_DECLARE_CUSTOM_GETTER(jsPaintWorkletGlobalScope_ExposedStarConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsPaintWorkletGlobalScope_PaintWorkletGlobalScopeConstructor);
using JSPaintWorkletGlobalScopeDOMConstructor = JSDOMConstructorNotConstructable<JSPaintWorkletGlobalScope>;
@@ -55,8 +57,10 @@
/* Hash table */
-static const struct CompactHashIndex JSPaintWorkletGlobalScopeTableIndex[2] = {
+static const struct CompactHashIndex JSPaintWorkletGlobalScopeTableIndex[4] = {
{ -1, -1 },
+ { 1, -1 },
+ { -1, -1 },
{ 0, -1 },
};
@@ -63,10 +67,11 @@
static const HashTableValue JSPaintWorkletGlobalScopeTableValues[] =
{
+ { "ExposedStar", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintWorkletGlobalScope_ExposedStarConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "PaintWorkletGlobalScope", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPaintWorkletGlobalScope_PaintWorkletGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
-static const HashTable JSPaintWorkletGlobalScopeTable = { 1, 1, true, JSPaintWorkletGlobalScope::info(), JSPaintWorkletGlobalScopeTableValues, JSPaintWorkletGlobalScopeTableIndex };
+static const HashTable JSPaintWorkletGlobalScopeTable = { 2, 3, true, JSPaintWorkletGlobalScope::info(), JSPaintWorkletGlobalScopeTableValues, JSPaintWorkletGlobalScopeTableIndex };
template<> const ClassInfo JSPaintWorkletGlobalScopeDOMConstructor::s_info = { "PaintWorkletGlobalScope", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPaintWorkletGlobalScopeDOMConstructor) };
template<> JSValue JSPaintWorkletGlobalScopeDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
@@ -136,6 +141,17 @@
return JSValue::encode(JSPaintWorkletGlobalScope::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject()));
}
+static inline JSValue jsPaintWorkletGlobalScope_ExposedStarConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSPaintWorkletGlobalScope& thisObject)
+{
+ UNUSED_PARAM(lexicalGlobalObject);
+ return JSExposedStar::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
+}
+
+JSC_DEFINE_CUSTOM_GETTER(jsPaintWorkletGlobalScope_ExposedStarConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ return IDLAttribute<JSPaintWorkletGlobalScope>::get<jsPaintWorkletGlobalScope_ExposedStarConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
+}
+
static inline JSValue jsPaintWorkletGlobalScope_PaintWorkletGlobalScopeConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSPaintWorkletGlobalScope& thisObject)
{
UNUSED_PARAM(lexicalGlobalObject);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.cpp 2021-11-03 03:08:11 UTC (rev 285196)
@@ -29,6 +29,7 @@
#include "JSDOMExceptionHandling.h"
#include "JSDOMGlobalObjectInlines.h"
#include "JSDOMWrapperCache.h"
+#include "JSExposedStar.h"
#include "JSServiceWorkerGlobalScope.h"
#include "ScriptExecutionContext.h"
#include "ServiceWorkerGlobalScope.h"
@@ -49,6 +50,7 @@
// Attributes
static JSC_DECLARE_CUSTOM_GETTER(jsServiceWorkerGlobalScopeConstructor);
+static JSC_DECLARE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ExposedStarConstructor);
static JSC_DECLARE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ServiceWorkerGlobalScopeConstructor);
using JSServiceWorkerGlobalScopeDOMConstructor = JSDOMConstructorNotConstructable<JSServiceWorkerGlobalScope>;
@@ -55,8 +57,10 @@
/* Hash table */
-static const struct CompactHashIndex JSServiceWorkerGlobalScopeTableIndex[2] = {
+static const struct CompactHashIndex JSServiceWorkerGlobalScopeTableIndex[4] = {
{ -1, -1 },
+ { 1, -1 },
+ { -1, -1 },
{ 0, -1 },
};
@@ -63,10 +67,11 @@
static const HashTableValue JSServiceWorkerGlobalScopeTableValues[] =
{
+ { "ExposedStar", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsServiceWorkerGlobalScope_ExposedStarConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "ServiceWorkerGlobalScope", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsServiceWorkerGlobalScope_ServiceWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
-static const HashTable JSServiceWorkerGlobalScopeTable = { 1, 1, true, JSServiceWorkerGlobalScope::info(), JSServiceWorkerGlobalScopeTableValues, JSServiceWorkerGlobalScopeTableIndex };
+static const HashTable JSServiceWorkerGlobalScopeTable = { 2, 3, true, JSServiceWorkerGlobalScope::info(), JSServiceWorkerGlobalScopeTableValues, JSServiceWorkerGlobalScopeTableIndex };
template<> const ClassInfo JSServiceWorkerGlobalScopeDOMConstructor::s_info = { "ServiceWorkerGlobalScope", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSServiceWorkerGlobalScopeDOMConstructor) };
template<> JSValue JSServiceWorkerGlobalScopeDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
@@ -136,6 +141,17 @@
return JSValue::encode(JSServiceWorkerGlobalScope::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject()));
}
+static inline JSValue jsServiceWorkerGlobalScope_ExposedStarConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSServiceWorkerGlobalScope& thisObject)
+{
+ UNUSED_PARAM(lexicalGlobalObject);
+ return JSExposedStar::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
+}
+
+JSC_DEFINE_CUSTOM_GETTER(jsServiceWorkerGlobalScope_ExposedStarConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
+{
+ return IDLAttribute<JSServiceWorkerGlobalScope>::get<jsServiceWorkerGlobalScope_ExposedStarConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
+}
+
static inline JSValue jsServiceWorkerGlobalScope_ServiceWorkerGlobalScopeConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSServiceWorkerGlobalScope& thisObject)
{
UNUSED_PARAM(lexicalGlobalObject);
Modified: trunk/Source/WebCore/bindings/scripts/test/PaintWorkletGlobalScopeConstructors.idl (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/PaintWorkletGlobalScopeConstructors.idl 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/PaintWorkletGlobalScopeConstructors.idl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -1,3 +1,4 @@
partial interface PaintWorkletGlobalScope {
+ attribute ExposedStarConstructor ExposedStar;
attribute PaintWorkletGlobalScopeConstructor PaintWorkletGlobalScope;
};
Modified: trunk/Source/WebCore/bindings/scripts/test/ServiceWorkerGlobalScopeConstructors.idl (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/ServiceWorkerGlobalScopeConstructors.idl 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/ServiceWorkerGlobalScopeConstructors.idl 2021-11-03 03:08:11 UTC (rev 285196)
@@ -1,3 +1,4 @@
partial interface ServiceWorkerGlobalScope {
+ attribute ExposedStarConstructor ExposedStar;
attribute ServiceWorkerGlobalScopeConstructor ServiceWorkerGlobalScope;
};
Modified: trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (285195 => 285196)
--- trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep 2021-11-03 02:26:54 UTC (rev 285195)
+++ trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep 2021-11-03 03:08:11 UTC (rev 285196)
@@ -7,6 +7,9 @@
DOMDedicatedWorkerGlobalScope.h: DedicatedWorkerGlobalScopeConstructors.idl
WebDOMDedicatedWorkerGlobalScope.h: DedicatedWorkerGlobalScopeConstructors.idl
DedicatedWorkerGlobalScopeConstructors.idl:
+JSExposedStar.h:
+DOMExposedStar.h:
+WebDOMExposedStar.h:
JSExposedToWorkerAndWindow.h:
DOMExposedToWorkerAndWindow.h:
WebDOMExposedToWorkerAndWindow.h: