-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Print string versions of NaN, Infinity and -Infinity - resolves #696 #735
Conversation
That's not really what I had in mind, it's not exactly done like that in lab. I'd like to be able to substitute with the correct syntax afterwards so with simple strings it won't be enough. |
@Marsup: I'll see if I can find a reference in lab's source. |
It's in the console reporter. |
@Marsup: Thanks for the reference, I think it's better now. Do we have to handle Functions and Symbols, too? |
Ideally yes. You'll also need that post-replace I talked about. |
@Marsup Sorry about the delay. By post-replace do you mean converting the serialized values back? Do we already have a function doing this (I couldn't find one) or do I have to add it to |
The annotate function is doing that with regexps at the bottom. |
…ls.annotate Test annotate's behavior over functions
@Marsup Alright, I think this is what you want, if there are any further changes required, ask right away. |
I think the function will be a little more complex than that if you have brackets inside the code. |
Fix style-guide issues
@Marsup It seems to work as |
Then you're just lucky the function is last. |
This input: {
"x": {
"z": "[Infinity]",
"f": "[function (x) { return [ { y: 2 } ]; }]",
"u": "[-Infinity]",
"y_$key$_1_$end$_": "[NaN]"
} gives this: function (x) { return [ { y: 2 } ]; } I think that's because each property is put on a newline, which in turn counts the last bracket of function as the last bracket of the current line, if that always happens in Now another question rises here, are functions always inlined? I found out that while stringifying, because we manually use Edit: But I'm not sure about arrays, let me see. |
Can you try with multiple of each in the tests to make sure all are replaced ? |
Merged manually as 0301604 with a few modifications, thanks for the ground work. |
@Marsup: Sorry, I had completely forgot about it, thanks. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
#696
Edit: I forgot to add tests, will add now.