-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
create-test / default-params issue #55
Comments
Ah, interesting. Was this causing an error during testing? Since null == undefined, it would seem like a semantic difference but not a functional one. |
When I updated to the latest eprima version of
In order to not break tests I had to:
And yes I checked everywhere upstream and made sure there was no setting of Kind of weird thing, I'll go with whatever is the path of least resistance for now, which will be to leave the |
Probably it doesn't really matter, because it's such an edge case, but if we want to fix the var x = {
a: [undefined, undefined],
b: {x: undefined }
};
util.inspect(x, {depth: null}) // { a: [ undefined, undefined ], b: { x: undefined } }
JSON.stringify(x); // {"a":[null,null],"b":{}} The only issue I'm seeing is that I'm not sure how to format http://nodejs.org/api/util.html#util_util_inspect_object_options |
Realizing this is a super small edge case and not likely worth fixing, especially as the way default params are being handled is changing anyway jquery/esprima#1081 |
undefined
instead ofnull
create-test-.js
improperly changesundefined
array members tonull
.Recently when working on
defaultParams
anddestructuring
I noticed that I was having some mismatches with Esprima on the expected output, especially involving the placeholder when there are not defaults specified for each parameter.When I use
create-test
to generate the expected output it seems to show[null, 1]
forfunction(a, b=1){}
, but when i actuallyconsole.log
the output from Esprima, it looks like[undefined, 1]
.Here is I think the source of the issue:
The only thing that makes me unsure is that the single test in esprima also shows
null
as the placeholder, but I can only assume they're using JSON.stringify in their tests, because Esprima will not generate that output:https://github.com/jquery/esprima/blob/harmony/test/harmonytest.js#L2612
Let me know if you have any ideas otherwise I'll like manually change the tests to use
undefined
as part of #51, which changed some of the code around this area and caused me to bump into this issue.The text was updated successfully, but these errors were encountered: