Node: JSON.stringify throw an exception when it can't properly parsing an object

Created on 20 Jun 2017  路  5Comments  路  Source: nodejs/node

Version: v6.11.0
Platform: Linux eric-ThinkPad-X220 4.8.0-36-generic #36~16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

as issue https://github.com/nodejs/node/issues/13798 has described.

JSON.stringify currently returns strange result when it encounters some special objects.

it should throw an exception instead of returning a wrong object.

duplicate question

Most helpful comment

I have to say锛寉ou foreign fellas are really patient

All 5 comments

Again, Node.js does not control how JSON operates. It's part of the ECMAScript specification -- the same specification used by JavaScript engines in browsers. You might want to report this issue to the developers of express-session.

@TimothyGu

it has nothing to do with express-session.
it is the strange result that cause problems.

it is the result is irrelevant to the object itself.

@calidion The behavior of JSON.stringify() is specified in https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3 and is not implemented by Node.js, but by the V8 engine upon which Node.js relies.

If you want to see the behavior of JSON.stringify() change in Node.js, you will have to first determine if you are asking for a change in the algorithm specification or if you believe you have found a bug in V8. If the former, you will need to take it up with TC-39 (the committee that determines the contents of the ECMAScript specification). If the latter, you will need to report in the issue tracker for the Google V8 project.

I have to say锛寉ou foreign fellas are really patient

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielstaleiny picture danielstaleiny  路  3Comments

dfahlander picture dfahlander  路  3Comments

sandeepks1 picture sandeepks1  路  3Comments

cong88 picture cong88  路  3Comments

srl295 picture srl295  路  3Comments