void JSCell::put(JSCell* cell, ExecState* exec, PropertyName identifier, JSValue value, PutPropertySlot& slot)
{
- if (cell->isString()) {
+ if (cell->isString() || cell->isSymbol()) {
JSValue(cell).putToPrimitive(exec, identifier, value, slot);
return;
}
void JSCell::putByIndex(JSCell* cell, ExecState* exec, unsigned identifier, JSValue value, bool shouldThrow)
{
- if (cell->isString()) {
+ if (cell->isString() || cell->isSymbol()) {
PutPropertySlot slot(cell, shouldThrow);
JSValue(cell).putToPrimitive(exec, Identifier::from(exec, identifier), value, slot);
return;
{
if (isString())
return static_cast<const JSString*>(this)->toPrimitive(exec, preferredType);
+ if (isSymbol())
+ return static_cast<const Symbol*>(this)->toPrimitive(exec, preferredType);
return static_cast<const JSObject*>(this)->toPrimitive(exec, preferredType);
}
{
if (isString())
return static_cast<const JSString*>(this)->getPrimitiveNumber(exec, number, value);
+ if (isSymbol())
+ return static_cast<const Symbol*>(this)->getPrimitiveNumber(exec, number, value);
return static_cast<const JSObject*>(this)->getPrimitiveNumber(exec, number, value);
}
{
if (isString())
return static_cast<const JSString*>(this)->toNumber(exec);
+ if (isSymbol())
+ return static_cast<const Symbol*>(this)->toNumber(exec);
return static_cast<const JSObject*>(this)->toNumber(exec);
}
{
if (isString())
return static_cast<const JSString*>(this)->toObject(exec, globalObject);
+ if (isSymbol())
+ return static_cast<const Symbol*>(this)->toObject(exec, globalObject);
ASSERT(isObject());
return jsCast<JSObject*>(const_cast<JSCell*>(this));
}
return 0;
}
+uint32_t JSCell::getEnumerableLength(ExecState*, JSObject*)
+{
+ RELEASE_ASSERT_NOT_REACHED();
+ return 0;
+}
+
+void JSCell::getStructurePropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode)
+{
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
+void JSCell::getGenericPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode)
+{
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
} // namespace JSC