-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON.parse(), JSON.stringify() more specific declarations for #6955 #28270
JSON.parse(), JSON.stringify() more specific declarations for #6955 #28270
Conversation
Shouldn't |
Ah, yes. That makes sense. Personally, I'm in favour of it now that you've pointed it out but I think it might break code for a lot of people. [EDIT] To elaborate, I think changing it to But I'm not sure how the TS team feels about such a change. |
lib/lib.es5.d.ts
Outdated
/** | ||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string. | ||
* @param value A JavaScript value, usually an object or array, to be converted. | ||
* @param replacer A function that transforms the results. | ||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. | ||
*/ | ||
stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; | ||
stringify(value: any, replacer?: (this : any, key: string, value: any) => any, space?: string | number): string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the stray space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to merge after Monday
@typescript-bot test this please |
Heya @RyanCavanaugh, I've started to run the extended test suite on this PR at dd3ed02. You can monitor the build here. It should now contribute to this PR's status checks. |
Nothing relevant in RWC, GTG |
Fixes #6955
I made a few comments in that issue about being unclear about how the whole PR process works,
And it seems I broke 5 tests,
I assume it's because they are expecting the previous signature for
JSON.parse()
andJSON.stringify()
but I've changed them.I'm not sure how to read the output files in
tests/baselines/local
and decide if they're okay tobaseline-accept
(which I assume updates the expected results) but I made a best-effort attempt to look through them and they seemed okay to me.