summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/StringObject.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/StringObject.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/StringObject.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/StringObject.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/JavaScriptCore/runtime/StringObject.cpp b/Source/JavaScriptCore/runtime/StringObject.cpp
index b5aa3f72d..440a60942 100644
--- a/Source/JavaScriptCore/runtime/StringObject.cpp
+++ b/Source/JavaScriptCore/runtime/StringObject.cpp
@@ -23,14 +23,14 @@
#include "Error.h"
#include "JSGlobalObject.h"
-#include "JSCInlines.h"
+#include "Operations.h"
#include "PropertyNameArray.h"
namespace JSC {
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(StringObject);
-const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, CREATE_METHOD_TABLE(StringObject) };
+const ClassInfo StringObject::s_info = { "String", &JSWrapperObject::s_info, 0, 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 change configurable attribute of unconfigurable property.")));
+ exec->vm().throwException(exec, createTypeError(exec, ASCIILiteral("Attempting to configurable attribute of unconfigurable property.")));
return false;
}
if (descriptor.enumerablePresent() && descriptor.enumerable()) {
@@ -128,8 +128,9 @@ bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, PropertyName pr
StringObject* thisObject = jsCast<StringObject*>(cell);
if (propertyName == exec->propertyNames().length)
return false;
- Optional<uint32_t> index = parseIndex(propertyName);
- if (index && thisObject->internalValue()->canGetIndex(index.value())) {
+ 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!
return false;
}
return JSObject::deleteProperty(thisObject, exec, propertyName);
@@ -146,12 +147,10 @@ bool StringObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned
void StringObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
StringObject* thisObject = jsCast<StringObject*>(object);
- if (propertyNames.includeStringProperties()) {
- int size = thisObject->internalValue()->length();
- for (int i = 0; i < size; ++i)
- propertyNames.add(Identifier::from(exec, i));
- }
- if (mode.includeDontEnumProperties())
+ int size = thisObject->internalValue()->length();
+ for (int i = 0; i < size; ++i)
+ propertyNames.add(Identifier::from(exec, i));
+ if (mode == IncludeDontEnumProperties)
propertyNames.add(exec->propertyNames().length);
return JSObject::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}