| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I hadn't noticed the Interface constructor before... what an odd way of initializing the object... this change looks good but let's see what CI says :-) |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
CI failures look unrelated. LGTM |
Sorry, something went wrong.
|
I'm pretty sure it was related to backwards compat with a really old node version (0.6?). Definitely safe to remove at this point. |
Sorry, something went wrong.
Sorry, something went wrong.
|
ci: https://ci.nodejs.org/job/node-test-pull-request/3021/ (rebased against master) @nodejs/collaborators PTAL |
Sorry, something went wrong.
|
LGTM. Let's try another CI: https://ci.nodejs.org/job/node-test-pull-request/3034/ |
Sorry, something went wrong.
|
one more CI. Will land later today if green https://ci.nodejs.org/job/node-test-pull-request/3178/ |
Sorry, something went wrong.
There was a problem hiding this comment.
Is this change in behaviour intentional? If input is a custom implementation that happens to have an input property, then it will cause the remaining arguments to be ignored. Can we find a safer way replicating the arguments length check? Maybe the ugly/obvious if (input && !output && !completer && !terminal) approach would be the most appropriate?
Sorry, something went wrong.
There was a problem hiding this comment.
thanks @rmg for scoping that out
thoughts @nodejs/collaborators?
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm, why not just keep arguments.length check?
Sorry, something went wrong.
There was a problem hiding this comment.
arguments.length wouldn't work with the way createInterface() was refactored - it now always passes 4 args, even if they're undefined.
Sorry, something went wrong.
There was a problem hiding this comment.
How about changing it then to
exports.createInterface = (...args) => new Interface(...args);?
That should solve the problem and, at the same time, still looks clean and elegant IMO.
Sorry, something went wrong.
There was a problem hiding this comment.
Same should be applied for the constructor though, but not hard to do.
Sorry, something went wrong.
There was a problem hiding this comment.
facepalm
this is targeting master, so I guess that's an option. Would also match lib/console.js, now that I look.
Sorry, something went wrong.
There was a problem hiding this comment.
In fact, given that Interface allows calling itself without new (and unless I'm missing something), it might be even reduced to exports.createInterface = Interface; (in which case I don't really see why two separate methods are exported, unless we want to move Interface to proper ES6 class and effectively break compatibility by forbidding calls without new in future).
Sorry, something went wrong.
There was a problem hiding this comment.
no. It doesn't change the behaviour. if (input && input.input) { is used for check first argument is options object.
Sorry, something went wrong.
Remove the dependency on the arguments.length.
|
@MylesBorins @JacksonTian ... still want this? Looks like it fell through the cracks |
Sorry, something went wrong.
|
Yes. |
Sorry, something went wrong.
|
landed in dad98bf thanks all. |
Sorry, something went wrong.
Remove the dependency on the arguments.length. PR-URL: #4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: nodejs#4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: nodejs#4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: nodejs#4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: nodejs#4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: #4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: #4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
|
I've gone ahead and landed this into lts staging. Please let me know if it should be taken out |
Sorry, something went wrong.
Remove the dependency on the arguments.length. PR-URL: #4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Remove the dependency on the arguments.length. PR-URL: #4740 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
| Back | FazBrowse Home | New Git URL |
Remove the dependency on the arguments.length.