-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: test-assert.js add 2nd argument to throws #11061
Conversation
@@ -102,9 +102,11 @@ assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im), | |||
/^AssertionError: \/a\/gim deepEqual \/a\/im$/); | |||
|
|||
{ | |||
const re1 = /a/; | |||
const re1 = /a/g; |
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.
Why add the g
?
regexp.lastIndex requires that /g be used with a regular expression. See
the description section of lastIndex on mdn:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex
LastIndex is called for the block on line 106.
In order for the regex supplied to makeBlock to match, it needs a /g.
…On Sat, Jan 28, 2017 at 4:56 PM, Colin Ihrig ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/parallel/test-assert.js
<#11061 (review)>:
> @@ -102,9 +102,11 @@ assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im),
/^AssertionError: \/a\/gim deepEqual \/a\/im$/);
{
- const re1 = /a/;
+ const re1 = /a/g;
Why add the g?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11061 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVBCgPzSthb7fKIDHQPDSSZFbEohTQKks5rW-PJgaJpZM4LwqUQ>
.
|
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.
Thanks for the link. It looks like the test can technically pass without adding the g
flag, but I agree it should be included.
Nit: You don't need to make the change I'm about to suggest, but the |
Only CI failure is a known-flaky documented at #11041. So CI looks good. |
PR-URL: nodejs#11061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Landed in 262400f. |
Yay!!!!
…On Tue, Jan 31, 2017 at 11:56 AM Rich Trott ***@***.***> wrote:
Closed #11061 <#11061>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11061 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAVBClFifPL3jl7_obnGqTEB-A3ojo1zks5rX5IHgaJpZM4LwqUQ>
.
|
PR-URL: #11061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #11061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #11061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #11061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #11061 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test