-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
assert.js rule 7.4 (similar to CJS rule 7.3) #9063
Comments
Just to clarify, can you provide a call to the |
Nope, that would be the next step. I first have to understand exactly which behavior is intended as correct; only then I can know whether it is working incorrectly at all. The code example in the other thread is not applicable because that one is about the CJS UT spec, the one at the URL stated in line 1 of node's We can care about specs later, but for now my goal in this issue is just to solve the cited dissonance between comment and code. |
If it helps explain anything: The Side note: A good first commit for a new contributor might be to remove all those numbers so that no one thinks they are supposed to map to the standard. We've likely deviated from it and even if we haven't, we likely happily would if it suited our needs. |
Removing the old numbers, and adding an annotation to the spec URL (or removing it) will probably avoid some bug reports in case the code is kept and the comment is edited to match it. |
We don't follow CJS so the comments should not be considered part or forming any standard but rather just regular code comments. They may change at any time. |
How about replacing the comment that was 7.4 with:
I think that's what the current code does. |
A contribution that makes the comments more accurately and clearly reflect what is going on in the code would be welcome. |
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. Fixes: nodejs#9063
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: nodejs#10579 Fixes: nodejs#9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: nodejs#10579 Fixes: nodejs#9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: nodejs#10579 Fixes: nodejs#9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: nodejs#10579 Fixes: nodejs#9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: #10579 Fixes: #9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: #10579 Fixes: #9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: #10579 Fixes: #9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
Remove the numbers from the comments to make it clear that assert does not follow the [CJS spec](http://wiki.commonjs.org/wiki/Unit_Testing/1.0). Additionally, clean up the existing comments for consistent formatting/language and ease of reading. PR-URL: #10579 Fixes: #9063 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
v6.1.0
Linux ███ 3.13.0-97-generic #144-Ubuntu SMP Thu Sep 22 16:23:22 UTC 2016 i686 i686 i686 GNU/Linux
Hi,
I'm developing an assert lib and it disagrees with node's. While debugging, I found rule 7.4 in master/lib/assert.js @ d4061a6 that to me sounds very similar to rule 7.3 in the CJS spec:
I think the condition tests both values for being primitives, aka not objects. Firefox seems to agree:
So one passes the object check, the other does not, as expected.
Is it a pair where both values pass the object check? No.
So shouldn't it count as a "[pair] that do not both pass typeof […] object"?
If the partial conditions negate the object check and check for being primiteves instead, shouldn't the binary operator change to
||
?Pre-emptive: In case anyone feels inclined to discuss the quality of the CJS UT spec and/or how much better
deepStrictEqual
is, please make another issue for that.The text was updated successfully, but these errors were encountered: