Diff
Modified: trunk/LayoutTests/ChangeLog (196647 => 196648)
--- trunk/LayoutTests/ChangeLog 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/ChangeLog 2016-02-16 20:23:02 UTC (rev 196648)
@@ -1,3 +1,15 @@
+2016-02-16 Chris Dumez <[email protected]>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ Reviewed by Gavin Barraclough.
+
+ * inspector/model/remote-object-get-properties-expected.txt:
+ Rebaseline test because the order of static properties has changed:
+ functions are now before constants instead of after.
+
2016-02-16 Ryan Haddad <[email protected]>
Marking webarchive/loading/missing-data.html as flaky on ios-simulator-wk2
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196647 => 196648)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-02-16 20:23:02 UTC (rev 196648)
@@ -1,3 +1,15 @@
+2016-02-16 Chris Dumez <[email protected]>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ Reviewed by Gavin Barraclough.
+
+ Rebaseline now that more checks are passing.
+
+ * web-platform-tests/html/dom/interfaces-expected.txt:
+
2016-02-15 Chris Dumez <[email protected]>
The following properties should exist on the global object: AudioTrackList, AudioTrack, VideoTrackList, VideoTrack
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (196647 => 196648)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt 2016-02-16 20:23:02 UTC (rev 196648)
@@ -3824,30 +3824,30 @@
PASS Window interface: attribute statusbar
PASS Window interface: attribute toolbar
PASS Window interface: attribute status
-FAIL Window interface: operation close() assert_equals: property should be writable if and only if not unforgeable expected true but got false
+PASS Window interface: operation close()
PASS Window interface: attribute closed
-FAIL Window interface: operation stop() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation focus() assert_equals: property should be writable if and only if not unforgeable expected true but got false
-FAIL Window interface: operation blur() assert_equals: property should be writable if and only if not unforgeable expected true but got false
+PASS Window interface: operation stop()
+PASS Window interface: operation focus()
+PASS Window interface: operation blur()
PASS Window interface: attribute frames
PASS Window interface: attribute length
PASS Window interface: attribute opener
PASS Window interface: attribute parent
PASS Window interface: attribute frameElement
-FAIL Window interface: operation open(DOMString,DOMString,DOMString,boolean) desc is not an Object. (evaluating '"get" in desc')
+FAIL Window interface: operation open(DOMString,DOMString,DOMString,boolean) assert_equals: property has wrong .length expected 0 but got 2
FAIL Window interface: attribute navigator assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function navigator() {
[native code]
}"
FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
PASS Window interface: attribute applicationCache
-FAIL Window interface: operation alert() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation confirm(DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation prompt(DOMString,DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation print() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation showModalDialog(DOMString,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation postMessage(any,DOMString,[object Object]) assert_equals: property should be writable if and only if not unforgeable expected true but got false
-FAIL Window interface: operation captureEvents() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation releaseEvents() desc is not an Object. (evaluating '"get" in desc')
+PASS Window interface: operation alert()
+PASS Window interface: operation confirm(DOMString)
+PASS Window interface: operation prompt(DOMString,DOMString)
+PASS Window interface: operation print()
+PASS Window interface: operation showModalDialog(DOMString,any)
+PASS Window interface: operation postMessage(any,DOMString,[object Object])
+PASS Window interface: operation captureEvents()
+PASS Window interface: operation releaseEvents()
PASS Window interface: attribute onabort
FAIL Window interface: attribute onautocomplete assert_own_property: The global object must have a property "onautocomplete" expected property "onautocomplete" missing
FAIL Window interface: attribute onautocompleteerror assert_own_property: The global object must have a property "onautocompleteerror" expected property "onautocompleteerror" missing
@@ -3924,14 +3924,14 @@
PASS Window interface: attribute onpopstate
PASS Window interface: attribute onstorage
PASS Window interface: attribute onunload
-FAIL Window interface: operation btoa(DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation atob(DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setTimeout(Function,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setTimeout(DOMString,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation clearTimeout(long) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setInterval(Function,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setInterval(DOMString,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation clearInterval(long) desc is not an Object. (evaluating '"get" in desc')
+PASS Window interface: operation btoa(DOMString)
+PASS Window interface: operation atob(DOMString)
+PASS Window interface: operation setTimeout(Function,long,any)
+PASS Window interface: operation setTimeout(DOMString,long,any)
+PASS Window interface: operation clearTimeout(long)
+PASS Window interface: operation setInterval(Function,long,any)
+PASS Window interface: operation setInterval(DOMString,long,any)
+PASS Window interface: operation clearInterval(long)
FAIL Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long) assert_own_property: global object missing non-static operation expected property "createImageBitmap" missing
PASS Window interface: attribute sessionStorage
PASS Window interface: attribute localStorage
@@ -4142,11 +4142,15 @@
PASS Location interface: window.location must have own property "pathname"
PASS Location interface: window.location must have own property "search"
PASS Location interface: window.location must have own property "hash"
-FAIL Location interface: window.location must have own property "assign" assert_own_property: Doesn't have the unforgeable operation property expected property "assign" missing
-FAIL Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property "assign" missing
-FAIL Location interface: window.location must have own property "replace" assert_own_property: Doesn't have the unforgeable operation property expected property "replace" missing
-FAIL Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property "replace" missing
-FAIL Location interface: window.location must have own property "reload" assert_own_property: Doesn't have the unforgeable operation property expected property "reload" missing
+FAIL Location interface: window.location must have own property "assign" assert_equals: property should be writable if and only if not unforgeable expected false but got true
+FAIL Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+ [native code]
+}" did not throw
+FAIL Location interface: window.location must have own property "replace" assert_equals: property should be writable if and only if not unforgeable expected false but got true
+FAIL Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+ [native code]
+}" did not throw
+FAIL Location interface: window.location must have own property "reload" assert_equals: property should be writable if and only if not unforgeable expected false but got true
PASS Location interface: window.location must have own property "ancestorOrigins"
PASS PopStateEvent interface: existence and properties of interface object
PASS PopStateEvent interface object length
Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt (196647 => 196648)
--- trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt 2016-02-16 20:23:02 UTC (rev 196648)
@@ -71,6 +71,10 @@
returnValue
cancelBubble
clipboardData
+ stopPropagation
+ preventDefault
+ initEvent
+ stopImmediatePropagation
NONE
CAPTURING_PHASE
AT_TARGET
@@ -91,10 +95,6 @@
BLUR
SELECT
CHANGE
- stopPropagation
- preventDefault
- initEvent
- stopImmediatePropagation
toString
toLocaleString
valueOf
Modified: trunk/Source/_javascript_Core/ChangeLog (196647 => 196648)
--- trunk/Source/_javascript_Core/ChangeLog 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-02-16 20:23:02 UTC (rev 196648)
@@ -1,3 +1,27 @@
+2016-02-16 Chris Dumez <[email protected]>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ Reviewed by Gavin Barraclough.
+
+ Have putEntry() take a thisValue parameter in addition to the base,
+ instead of relying on PropertySlot::thisValue() because this did not
+ always do the right thing. In particular, when JSDOMWindow::put() was
+ called to set a function, it would end up setting the new value on the
+ JSDOMWindowShell instead of the actual JSDOMWindow.
+ JSDOMWindow::getOwnPropertySlot() would then not be able to find it.
+ Therefore the following would fail:
+ $ window.open = "test"
+ $ console.log(window.open) // prints the native function instead of "test"
+
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::putInlineSlow):
+ * runtime/Lookup.h:
+ (JSC::putEntry):
+ (JSC::lookupPut):
+
2016-02-16 Keith Miller <[email protected]>
ClonedArguments should not materialize its special properties unless they are being changed or deleted
Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (196647 => 196648)
--- trunk/Source/_javascript_Core/runtime/JSObject.cpp 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp 2016-02-16 20:23:02 UTC (rev 196648)
@@ -416,7 +416,7 @@
if (!obj->staticFunctionsReified()) {
if (obj->classInfo()->hasStaticSetterOrReadonlyProperties()) {
if (auto* entry = obj->findPropertyHashEntry(propertyName)) {
- putEntry(exec, entry, obj, propertyName, value, slot);
+ putEntry(exec, entry, obj, this, propertyName, value, slot);
return;
}
}
Modified: trunk/Source/_javascript_Core/runtime/Lookup.h (196647 => 196648)
--- trunk/Source/_javascript_Core/runtime/Lookup.h 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/_javascript_Core/runtime/Lookup.h 2016-02-16 20:23:02 UTC (rev 196648)
@@ -268,18 +268,21 @@
return true;
}
-inline void putEntry(ExecState* exec, const HashTableValue* entry, JSObject* base, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
+// 'base' means the object holding the property (possibly in the prototype chain of the object put was called on).
+// 'thisValue' is the object that put is being applied to (in the case of a proxy, the proxy target).
+// 'slot.thisValue()' is the object the put was originally performed on (in the case of a proxy, the proxy itself).
+inline void putEntry(ExecState* exec, const HashTableValue* entry, JSObject* base, JSObject* thisValue, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
// If this is a function put it as an override property.
if (entry->attributes() & BuiltinOrFunction) {
- if (JSObject* thisObject = jsDynamicCast<JSObject*>(slot.thisValue()))
+ if (JSObject* thisObject = jsDynamicCast<JSObject*>(thisValue))
thisObject->putDirect(exec->vm(), propertyName, value);
} else if (entry->attributes() & Accessor) {
if (slot.isStrictMode())
throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
} else if (!(entry->attributes() & ReadOnly)) {
- JSValue thisValue = entry->attributes() & CustomAccessor ? slot.thisValue() : JSValue(base);
- entry->propertyPutter()(exec, JSValue::encode(thisValue), JSValue::encode(value));
+ JSValue updateThisValue = entry->attributes() & CustomAccessor ? slot.thisValue() : JSValue(base);
+ entry->propertyPutter()(exec, JSValue::encode(updateThisValue), JSValue::encode(value));
if (entry->attributes() & CustomAccessor)
slot.setCustomAccessor(base, entry->propertyPutter());
else
@@ -300,7 +303,7 @@
if (!entry)
return false;
- putEntry(exec, entry, base, propertyName, value, slot);
+ putEntry(exec, entry, base, base, propertyName, value, slot);
return true;
}
Modified: trunk/Source/WebCore/ChangeLog (196647 => 196648)
--- trunk/Source/WebCore/ChangeLog 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/ChangeLog 2016-02-16 20:23:02 UTC (rev 196648)
@@ -1,3 +1,50 @@
+2016-02-16 Chris Dumez <[email protected]>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ Reviewed by Gavin Barraclough.
+
+ Operations should be on the instance for global objects or if
+ [Unforgeable] as per the Web IDL specification:
+ - http://heycam.github.io/webidl/#es-operations
+ - http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface
+
+ This patch implements this behavior in order to align
+ with the specification and other browsers.
+
+ No new tests, already covered by existing tests.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
+ Update function names now that they have "Instance" in their
+ name instead of "Prototype".
+
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ - Update function names now that they have "Instance" in their
+ name instead of "Prototype".
+ - Move the functions hard-coding *before* the static table check
+ now that these functions are in the static table to maintain
+ the previous behavior.
+
+ * bindings/js/JSLocationCustom.cpp:
+ (WebCore::JSLocation::getOwnPropertySlotDelegate):
+ Update function names now that they have "Instance" in their
+ name instead of "Prototype".
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ - Move functions to the instance if their interface is a global
+ object or if they are marked as [Unforgeable]. Operations are
+ now treated more like attributes, as they can now be either on
+ the instance or the prototype. In a lot of places, I now use
+ the naming "properties" instead of "attributes" as "properties"
+ refer both "attributes" and "operations" / "functions".
+
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ Rebaseline bindings tests.
+
2016-02-16 Simon Fraser <[email protected]>
Rollout r188659. This broke scrolling of iframes and overflow when
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (196647 => 196648)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-02-16 20:23:02 UTC (rev 196648)
@@ -109,7 +109,7 @@
return true;
}
if (propertyName == exec->propertyNames().close) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
return true;
}
@@ -122,19 +122,19 @@
// These are the functions we allow access to cross-origin (DoNotCheckSecurity in IDL).
// Always provide the original function, on a fresh uncached function object.
if (propertyName == exec->propertyNames().blur) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>);
return true;
}
if (propertyName == exec->propertyNames().close) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
return true;
}
if (propertyName == exec->propertyNames().focus) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
return true;
}
if (propertyName == exec->propertyNames().postMessage) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
return true;
}
@@ -258,31 +258,36 @@
// FIXME: we should probably be able to use getStaticPropertySlot here.
if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
return true;
- if (!thisObject->staticFunctionsReified()) {
- if (auto* entry = JSDOMWindow::info()->staticPropHashTable->entry(propertyName)) {
- slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
- return true;
- }
- }
+
// FIXME: These are all bogus. Keeping these here make some tests pass that check these properties
// are own properties of the window, but introduces other problems instead (e.g. if you overwrite
// & delete then the original value is restored!) Should be removed.
if (propertyName == exec->propertyNames().blur) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>);
return true;
}
if (propertyName == exec->propertyNames().close) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
return true;
}
if (propertyName == exec->propertyNames().focus) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
return true;
}
if (propertyName == exec->propertyNames().postMessage) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
return true;
}
+
+ if (!thisObject->staticFunctionsReified()) {
+ if (auto* entry = JSDOMWindow::info()->staticPropHashTable->entry(propertyName)) {
+ if (entry->attributes() & BuiltinOrFunctionOrAccessor)
+ return setUpStaticFunctionSlot(exec, entry, thisObject, propertyName, slot);
+ slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
+ return true;
+ }
+ }
+
// FIXME: this looks pretty bogus. It seems highly likely that if !canShowModalDialog the
// funtion should still be present, or should be omitted entirely - present but reads as
// undefined with unspecified attributes is likely wrong.
Modified: trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp (196647 => 196648)
--- trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp 2016-02-16 20:23:02 UTC (rev 196648)
@@ -50,15 +50,15 @@
// Check for the few functions that we allow, even when called cross-domain.
// Make these read-only / non-configurable to prevent writes via defineProperty.
if (propertyName == exec->propertyNames().replace) {
- slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationPrototypeFunctionReplace, 1>);
+ slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationInstanceFunctionReplace, 1>);
return true;
}
if (propertyName == exec->propertyNames().reload) {
- slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationPrototypeFunctionReload, 0>);
+ slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationInstanceFunctionReload, 0>);
return true;
}
if (propertyName == exec->propertyNames().assign) {
- slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationPrototypeFunctionAssign, 1>);
+ slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationInstanceFunctionAssign, 1>);
return true;
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (196647 => 196648)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-02-16 20:23:02 UTC (rev 196648)
@@ -3,7 +3,7 @@
# Copyright (C) 2006 Anders Carlsson <[email protected]>
# Copyright (C) 2006, 2007 Samuel Weinig <[email protected]>
# Copyright (C) 2006 Alexey Proskuryakov <[email protected]>
-# Copyright (C) 2006, 2007-2010, 2013-2105 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007-2010, 2013-2016 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <[email protected]>
# Copyright (C) Research In Motion Limited 2010. All rights reserved.
# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
@@ -383,7 +383,7 @@
sub GenerateGetOwnPropertySlotBody
{
- my ($interface, $interfaceName, $className, $hasAttributes, $inlined) = @_;
+ my ($interface, $interfaceName, $className, $hasInstanceProperties, $inlined) = @_;
my $namespaceMaybe = ($inlined ? "JSC::" : "");
my $namedGetterFunction = GetNamedGetterFunction($interface);
@@ -392,12 +392,12 @@
my @getOwnPropertySlotImpl = ();
my $ownPropertyCheck = sub {
- if ($hasAttributes) {
- if ($inlined) {
- push(@getOwnPropertySlotImpl, " if (${namespaceMaybe}getStaticValueSlot<$className, Base>(state, *info()->staticPropHashTable, thisObject, propertyName, slot))\n");
- } else {
- push(@getOwnPropertySlotImpl, " if (${namespaceMaybe}getStaticValueSlot<$className, Base>(state, ${className}Table, thisObject, propertyName, slot))\n");
- }
+ if ($hasInstanceProperties) {
+ my $instanceFunctionCount = InstanceFunctionCount($interface);
+ # If there are functions on the instance, then call getStaticPropertySlot() instead of getStaticValueSlot().
+ my $staticPropertyGetFunction = $namespaceMaybe . ($instanceFunctionCount eq 0 ? "getStaticValueSlot" : "getStaticPropertySlot");
+ my $staticPropertyTable = $inlined ? "*info()->staticPropHashTable" : "${className}Table";
+ push(@getOwnPropertySlotImpl, " if ($staticPropertyGetFunction<$className, Base>(state, ${staticPropertyTable}, thisObject, propertyName, slot))\n");
} else {
push(@getOwnPropertySlotImpl, " if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n");
}
@@ -605,7 +605,7 @@
return GetJSBuiltinFunctionName($className, $function);
}
- my $kind = $function->isStatic ? "Constructor" : "Prototype";
+ my $kind = $function->isStatic ? "Constructor" : (OperationShouldBeOnInstance($interface, $function) ? "Instance" : "Prototype");
return $codeGenerator->WK_lcfirst($className) . $kind . "Function" . $codeGenerator->WK_ucfirst($function->signature->name);
}
@@ -729,6 +729,24 @@
return 0;
}
+# https://heycam.github.io/webidl/#es-operations
+sub OperationShouldBeOnInstance
+{
+ my $interface = shift;
+ my $function = shift;
+
+ # FIXME: The bindings generator does not support putting runtime-enabled on the instance yet.
+ return 0 if $function->signature->extendedAttributes->{"EnabledAtRuntime"};
+
+ return 1 if IsDOMGlobalObject($interface);
+
+ # [Unforgeable] operations should be on the instance.
+ # https://heycam.github.io/webidl/#Unforgeable
+ return 1 if $function->signature->extendedAttributes->{"Unforgeable"} || $interface->extendedAttributes->{"Unforgeable"};
+
+ return 0;
+}
+
sub GetIndexedGetterFunction
{
my $interface = shift;
@@ -741,32 +759,58 @@
return GetSpecialAccessorFunctionForType($interface, "getter", "DOMString", 1);
}
-sub InstanceAttributeCount
+sub InstanceFunctionCount
{
my $interface = shift;
my $count = 0;
+
+ foreach my $function (@{$interface->functions}) {
+ $count++ if OperationShouldBeOnInstance($interface, $function);
+ }
+
+ return $count;
+}
+
+sub PrototypeFunctionCount
+{
+ my $interface = shift;
+ my $count = 0;
+
+ foreach my $function (@{$interface->functions}) {
+ $count++ if !$function->isStatic && !OperationShouldBeOnInstance($interface, $function);
+ }
+
+ return $count;
+}
+
+sub InstancePropertyCount
+{
+ my $interface = shift;
+ my $count = 0;
foreach my $attribute (@{$interface->attributes}) {
- $count = $count + AttributeShouldBeOnInstance($interface, $attribute);
+ $count++ if AttributeShouldBeOnInstance($interface, $attribute);
}
- $count = $count + 1 if ConstructorShouldBeOnInstance($interface);
+ $count += InstanceFunctionCount($interface);
+ $count++ if ConstructorShouldBeOnInstance($interface);
return $count;
}
-sub PrototypeAttributeCount
+sub PrototypePropertyCount
{
my $interface = shift;
my $count = 0;
foreach my $attribute (@{$interface->attributes}) {
- $count = $count + 1 if !AttributeShouldBeOnInstance($interface, $attribute);
+ $count++ if !AttributeShouldBeOnInstance($interface, $attribute);
}
- $count = $count + 1 if !ConstructorShouldBeOnInstance($interface);
+ $count += PrototypeFunctionCount($interface);
+ $count++ if !ConstructorShouldBeOnInstance($interface);
return $count;
}
sub InstanceOverridesGetOwnPropertySlot
{
my $interface = shift;
- my $numInstanceAttributes = InstanceAttributeCount($interface);
+ my $numInstanceProperties = InstancePropertyCount($interface);
my $namedGetterFunction = GetNamedGetterFunction($interface);
my $indexedGetterFunction = GetIndexedGetterFunction($interface);
@@ -779,17 +823,16 @@
|| $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}
|| $hasNamedGetter;
- return $numInstanceAttributes > 0 || $hasComplexGetter;
+ return $numInstanceProperties > 0 || $hasComplexGetter;
}
sub PrototypeOverridesGetOwnPropertySlot
{
my $interface = shift;
- my $numPrototypeAttributes = PrototypeAttributeCount($interface);
+ my $numPrototypeProperties = PrototypePropertyCount($interface);
my $numConstants = @{$interface->constants};
- my $numFunctions = @{$interface->functions};
- return $numFunctions > 0 || $numConstants > 0 || $numPrototypeAttributes > 0;
+ return $numConstants > 0 || $numPrototypeProperties > 0;
}
sub InstanceOverridesPutImplementation
@@ -944,7 +987,7 @@
push(@headerContent, " static const bool needsDestruction = false;\n\n");
}
- my $hasStaticPropertyTable = InstanceAttributeCount($interface) > 0 ? "true" : "false";
+ my $hasStaticPropertyTable = InstancePropertyCount($interface) > 0 ? "true" : "false";
push(@headerContent, " static const bool hasStaticPropertyTable = $hasStaticPropertyTable;\n\n");
# Prototype
@@ -1335,27 +1378,21 @@
}
}
-sub GenerateAttributesHashTable
+sub GeneratePropertiesHashTable
{
- my ($object, $interface, $isInstance, $hashKeys, $hashSpecials, $hashValue1, $hashValue2, $conditionals, $entries) = @_;
+ my ($object, $interface, $isInstance, $hashKeys, $hashSpecials, $hashValue1, $hashValue2, $conditionals, $runtimeEnabledFunctions) = @_;
# FIXME: These should be functions on $interface.
my $interfaceName = $interface->name;
my $className = "JS$interfaceName";
- # - Add all attributes in a hashtable definition
- my $numAttributes = 0;
- if ($isInstance) {
- $numAttributes = InstanceAttributeCount($interface);
- } else {
- $numAttributes = PrototypeAttributeCount($interface);
- }
+ # - Add all properties in a hashtable definition
+ my $propertyCount = $isInstance ? InstancePropertyCount($interface) : PrototypePropertyCount($interface);
-
if (ConstructorShouldBeOnInstance($interface) == $isInstance) {
if (NeedsConstructorProperty($interface)) {
- die if !$numAttributes;
+ die if !$propertyCount;
push(@$hashKeys, "constructor");
my $getter = "js" . $interfaceName . "Constructor";
push(@$hashValue1, $getter);
@@ -1366,7 +1403,7 @@
}
}
- return 0 if !$numAttributes;
+ return 0 if !$propertyCount;
foreach my $attribute (@{$interface->attributes}) {
next if ($attribute->isStatic);
@@ -1403,7 +1440,37 @@
}
}
- return $numAttributes;
+ foreach my $function (@{$interface->functions}) {
+ next if ($function->signature->extendedAttributes->{"Private"});
+ next if ($function->isStatic);
+ next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
+ next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
+ my $name = $function->signature->name;
+ push(@$hashKeys, $name);
+
+ my $functionName = GetFunctionName($interface, $className, $function);
+ push(@$hashValue1, $functionName);
+
+ my $functionLength = GetFunctionLength($function);
+ push(@$hashValue2, $functionLength);
+
+ push(@$hashSpecials, ComputeFunctionSpecial($interface, $function));
+
+ my $conditional = $function->signature->extendedAttributes->{"Conditional"};
+ if ($conditional) {
+ $conditionals->{$name} = $conditional;
+ }
+
+ if ($function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
+ if ($isInstance) {
+ die "We currently do not support [EnabledAtRuntime] operations on the instance.";
+ } else {
+ push(@$runtimeEnabledFunctions, $function);
+ }
+ }
+ }
+
+ return $propertyCount;
}
sub GenerateParametersCheckExpression
@@ -1533,7 +1600,7 @@
# overload is applicable, precedence is given according to the order of
# declaration in the IDL.
- my $kind = $function->isStatic ? "Constructor" : "Prototype";
+ my $kind = $function->isStatic ? "Constructor" : (OperationShouldBeOnInstance($interface, $function) ? "Instance" : "Prototype");
my $functionName = "js${interfaceName}${kind}Function" . $codeGenerator->WK_ucfirst($function->signature->name);
# FIXME: Implement support for overloaded functions with variadic arguments.
@@ -1864,18 +1931,20 @@
my @hashSpecials = ();
my %conditionals = ();
my $hashName = $className . "Table";
+ my @runtimeEnabledFunctions = ();
- my $numInstanceAttributes = GenerateAttributesHashTable($object, $interface, 1,
+ # Generate hash table for properties on the instance.
+ my $numInstanceProperties = GeneratePropertiesHashTable($object, $interface, 1,
\@hashKeys, \@hashSpecials,
\@hashValue1, \@hashValue2,
- \%conditionals);
+ \%conditionals, \@runtimeEnabledFunctions);
- $object->GenerateHashTable($hashName, $numInstanceAttributes,
+ $object->GenerateHashTable($hashName, $numInstanceProperties,
\@hashKeys, \@hashSpecials,
\@hashValue1, \@hashValue2,
- \%conditionals, 0) if $numInstanceAttributes > 0;
+ \%conditionals, 0) if $numInstanceProperties > 0;
- # - Add all constants
+ # - Add all interface object (aka constructor) properties (constants, static attributes, static operations).
if (NeedsConstructorProperty($interface)) {
my $hashSize = 0;
my $hashName = $className . "ConstructorTable";
@@ -1981,13 +2050,14 @@
@hashValue2 = ();
@hashSpecials = ();
%conditionals = ();
+ @runtimeEnabledFunctions = ();
-
- my $numPrototypeAttributes = GenerateAttributesHashTable($object, $interface, 0,
+ # Generate hash table for properties on the prototype.
+ my $numPrototypeProperties = GeneratePropertiesHashTable($object, $interface, 0,
\@hashKeys, \@hashSpecials,
\@hashValue1, \@hashValue2,
- \%conditionals);
- my $hashSize = $numPrototypeAttributes;
+ \%conditionals, \@runtimeEnabledFunctions);
+ my $hashSize = $numPrototypeProperties;
foreach my $constant (@{$interface->constants}) {
my $name = $constant->name;
@@ -2005,33 +2075,6 @@
$hashSize++;
}
- my @runtimeEnabledFunctions = ();
-
- foreach my $function (@{$interface->functions}) {
- next if ($function->signature->extendedAttributes->{"Private"});
- next if ($function->isStatic);
- next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
- my $name = $function->signature->name;
- push(@hashKeys, $name);
-
- my $functionName = GetFunctionName($interface, $className, $function);
- push(@hashValue1, $functionName);
-
- my $functionLength = GetFunctionLength($function);
- push(@hashValue2, $functionLength);
-
- push(@hashSpecials, ComputeFunctionSpecial($interface, $function));
-
- my $conditional = $function->signature->extendedAttributes->{"Conditional"};
- if ($conditional) {
- $conditionals{$name} = $conditional;
- }
-
- push(@runtimeEnabledFunctions, $function) if $function->signature->extendedAttributes->{"EnabledAtRuntime"};
-
- $hashSize++;
- }
-
my $justGenerateValueArray = !IsDOMGlobalObject($interface);
$object->GenerateHashTable($hashName, $hashSize,
@@ -2046,7 +2089,9 @@
}
if (PrototypeOverridesGetOwnPropertySlot($interface)) {
- my $numPrototypeAttributes = PrototypeAttributeCount($interface);
+ my $prototypePropertyCount = PrototypePropertyCount($interface);
+ my $prototypeFunctionCount = PrototypeFunctionCount($interface);
+ my $prototypeAttributeCount = $prototypePropertyCount - $prototypeFunctionCount;
if (IsDOMGlobalObject($interface)) {
push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
push(@implContent, "{\n");
@@ -2054,17 +2099,17 @@
push(@implContent, " UNUSED_PARAM(vm);\n");
push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(object);\n");
- if ($numConstants eq 0 && $numFunctions eq 0 && $numPrototypeAttributes eq 0) {
+ if ($numConstants eq 0 && $prototypePropertyCount eq 0) {
push(@implContent, " return Base::getOwnPropertySlot(thisObject, state, propertyName, slot);\n");
- } elsif ($numConstants eq 0 && $numPrototypeAttributes eq 0) {
+ } elsif ($numConstants eq 0 && $prototypeAttributeCount eq 0) {
push(@implContent, " return getStaticFunctionSlot<JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
- } elsif ($numFunctions eq 0 && $numPrototypeAttributes eq 0) {
+ } elsif ($prototypePropertyCount eq 0) {
push(@implContent, " return getStaticValueSlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
} else {
push(@implContent, " return getStaticPropertySlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
}
push(@implContent, "}\n\n");
- } elsif ($numConstants > 0 || $numFunctions > 0 || $numPrototypeAttributes > 0) {
+ } elsif ($numConstants > 0 || $numPrototypeProperties > 0) {
push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
push(@implContent, "{\n");
push(@implContent, " Base::finishCreation(vm);\n");
@@ -2115,7 +2160,7 @@
# - Initialize static ClassInfo object
push(@implContent, "const ClassInfo $className" . "::s_info = { \"${visibleInterfaceName}\", &Base::s_info, ");
- if ($numInstanceAttributes > 0) {
+ if ($numInstanceProperties > 0) {
push(@implContent, "&${className}Table");
} else {
push(@implContent, "0");
@@ -2184,7 +2229,7 @@
push(@implContent, "{\n");
push(@implContent, " auto* thisObject = jsCast<${className}*>(object);\n");
push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
- push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceAttributes > 0, 0));
+ push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceProperties > 0, 0));
push(@implContent, "}\n\n");
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (196647 => 196648)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-02-16 20:23:02 UTC (rev 196648)
@@ -323,57 +323,57 @@
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
#if ENABLE(Condition22) || ENABLE(Condition23)
- { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+ { "implementsMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
#if ENABLE(Condition22) || ENABLE(Condition23)
- { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+ { "implementsMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
-#if ENABLE(Condition11) || ENABLE(Condition12)
- { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+#if ENABLE(Condition22) || ENABLE(Condition23)
+ { "implementsMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
- { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+ { "supplementalMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
-#if ENABLE(Condition22) || ENABLE(Condition23)
- { "implementsMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } },
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
-#if ENABLE(Condition22) || ENABLE(Condition23)
- { "implementsMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } },
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
-#if ENABLE(Condition22) || ENABLE(Condition23)
- { "implementsMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } },
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "builtinFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
-#if ENABLE(Condition11) || ENABLE(Condition12)
- { "supplementalMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } },
+#if ENABLE(Condition22) || ENABLE(Condition23)
+ { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
-#if ENABLE(Condition11) || ENABLE(Condition12)
- { "supplementalMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } },
+#if ENABLE(Condition22) || ENABLE(Condition23)
+ { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
- { "supplementalMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } },
+ { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
- { "builtinFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } },
+ { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
#else
{ 0, 0, NoIntrinsic, { 0, 0 } },
#endif
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (196647 => 196648)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-02-16 20:23:02 UTC (rev 196648)
@@ -588,23 +588,6 @@
{ "attributeWithReservedEnumType", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithReservedEnumType) } },
{ "putForwardsAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsAttribute) } },
{ "putForwardsNullableAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsNullableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsNullableAttribute) } },
-#if ENABLE(Condition1)
- { "CONDITIONAL_CONST", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
-#else
- { 0, 0, NoIntrinsic, { 0, 0 } },
-#endif
- { "CONST_VALUE_0", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
- { "CONST_VALUE_1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
- { "CONST_VALUE_2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
- { "CONST_VALUE_4", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } },
- { "CONST_VALUE_8", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } },
- { "CONST_VALUE_9", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(-1) } },
- { "CONST_VALUE_11", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0xffffffff) } },
- { "CONST_VALUE_12", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x01) } },
- { "CONST_VALUE_13", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0X20) } },
- { "CONST_VALUE_14", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x1abc) } },
- { "CONST_JAVASCRIPT", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
- { "readonly", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
{ "voidMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t) (0) } },
{ "voidMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t) (3) } },
{ "byteMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethod), (intptr_t) (0) } },
@@ -705,6 +688,23 @@
{ "testPromiseFunctionWithFloatArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument), (intptr_t) (1) } },
{ "testPromiseFunctionWithException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithException), (intptr_t) (0) } },
{ "testPromiseFunctionWithOptionalIntArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument), (intptr_t) (0) } },
+#if ENABLE(Condition1)
+ { "CONDITIONAL_CONST", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
+#else
+ { 0, 0, NoIntrinsic, { 0, 0 } },
+#endif
+ { "CONST_VALUE_0", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
+ { "CONST_VALUE_1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+ { "CONST_VALUE_2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+ { "CONST_VALUE_4", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } },
+ { "CONST_VALUE_8", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } },
+ { "CONST_VALUE_9", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(-1) } },
+ { "CONST_VALUE_11", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0xffffffff) } },
+ { "CONST_VALUE_12", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x01) } },
+ { "CONST_VALUE_13", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0X20) } },
+ { "CONST_VALUE_14", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x1abc) } },
+ { "CONST_JAVASCRIPT", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
+ { "readonly", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
};
const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };