Diff
Modified: trunk/Source/WebCore/ChangeLog (195907 => 195908)
--- trunk/Source/WebCore/ChangeLog 2016-01-30 21:01:09 UTC (rev 195907)
+++ trunk/Source/WebCore/ChangeLog 2016-01-30 21:34:43 UTC (rev 195908)
@@ -1,5 +1,22 @@
2016-01-30 Chris Dumez <[email protected]>
+ Unreviewed, rebaseline bindings tests after r195904.
+
+ * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+ (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
+ (WebCore::jsTestCustomNamedGetterConstructor):
+ (WebCore::setJSTestCustomNamedGetterConstructor):
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ (WebCore::JSTestEventTarget::getOwnPropertySlot):
+ (WebCore::jsTestEventTargetConstructor):
+ (WebCore::setJSTestEventTargetConstructor):
+ * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+ (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
+ (WebCore::jsTestOverrideBuiltinsConstructor):
+ (WebCore::setJSTestOverrideBuiltinsConstructor):
+
+2016-01-30 Chris Dumez <[email protected]>
+
[JS Bindings] prototype.constructor should be writable
https://bugs.webkit.org/show_bug.cgi?id=149412
<rdar://problem/22545096>
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (195907 => 195908)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2016-01-30 21:01:09 UTC (rev 195907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2016-01-30 21:34:43 UTC (rev 195908)
@@ -68,20 +68,6 @@
typedef JSDOMConstructorNotConstructable<JSTestCustomNamedGetter> JSTestCustomNamedGetterConstructor;
-/* Hash table */
-
-static const struct CompactHashIndex JSTestCustomNamedGetterTableIndex[2] = {
- { -1, -1 },
- { 0, -1 },
-};
-
-
-static const HashTableValue JSTestCustomNamedGetterTableValues[] =
-{
- { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCustomNamedGetterConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCustomNamedGetterConstructor) } },
-};
-
-static const HashTable JSTestCustomNamedGetterTable = { 1, 1, true, JSTestCustomNamedGetterTableValues, JSTestCustomNamedGetterTableIndex };
template<> void JSTestCustomNamedGetterConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
{
putDirect(vm, vm.propertyNames->prototype, JSTestCustomNamedGetter::getPrototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
@@ -95,6 +81,7 @@
static const HashTableValue JSTestCustomNamedGetterPrototypeTableValues[] =
{
+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCustomNamedGetterConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestCustomNamedGetterConstructor) } },
{ "anotherFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestCustomNamedGetterPrototypeFunctionAnotherFunction), (intptr_t) (1) } },
};
@@ -106,7 +93,7 @@
reifyStaticProperties(vm, JSTestCustomNamedGetterPrototypeTableValues, *this);
}
-const ClassInfo JSTestCustomNamedGetter::s_info = { "TestCustomNamedGetter", &Base::s_info, &JSTestCustomNamedGetterTable, CREATE_METHOD_TABLE(JSTestCustomNamedGetter) };
+const ClassInfo JSTestCustomNamedGetter::s_info = { "TestCustomNamedGetter", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCustomNamedGetter) };
JSTestCustomNamedGetter::JSTestCustomNamedGetter(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestCustomNamedGetter>&& impl)
: JSDOMWrapper<TestCustomNamedGetter>(structure, globalObject, WTFMove(impl))
@@ -133,7 +120,7 @@
{
auto* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- if (getStaticValueSlot<JSTestCustomNamedGetter, Base>(state, JSTestCustomNamedGetterTable, thisObject, propertyName, slot))
+ if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
return true;
JSValue proto = thisObject->prototype();
if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
@@ -164,9 +151,9 @@
return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
}
-EncodedJSValue jsTestCustomNamedGetterConstructor(ExecState* state, JSObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue jsTestCustomNamedGetterConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
{
- JSTestCustomNamedGetter* domObject = jsDynamicCast<JSTestCustomNamedGetter*>(JSValue::decode(thisValue));
+ JSTestCustomNamedGetterPrototype* domObject = jsDynamicCast<JSTestCustomNamedGetterPrototype*>(baseValue);
if (!domObject)
return throwVMTypeError(state);
return JSValue::encode(JSTestCustomNamedGetter::getConstructor(state->vm(), domObject->globalObject()));
@@ -175,8 +162,8 @@
void setJSTestCustomNamedGetterConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
JSValue value = JSValue::decode(encodedValue);
- UNUSED_PARAM(baseValue);
- JSTestCustomNamedGetter* domObject = jsDynamicCast<JSTestCustomNamedGetter*>(JSValue::decode(thisValue));
+ UNUSED_PARAM(thisValue);
+ JSTestCustomNamedGetterPrototype* domObject = jsDynamicCast<JSTestCustomNamedGetterPrototype*>(baseValue);
if (UNLIKELY(!domObject)) {
throwVMTypeError(state);
return;
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (195907 => 195908)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2016-01-30 21:01:09 UTC (rev 195907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2016-01-30 21:34:43 UTC (rev 195908)
@@ -77,20 +77,6 @@
typedef JSDOMConstructorNotConstructable<JSTestEventTarget> JSTestEventTargetConstructor;
-/* Hash table */
-
-static const struct CompactHashIndex JSTestEventTargetTableIndex[2] = {
- { -1, -1 },
- { 0, -1 },
-};
-
-
-static const HashTableValue JSTestEventTargetTableValues[] =
-{
- { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestEventTargetConstructor) } },
-};
-
-static const HashTable JSTestEventTargetTable = { 1, 1, true, JSTestEventTargetTableValues, JSTestEventTargetTableIndex };
template<> void JSTestEventTargetConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
{
putDirect(vm, vm.propertyNames->prototype, JSTestEventTarget::getPrototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
@@ -104,6 +90,7 @@
static const HashTableValue JSTestEventTargetPrototypeTableValues[] =
{
+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestEventTargetConstructor) } },
{ "item", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionItem), (intptr_t) (1) } },
{ "addEventListener", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionAddEventListener), (intptr_t) (2) } },
{ "removeEventListener", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionRemoveEventListener), (intptr_t) (2) } },
@@ -118,7 +105,7 @@
reifyStaticProperties(vm, JSTestEventTargetPrototypeTableValues, *this);
}
-const ClassInfo JSTestEventTarget::s_info = { "TestEventTarget", &Base::s_info, &JSTestEventTargetTable, CREATE_METHOD_TABLE(JSTestEventTarget) };
+const ClassInfo JSTestEventTarget::s_info = { "TestEventTarget", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestEventTarget) };
JSTestEventTarget::JSTestEventTarget(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestEventTarget>&& impl)
: JSDOMWrapper<TestEventTarget>(structure, globalObject, WTFMove(impl))
@@ -152,7 +139,7 @@
slot.setValue(thisObject, attributes, toJS(state, thisObject->globalObject(), thisObject->wrapped().item(index)));
return true;
}
- if (getStaticValueSlot<JSTestEventTarget, Base>(state, JSTestEventTargetTable, thisObject, propertyName, slot))
+ if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
return true;
JSValue proto = thisObject->prototype();
if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))
@@ -180,9 +167,9 @@
return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
}
-EncodedJSValue jsTestEventTargetConstructor(ExecState* state, JSObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue jsTestEventTargetConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
{
- JSTestEventTarget* domObject = jsDynamicCast<JSTestEventTarget*>(JSValue::decode(thisValue));
+ JSTestEventTargetPrototype* domObject = jsDynamicCast<JSTestEventTargetPrototype*>(baseValue);
if (!domObject)
return throwVMTypeError(state);
return JSValue::encode(JSTestEventTarget::getConstructor(state->vm(), domObject->globalObject()));
@@ -191,8 +178,8 @@
void setJSTestEventTargetConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
JSValue value = JSValue::decode(encodedValue);
- UNUSED_PARAM(baseValue);
- JSTestEventTarget* domObject = jsDynamicCast<JSTestEventTarget*>(JSValue::decode(thisValue));
+ UNUSED_PARAM(thisValue);
+ JSTestEventTargetPrototype* domObject = jsDynamicCast<JSTestEventTargetPrototype*>(baseValue);
if (UNLIKELY(!domObject)) {
throwVMTypeError(state);
return;
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (195907 => 195908)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp 2016-01-30 21:01:09 UTC (rev 195907)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp 2016-01-30 21:34:43 UTC (rev 195908)
@@ -70,20 +70,6 @@
typedef JSDOMConstructorNotConstructable<JSTestOverrideBuiltins> JSTestOverrideBuiltinsConstructor;
-/* Hash table */
-
-static const struct CompactHashIndex JSTestOverrideBuiltinsTableIndex[2] = {
- { -1, -1 },
- { 0, -1 },
-};
-
-
-static const HashTableValue JSTestOverrideBuiltinsTableValues[] =
-{
- { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestOverrideBuiltinsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestOverrideBuiltinsConstructor) } },
-};
-
-static const HashTable JSTestOverrideBuiltinsTable = { 1, 1, true, JSTestOverrideBuiltinsTableValues, JSTestOverrideBuiltinsTableIndex };
template<> void JSTestOverrideBuiltinsConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
{
putDirect(vm, vm.propertyNames->prototype, JSTestOverrideBuiltins::getPrototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
@@ -97,6 +83,7 @@
static const HashTableValue JSTestOverrideBuiltinsPrototypeTableValues[] =
{
+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestOverrideBuiltinsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestOverrideBuiltinsConstructor) } },
{ "namedItem", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestOverrideBuiltinsPrototypeFunctionNamedItem), (intptr_t) (0) } },
};
@@ -108,7 +95,7 @@
reifyStaticProperties(vm, JSTestOverrideBuiltinsPrototypeTableValues, *this);
}
-const ClassInfo JSTestOverrideBuiltins::s_info = { "TestOverrideBuiltins", &Base::s_info, &JSTestOverrideBuiltinsTable, CREATE_METHOD_TABLE(JSTestOverrideBuiltins) };
+const ClassInfo JSTestOverrideBuiltins::s_info = { "TestOverrideBuiltins", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverrideBuiltins) };
JSTestOverrideBuiltins::JSTestOverrideBuiltins(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestOverrideBuiltins>&& impl)
: JSDOMWrapper<TestOverrideBuiltins>(structure, globalObject, WTFMove(impl))
@@ -142,7 +129,7 @@
return true;
}
}
- if (getStaticValueSlot<JSTestOverrideBuiltins, Base>(state, JSTestOverrideBuiltinsTable, thisObject, propertyName, slot))
+ if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
return true;
return false;
}
@@ -162,9 +149,9 @@
return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
}
-EncodedJSValue jsTestOverrideBuiltinsConstructor(ExecState* state, JSObject*, EncodedJSValue thisValue, PropertyName)
+EncodedJSValue jsTestOverrideBuiltinsConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
{
- JSTestOverrideBuiltins* domObject = jsDynamicCast<JSTestOverrideBuiltins*>(JSValue::decode(thisValue));
+ JSTestOverrideBuiltinsPrototype* domObject = jsDynamicCast<JSTestOverrideBuiltinsPrototype*>(baseValue);
if (!domObject)
return throwVMTypeError(state);
return JSValue::encode(JSTestOverrideBuiltins::getConstructor(state->vm(), domObject->globalObject()));
@@ -173,8 +160,8 @@
void setJSTestOverrideBuiltinsConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
JSValue value = JSValue::decode(encodedValue);
- UNUSED_PARAM(baseValue);
- JSTestOverrideBuiltins* domObject = jsDynamicCast<JSTestOverrideBuiltins*>(JSValue::decode(thisValue));
+ UNUSED_PARAM(thisValue);
+ JSTestOverrideBuiltinsPrototype* domObject = jsDynamicCast<JSTestOverrideBuiltinsPrototype*>(baseValue);
if (UNLIKELY(!domObject)) {
throwVMTypeError(state);
return;