Skip to content
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

readline: fixed tab completion issue with undefined columns #2612

Closed
wants to merge 28 commits into from

Conversation

mtharrison
Copy link
Contributor

This attempts to resolve the issue at: #2396

Fixes an issue where tab completion groups aren't shown if the output stream column size is undefined.
@targos targos added the readline Issues and PRs related to the built-in readline module. label Aug 29, 2015
@Fishrock123
Copy link
Contributor

input: iStream,
output: oStream,
completer: function(line, cb) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this empty line is unneccessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I follow the hapi style guide and it's made its way into muscle memory. I'll fix.

@silverwind
Copy link
Contributor

LGTM, except this whitespace issue. @mtharrison it'd be great if you could fix that and reduce the change to a single commit with a short description in the message.

// when output column size is undefined

var iStream = new PassThrough();
var oStream = new PassThrough();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const for anything added/modified that doesn't change, please. :)

cpplint uses the top-level .git directory to determine what the root is
for #include guards.  If it doesn't find a .git directory, it walks up
all the way to the system root and subsequently complains that guards
must be written as HOME_USER_SRC_NODE_SRC_FILENAME_H_.

This commit replaces the .git-based path munging with a fixed root path
relative to the location of the cpplint script, making it possible to
successfully run `make test` from an extracted tarball.

Fixes: nodejs#2693
PR-URL: nodejs#2710
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
rvagg and others added 20 commits September 7, 2015 11:49
PR-URL: nodejs#2701
Reviewed-By: Joao Reis <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Update AUTHORS list using tools/update-authors.sh
It was pointed out by Zhou Ran that the Windows XP implementation of
uv_rwlock_rdlock() and friends may unlock the inner write mutex on a
different thread than the one that locked it, resulting in undefined
behavior.

The only place that uses rwlocks is the crypto module.  Make that use
normal (simple) mutexes instead.

OpenSSL's critical sections are generally very short, with exclusive
access outnumbering shared access by a factor of three or more, so
it's not as if using rwlocks gives a decisive performance advantage.

PR-URL: nodejs#2723
Reviewed-By: Fedor Indutny <[email protected]>
Previously, in _validateStdio we were using stdio.fd || stdio. If
stdio.fd was falsy (or 0 in the case of stdin), then the entire stdio
object would be passed which could cause a crash.

Fixes: nodejs#2721
PR-URL: nodejs#2727
Reviewed-By: silverwind - Roman Reiss <[email protected]>
Reviewed-By: cjihrig - Colin Ihrig <[email protected]>
Reviewed-By: indutny - Fedor Indutny <[email protected]>
PR-URL: nodejs#2699
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Alexis Campailla <[email protected]>
* support process.release
* support all io.js versions
* support node v4+ including new download locations
* enable delay-load hook by default by default
* download header-only tarballs instead of full source

See nodejs/node-gyp#711 for full details

PR-URL: nodejs#2700
Reviewed-By: Forrest L Norvell <[email protected]>
Allow listening on reused dgram ports in cluster workers.

Fix: nodejs/node-v0.x-archive#9261
PR-URL: nodejs#2548
Reviewed-By: Ben Noordhuis <[email protected]>
This a backport of the following commits from the v8's upstream:

* 1a8c38c50513f9af07ada479629a653e1cf36ff3
* 206f12abee3f1e7eda8fc6521d48f3c319460ee1
* 9e3676da9ab1aaf7de3e8582cb3fdefcc3dbaf33

Original commit message:

    heap: make array buffer maps disjoint

    Remove intersection from the `std::map`s representing current live
    ArrayBuffers. While being simpler to understand, it poses
    significant performance issue for the active ArrayBuffer users (like
    node.js).

    Store buffers separately, and process them together during
    mark-sweep phase.

    The results of benchmarks are:

    $ ./node-slow bench && ./node-fast bench
    4997.4 ns/op
    4685.7 ns/op

    NOTE: `fast` - was a patched node.js, `slow` - unpatched node.js
    with vanilla v8.

PR-URL: nodejs#2732
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
It was previously ignored by features.gypi and therefore
enabled by default for release builds.

See https://code.google.com/p/chromium/issues/detail?id=318206

PR-URL: nodejs#2731
Reviewed-By: Fedor Indutny <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
This fixes a minor typographical error in the Assertion Testing doc.

PR-URL: nodejs#2728
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
This list of changes is relative to the last io.js v3.x branch
release, v3.3.0. Please see the list of notable changes in the v3.x,
v2.x and v1.x releases for a more complete list of changes from
0.12.x. Note, that some changes in the v3.x series as well as major
breaking changes in this release constitute changes required for full
convergence of the Node.js and io.js projects.

* child_process: ChildProcess.prototype.send() and process.send()
  operate asynchronously across all platforms so an optional callback
  parameter has been introduced that will be invoked once the message
  has been sent, i.e. .send(message[, sendHandle][, callback])
  (Ben Noordhuis) nodejs#2620.
* node: Rename "io.js" code to "Node.js" (cjihrig) nodejs#2367.
* node-gyp: This release bundles an updated version of node-gyp that
  works with all versions of Node.js and io.js including nightly and
  release candidate builds. From io.js v3 and Node.js v4 onward, it
  will only download a headers tarball when building addons rather
  than the entire source. (Rod Vagg) nodejs#2700.
* npm: Upgrade to version 2.14.2 from 2.13.3, includes a security
  update, see https://github.com/npm/npm/releases/tag/v2.14.2 for more
  details, (Kat Marchán) nodejs#2696.
* timers: Improved timer performance from porting the 0.12
  implementation, plus minor fixes (Jeremiah Senkpiel) nodejs#2540,
  (Julien Gilli) nodejs/node-v0.x-archive#8751 nodejs/node-v0.x-archive#8905
* util: The util.is*() functions have been deprecated, beginning with
  deprecation warnings in the documentation for this release, users
  are encouraged to seek more robust alternatives in the npm registry,
  (Sakthipriyan Vairamani) nodejs#2447.
* v8: Upgrade to version 4.5.103.30 from 4.4.63.30 (Ali Ijaz Sheikh) nodejs#2632.
  - Implement new TypedArray prototype methods: copyWithin(), every(),
    fill(), filter(), find(), findIndex(), forEach(), indexOf(),
    join(), lastIndexOf(), map(), reduce(), reduceRight(), reverse(),
    slice(), some(), sort(). See
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
    for further information.
  - Implement new TypedArray.from() and TypedArray.of() functions. See
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
    for further information.
  - Implement arrow functions. See
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
    for further information.
  - Full ChangeLog available at
    https://github.com/v8/v8-git-mirror/blob/4.5.103/ChangeLog

PR-URL: nodejs#2742
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
FreeBSD does not support the V4MAPPED flag so expect an error.

This is a partial fix for nodejs#2468.
It only fixes it on FreeBSD. Failures on other platforms are due to
other reasons and need to be fixed separately.

PR-URL: nodejs#2724
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Fixes: nodejs#2468
PR-URL: nodejs#2765
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Do not let the module struct to be deallocated by `uv_dlclose`
before reading data from it.

PR-URL: nodejs#2792
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Brian White <[email protected]>
Reviewed-By: Yosuke Furukawa <[email protected]>
Original commit message:

    TypedArray accessor detection: consider entire prototype chain

    When looking up a special accessor for known TypedArray fields
    ("length", "byteLength", "byteOffset"), consider the entire
    prototype chain, not only the direct prototype.
    This allows subclasses of TypedArrays to benefit from fast
    specialized accesses.

    Review URL: https://codereview.chromium.org/1313493005

    Cr-Commit-Position: refs/heads/master@{nodejs#30678}

Benchmark results:

   buffers/buffer-iterate.js size=16386 type=slow method=for n=1000:
   ./node: 71607 node: 8702.3 ............ 722.85%

Improvement depends on the code, but generally brings us back to the
performance that we had before the v8 update (if not making it
faster).

Fixes: nodejs#2463
PR-URL: nodejs#2801
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Trevor Norris <[email protected]>
behaviour -> behavior

PR-URL: nodejs#2784
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Brendan Ashworth <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Trott and others added 5 commits September 10, 2015 15:09
Operating systems can and do return invalid hostnames if that's
what they have (for example) in /etc/hosts. Test passes if no
error is thrown and the hostname string is not empty.

Fixes: nodejs#2468
PR-URL: nodejs#2785
Reviewed-By: Ben Noordhuis <[email protected]>
Fixes an issue where tab completion groups aren't shown if the output stream column size is undefined.
@mtharrison
Copy link
Contributor Author

Oh no. I don't know what's happened here. I was trying to rebase on master to update my branch. I guess that's not the way to do it. Maybe I should start again with a fresh PR? I have all the changes done.

@Fishrock123
Copy link
Contributor

@mtharrison master was changed a few days ago to fix a commit.

@mtharrison mtharrison closed this Sep 11, 2015
@mtharrison mtharrison deleted the readline-tab-completion branch September 11, 2015 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.