Changeset 47847 in webkit for trunk/JavaScriptCore
- Timestamp:
- Aug 27, 2009, 5:27:10 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r47845 r47847 1 2009-08-27 Oliver Hunt <[email protected]> 2 3 Reviewed by Adam Roben. 4 5 JSON.stringify replacer array does not accept values that are not string primitives. 6 https://bugs.webkit.org/show_bug.cgi?id=28788 7 8 Update the JSON stringifier to initialise its replacer array according to the most 9 recent version of the spec. 10 11 * runtime/Identifier.h: 12 (JSC::Identifier::from): 13 * runtime/JSONObject.cpp: 14 (JSC::Stringifier::Stringifier): 15 1 16 2009-08-27 Alexey Proskuryakov <[email protected]> 2 17 … … 53 68 * assembler/X86Assembler.h: 54 69 (JSC::CAN_SIGN_EXTEND_8_32): 70 71 2009-08-27 Oliver Hunt <[email protected]> 72 73 Reviewed by Adam Roben. 74 75 JSON.stringify replacer array does not accept values that are not string primitives. 76 https://bugs.webkit.org/show_bug.cgi?id=28788 77 78 Update the JSON stringifier to initialise its replacer array according to the most 79 recent version of the spec. 80 81 * runtime/Identifier.h: 82 (JSC::Identifier::from): 83 * runtime/JSONObject.cpp: 84 (JSC::Stringifier::Stringifier): 55 85 56 86 2009-08-27 Oliver Hunt <[email protected]> -
trunk/JavaScriptCore/runtime/Identifier.h
r44224 r47847 55 55 56 56 static Identifier from(ExecState* exec, unsigned y) { return Identifier(exec, UString::from(y)); } 57 static Identifier from(ExecState* exec, int y) { return Identifier(exec, UString::from(y)); } 58 static Identifier from(ExecState* exec, double y) { return Identifier(exec, UString::from(y)); } 57 59 58 60 bool isNull() const { return _ustring.isNull(); } -
trunk/JavaScriptCore/runtime/JSONObject.cpp
r47812 r47847 203 203 if (exec->hadException()) 204 204 break; 205 206 if (name.isObject()) { 207 if (!asObject(name)->inherits(&NumberObject::info) && !asObject(name)->inherits(&StringObject::info)) 208 continue; 209 name = static_cast<JSWrapperObject*>(asObject(name))->internalValue(); 210 } 211 205 212 UString propertyName; 206 if (!name.getString(propertyName)) 213 if (name.getString(propertyName)) { 214 m_arrayReplacerPropertyNames.add(Identifier(exec, propertyName)); 207 215 continue; 216 } 217 218 double value = 0; 219 if (name.getNumber(value)) { 220 m_arrayReplacerPropertyNames.add(Identifier::from(exec, value)); 221 continue; 222 } 223 208 224 if (exec->hadException()) 209 225 return; 210 m_arrayReplacerPropertyNames.add(Identifier(exec, propertyName));211 226 } 212 227 return;
Note:
See TracChangeset
for help on using the changeset viewer.