X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..refs/heads/master:/runtime/StringObject.cpp diff --git a/runtime/StringObject.cpp b/runtime/StringObject.cpp index a5e23f7..eb7430e 100644 --- a/runtime/StringObject.cpp +++ b/runtime/StringObject.cpp @@ -30,7 +30,7 @@ namespace JSC { STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(StringObject); -const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(StringObject) }; +const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, CREATE_METHOD_TABLE(StringObject) }; StringObject::StringObject(VM& vm, Structure* structure) : JSWrapperObject(vm, structure) @@ -93,7 +93,7 @@ bool StringObject::defineOwnProperty(JSObject* object, ExecState* exec, Property } if (descriptor.configurablePresent() && descriptor.configurable()) { if (throwException) - exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to configurable attribute of unconfigurable property."))); + exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to change configurable attribute of unconfigurable property."))); return false; } if (descriptor.enumerablePresent() && descriptor.enumerable()) { @@ -128,9 +128,8 @@ bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName pr StringObject* thisObject = jsCast(cell); if (propertyName == exec->propertyNames().length) return false; - unsigned i = propertyName.asIndex(); - if (thisObject->internalValue()->canGetIndex(i)) { - ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail! + Optional index = parseIndex(propertyName); + if (index && thisObject->internalValue()->canGetIndex(index.value())) { return false; } return JSObject::deleteProperty(thisObject, exec, propertyName); @@ -150,7 +149,7 @@ void StringObject::getOwnPropertyNames(JSObject* object, ExecState* exec, Proper int size = thisObject->internalValue()->length(); for (int i = 0; i < size; ++i) propertyNames.add(Identifier::from(exec, i)); - if (mode == IncludeDontEnumProperties) + if (mode.includeDontEnumProperties()) propertyNames.add(exec->propertyNames().length); return JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode); }