| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Did you run the relevant benchmarks before and after these changes? |
Sorry, something went wrong.
|
I run the os.tmpdir after change, the benchmarks have no effect. Should I do a benchmark for RegExp vs startsWith/endsWith? |
Sorry, something went wrong.
There was a problem hiding this comment.
These can probably be arrow functions.
Sorry, something went wrong.
|
Hi @ronkorving @benjamingr , I updated the PR with your suggestions. Thanks. |
Sorry, something went wrong.
| function regexpify(host, wildcards) { | ||
| // Add trailing dot (make hostnames uniform) | ||
| if (!/\.$/.test(host)) host += '.'; | ||
| if (!host || !host.endsWith('.')) host += '.'; |
There was a problem hiding this comment.
What does the !host check add?
Sorry, something went wrong.
There was a problem hiding this comment.
the host maybe undefined.
Sorry, something went wrong.
There was a problem hiding this comment.
Can it really? In that case, the old code would have produced "undefined.". Does that code path really exist?
Sorry, something went wrong.
There was a problem hiding this comment.
yes. If no !host path, make test will fails.
Sorry, something went wrong.
There was a problem hiding this comment.
Well, it wouldn't have blown up, but would've turned undefined into "undefined", before appending a period to it. My point is, this was never a bug, so do we need that !host check?
Sorry, something went wrong.
There was a problem hiding this comment.
We need it here.
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, my bad. I get it now.
Sorry, something went wrong.
Sorry, something went wrong.
|
The windows is unhappy, I forget to check the length of string. Updated it. Would you please run CI again. |
Sorry, something went wrong.
Sorry, something went wrong.
|
There were multiple CI failures that appear unrelated but should be investigated before this lands. |
Sorry, something went wrong.
|
They say insanity is doing the same thing twice and expecting different results but I've had a long day so I'll give it another shot before investigating the CI results further: https://ci.nodejs.org/job/node-test-pull-request/2029/console |
Sorry, something went wrong.
|
The CI failure seems unrelated to this. Going to land. |
Sorry, something went wrong.
|
Wait, I just realized no one has given this a LGTM yet and I'm not completely sure about all the code involved myself - so I'd rather wait for another collaborator to LGTM it before landing. |
Sorry, something went wrong.
|
Ok, reviewed now and LGTM. Ping @nodejs/collaborators I'd love this to get a second review. |
Sorry, something went wrong.
There was a problem hiding this comment.
The indentation here is slightly off by two spaces.
Sorry, something went wrong.
reduce using RegExp for string test.
|
Thanks @benjamingr , fixed it. |
Sorry, something went wrong.
reduce using RegExp for string test. This pull reuqest replaces various usages of regular expressions in favor of the ES2015 startsWith and endsWith methods. PR-URL: #5753 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
reduce using RegExp for string test. This pull reuqest replaces various usages of regular expressions in favor of the ES2015 startsWith and endsWith methods. PR-URL: #5753 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
reduce using RegExp for string test. This pull reuqest replaces various usages of regular expressions in favor of the ES2015 startsWith and endsWith methods. PR-URL: #5753 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
reduce using RegExp for string test. This pull reuqest replaces various usages of regular expressions in favor of the ES2015 startsWith and endsWith methods. PR-URL: #5753 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
reduce using RegExp for string test. This pull reuqest replaces various usages of regular expressions in favor of the ES2015 startsWith and endsWith methods. PR-URL: #5753 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
| Back | FazBrowse Home | New Git URL |
Pull Request check-list
Please make sure to review and check all of these items:
this change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Affected core subsystem(s)
lib
Description of change
reduce using REGExp for string test.