-
Notifications
You must be signed in to change notification settings - Fork 952
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.stringify without toJSON #642
JSON.stringify without toJSON #642
Conversation
You serious? :) |
Absolutely. The spec doesn't contain If you'd like me to wait while you update |
Anyway, it can't be merged because contains part of another subtest - conversion to object - V8 fails |
|
221637c
to
bcac340
Compare
Tested in v8; the issues you brought up are fixed. |
BTW I've been going replace fixing |
@zloirock what version? Works fine for me in v45 on Mac. |
Windows, Chrome 45, Node 4.1, Opera 32, many other ;) Mac versions too. As minimum, on BTW, it should be Strange, perhaps, your method of testing if you don't see it. |
Weird - I see Chrome failing on How are you testing My test in the commit already does I'm testing by simply opening the compilers file for es6-shim in the given browsers - can you provide a screenshot? This might be a difference on Windows versus Mac. |
I just verified in Chrome 45 on Windows, as well as Opera 32, via browserstack. Is there a chance you're not checking out the right SHA to verify this with? Note that you have to run Thanks for the typo, and the Chrome tip, those were helpful review comments! |
@zloirock i think the spec requires that |
What does |
For
Your code. What else? :) |
Ah, thanks for clarifying. In that case, it will still go to http://www.ecma-international.org/ecma-262/6.0/#sec-serializejsonproperty - where if there's no callable Thanks again for the two errors you spotted - if I'm reading the spec wrong, can you clarify? |
Wrong. By spec, it's equal |
Thanks, you're correct - I'll update the test and fix |
bcac340
to
c4106f5
Compare
k, updated - now symbol objects are a separate test. I verified each of the results manually. I didn't test babel/typescript specifically; please let me know if these should pass (how do you go about testing these? i don't see an html file prepared for it). |
c4106f5
to
3510c8e
Compare
The problem here - |
That's a good point. Whether it's "no, but works with native symbols" or "yes, but requires native symbols" (I think the latter is more accurate for both), a flag might be appropriate here. However, since this test is about |
3510c8e
to
d88ac31
Compare
e0d55c7
to
1667544
Compare
So... the disagreement is on whether to mark tests as "Yes" or "No" with appropriate comments? |
Disagreement in #641, before resolving this issue I agree with results from the current PR and have no ideas why it's (sure, with adding |
@kangax the real question is whether shims that ensure proper support for a feature in an env where it's natively available should get a "Yes" for supporting it, or a "No" for not providing the full semantics the feature depends on. If, as I maintain, things like "Object.assign also enumerates symbols" should be a "Yes" even if it's only true in an env with native symbols, then I'll proceed to update this PR to include core-js's |
I haven't done much work in this area so I might be missing something but I would think shims' results should be entirely independent of the environment. Meaning, we don't want to say "Yes" when shim works only with certain features available in the environment. My reasoning is that from the user perspective — as someone looking at a table to find out shim support of certain features — you don't want to care about underlying environments; you want to see how shim behaves across all of them, even when they have wildly varying support. Of course this might paint an unrepresentative and skewed picture, which is why I've been wanting to add support for overlaying/combining columns to see actual support (e.g. Firefox + es6-shim). But meanwhile, I'd err on a side of "No" with a note. What do you think? /cc @webbedspace @jdalton |
I don't think that's as useful, tbh. I'd prefer a Yes with a note, just like all the notes that are "Yes with a flag" or "Yes with function "name" properties to be natively configurable" etc. I totally agree that being able to select an engine and shims/polyfills, and see the combined results, is very useful. But, when looking at the "shim" column, I'm interested in the unqualified "no"s - ie, what things it doesn't support at all - and the "No with flag" I think distracts from that. |
I hear ya and of course this is subjective. I'm not strongly opposed to either of these so ultimately I'd love to know what users of the table want. Otherwise, we (maintainers) can just all vote for one or the other. |
I think the shims should be applied to a common environment. Shims don't hold much value in environments where they aren't needed. With MS effectively dropping IE < 11 support on Jan 12th it might be a good idea to set the environment bar a bit higher (IE 11). |
When a test is |
Symbols tests, and those related, should be |
I strongly disagree and with
You mean also all |
I'm saying the chart should reflect support from a single environment running the transpiled code. |
@jdalton one more time - baseline environment - IE9 or IE11 hasn't native |
|
Anything that's not shimmable gets a fail. I also think the chart as it is, with
Yep, that's why I qualified my statement with "effectively". Vista is gearing up for its end of life in 2017. That combined with its low popularity is why I'm not so concerned with it. |
@jdalton |
firefox36: true, | ||
firefox40: true, |
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.
What is the point of having multiple versions of the same browser here? Isn't "firefox36:true" supposed to work for all versions >=36?
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.
The goal was to mark a version that's explicitly tested. Browsers do occasionally (both unintentionally and intentionally) change their support of a behavior, so it's useful to have explicitly checked.
@ljharb any plans about this PR? It's opened about a year. |
I'm still waiting for a consensus on whether tests that are useless in environments without native In this specific case, I'd argue that a test for "ignore Symbol primitives" can't possibly fail when the entire environment ignores Symbol primitives, so I think that test should automatically be marked passing in an environment without native Symbols. |
@ljharb as I already wrote - before this consensus makes sense to merge it in the current form. Sure, with adding results |
OK - I'll update this PR in the next week or so with up-to-date results, and merge in with that understanding. |
- with a primitive - with a boxed primitive - with a boxed primitive with a non-callable `toJSON` property
d88ac31
to
0a25350
Compare
Correcting the tests - For
JSON.stringify
to ignore symbols, it must work withoutSymbol.prototype.toJSON
.