Changeset 97827 in webkit for trunk/Source/JavaScriptCore/runtime/JSValue.cpp
- Timestamp:
- Oct 18, 2011, 7:54:29 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSValue.cpp
r94996 r97827 205 205 } 206 206 207 JSString* JSValue::toPrimitiveString(ExecState* exec) const 208 { 209 if (isString()) 210 return static_cast<JSString*>(asCell()); 211 if (isInt32()) 212 return jsString(&exec->globalData(), exec->globalData().numericStrings.add(asInt32())); 213 if (isDouble()) 214 return jsString(&exec->globalData(), exec->globalData().numericStrings.add(asDouble())); 215 if (isTrue()) 216 return jsNontrivialString(exec, exec->propertyNames().trueKeyword.ustring()); 217 if (isFalse()) 218 return jsNontrivialString(exec, exec->propertyNames().falseKeyword.ustring()); 219 if (isNull()) 220 return jsNontrivialString(exec, exec->propertyNames().nullKeyword.ustring()); 221 if (isUndefined()) 222 return jsNontrivialString(exec, exec->propertyNames().undefined.ustring()); 223 224 ASSERT(isCell()); 225 JSValue v = asCell()->toPrimitive(exec, NoPreference); 226 if (v.isString()) 227 return static_cast<JSString*>(v.asCell()); 228 return jsString(&exec->globalData(), v.toString(exec)); 229 } 230 207 231 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.