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 <[email protected]>
Reviewed-By: Yorkie Liu <[email protected]>
Reviewed-By: JacksonTian - Jackson Tian <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent 69f4edd commit ce2cfbd
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 ce2cfbd

Please sign in to comment.