Skip to content

Commit

Permalink
test: console constructor missing new keyword
Browse files Browse the repository at this point in the history
The `console.Console()` constructor function handles a missing `new`
keyword. This code is not exercised in the current tests. Add a test for
this.

PR-URL: #8003
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: JacksonTian - Jackson Tian <shvyo1987@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
Trott authored and cjihrig committed Aug 10, 2016
1 parent 97934f9 commit 5d68e4b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/parallel/test-console-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ out.write = function(d) {
};
[1, 2, 3].forEach(c.log);
assert.equal(3, called);

// Console() detects if it is called without `new` keyword
assert.doesNotThrow(function() {
Console(out, err);
});

0 comments on commit 5d68e4b

Please sign in to comment.