Skip to content

Commit 9b52070

Browse files
Matt Wondramjackson
authored andcommitted
Explicitly 'use strict';
* Use strict and override console methods without re-setting object. * Update console override to use defineProperty
1 parent f832bdf commit 9b52070

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
const path = require('path')
23
const invariant = require('invariant')
34
const EventStream = require('event-stream')
@@ -112,7 +113,11 @@ Object.defineProperty(process, 'stdout', {
112113

113114
// Ensure console.log knows about the new stdout.
114115
const Console = require('console').Console
115-
console = new Console(process.stdout, process.stderr)
116+
Object.defineProperty(global, 'console', {
117+
configurable: true,
118+
enumerable: true,
119+
value: new Console(process.stdout, process.stderr)
120+
})
116121

117122
// Read JSON blobs from stdin, pipe output to stdout.
118123
process.stdin

0 commit comments

Comments
 (0)