Skip to content

Commit ce2cfbd

Browse files
TrottMylesBorins
authored andcommitted
test: console constructor missing new keyword
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]>
1 parent 69f4edd commit ce2cfbd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/parallel/test-console-instance.js

+5
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@ out.write = function(d) {
6464
};
6565
[1, 2, 3].forEach(c.log);
6666
assert.equal(3, called);
67+
68+
// Console() detects if it is called without `new` keyword
69+
assert.doesNotThrow(function() {
70+
Console(out, err);
71+
});

0 commit comments

Comments
 (0)