From 8d473cf9743f1d30a16a27114e93bd5af5648d23 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 18 May 2012 14:03:11 +0200 Subject: Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578) Weekly snapshot --- Source/JavaScriptCore/runtime/JSString.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSString.cpp') diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp index 904cc4d3e..7faa393c3 100644 --- a/Source/JavaScriptCore/runtime/JSString.cpp +++ b/Source/JavaScriptCore/runtime/JSString.cpp @@ -257,7 +257,7 @@ JSObject* JSString::toThisObject(JSCell* cell, ExecState* exec) return StringObject::create(exec, exec->lexicalGlobalObject(), jsCast(cell)); } -bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot) +bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot) { JSString* thisObject = jsCast(cell); // The semantics here are really getPropertySlot, not getOwnPropertySlot. @@ -275,16 +275,16 @@ bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifie return true; } -bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) +bool JSString::getStringPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) { if (propertyName == exec->propertyNames().length) { descriptor.setDescriptor(jsNumber(m_length), DontEnum | DontDelete | ReadOnly); return true; } - bool isStrictUInt32; - unsigned i = propertyName.toUInt32(isStrictUInt32); - if (isStrictUInt32 && i < m_length) { + unsigned i = propertyName.asIndex(); + if (i < m_length) { + ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail! descriptor.setDescriptor(getIndex(exec, i), DontDelete | ReadOnly); return true; } -- cgit v1.2.1