JSON.stringify({remove:"me"}, function (k,v) { return k === 'remove' ? undefined : v; }) should return '{}', but returns '{"remove":null}' Per the ECMA5 spec, undefined returned from a replacer should result in omission from the resulting JSON string in the case of object properties, and null in the case of array items. Currently, null is used for both cases. r46919
<rdar://problem/7129376>
Goddammit -- fixed locally. Stupid mistake, and i was sure this worked at one point. It must have got broken when darin made this code iterative. Apparently replacer functions aren't being tested as thoroughly as might be hoped. Anyhoo, fixed locally just need to turn a build to verify that all is well, and add tests
Created attachment 34435 [details] Patch v1
Comment on attachment 34435 [details] Patch v1 > // Handle cycle detection, and put the holder on the stack. > if (!m_holderCycleDetector.add(object).second) { > - throwError(m_exec, TypeError); > + throwError(m_exec, TypeError, "JSON.stringify cannot serialise cyclic structures."); > return StringifyFailed; Should we not prefer US English?
Comment on attachment 34435 [details] Patch v1 r=me with the spelling fixed.
Committed r46967