You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test-repl-tab-complete.js "params and { on separate line" fails silently. #21586
In test/parallel/test-repl-tab-complete.js, the following not only fails silently, it aborts the running of the remainder of the tests in this source file:
// def has the params and { on a separate lineputIn.run(['var top = function() {','r = function test (',' one, two) {','var inner = {',' one:1','};']);testMe.complete('inner.o',getNoResultsFunction());
If this test is changed to have only assertions that pass (e.g., assert.strictEqual(null, null);, then execution continues. If it has assertions that fail (e.g., assert.strictEqual(1, 2);, then the test fails silently, the remainder of the tests are aborted, and overall success is reported.
There seem to be two things going on here. First, the assertion is wrong. It shouldn't be no results. It should get inner.one.
Second, when the test fails, nothing happens. The callback is running, but even throwing in the callback doesn't result in the error failing in this test case and a few others. Not sure why it's different. Even if I comment out all other test cases, it still exhibits this behavior.
There seem to be two things going on here. First, the assertion is wrong. It shouldn't be no results. It should get inner.one.
In Node.js 8.x, completion returned nothing and the test was correct. In Node.js 10.x, completion returns inner.one (which is what I would expect) but now the problem with the test is exposed.
In some situations, the error is handled by the domain of a nested REPL so we never see it...
Definitely looks like it's a bug in the REPL where domains cause the nested REPL to swallow errors that should be transmitted back to the parent REPL. I've got a test for this bug and I think I have a fix that I'm testing right now.
Activity
repl: make own properties shadow prototype properties
devsnek commentedon Jun 29, 2018
@nodejs/repl
repl: make own properties shadow prototype properties
repl: make own properties shadow prototype properties
Trott commentedon Sep 21, 2018
There seem to be two things going on here. First, the assertion is wrong. It shouldn't be no results. It should get
inner.one.Second, when the test fails, nothing happens. The callback is running, but even throwing in the callback doesn't result in the error failing in this test case and a few others. Not sure why it's different. Even if I comment out all other test cases, it still exhibits this behavior.
Trott commentedon Sep 21, 2018
Maybe domains are messing with the error handling? Maybe the REPL completer is creating a nested REPL and that contributes to the problem?
Trott commentedon Sep 21, 2018
In Node.js 8.x, completion returned nothing and the test was correct. In Node.js 10.x, completion returns
inner.one(which is what I would expect) but now the problem with the test is exposed.In some situations, the error is handled by the domain of a nested REPL so we never see it...
Trott commentedon Sep 21, 2018
Definitely looks like it's a bug in the REPL where domains cause the nested REPL to swallow errors that should be transmitted back to the parent REPL. I've got a test for this bug and I think I have a fix that I'm testing right now.
Trott commentedon Sep 21, 2018
Proposed fix: #23004
repl: do not swallow errors in nested REPLs
Trott commentedon Oct 2, 2018
Fixed in 83d0404
fix(repl): stop the uncaught-exception capture swallowing completion …
fix(repl): stop the uncaught-exception capture swallowing completion …