Changeset 44974 in webkit for trunk/JavaScriptCore/runtime/JSONObject.cpp
- Timestamp:
- Jun 22, 2009, 10:44:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSONObject.cpp
r44968 r44974 27 27 #include "JSONObject.h" 28 28 29 #include "BooleanObject.h" 29 30 #include "Error.h" 30 31 #include "ExceptionHelpers.h" … … 120 121 // ------------------------------ helper functions -------------------------------- 121 122 122 static inline JSValue unwrap NumberOrString(JSValue value)123 static inline JSValue unwrapBoxedPrimitive(JSValue value) 123 124 { 124 125 if (!value.isObject()) 125 126 return value; 126 if (!asObject(value)->inherits(&NumberObject::info) && !asObject(value)->inherits(&StringObject::info) )127 if (!asObject(value)->inherits(&NumberObject::info) && !asObject(value)->inherits(&StringObject::info) && !asObject(value)->inherits(&BooleanObject::info)) 127 128 return value; 128 129 return static_cast<JSWrapperObject*>(asObject(value))->internalValue(); … … 131 132 static inline UString gap(JSValue space) 132 133 { 133 space = unwrap NumberOrString(space);134 space = unwrapBoxedPrimitive(space); 134 135 135 136 // If the space value is a number, create a gap string with that number of spaces. … … 356 357 } 357 358 359 value = unwrapBoxedPrimitive(value); 360 358 361 if (value.isBoolean()) { 359 362 builder.append(value.getBoolean() ? "true" : "false"); 360 363 return StringifySucceeded; 361 364 } 362 363 value = unwrapNumberOrString(value);364 365 365 366 UString stringValue;
Note:
See TracChangeset
for help on using the changeset viewer.