Skip to content

Commit 157bb4c

Browse files
authored
Fix compiler issue with node 6 + latest TypeScript (#761)
1 parent d9f310e commit 157bb4c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/bin.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ function startRepl () {
278278
/**
279279
* Eval code from the REPL.
280280
*/
281-
function replEval (code: string, _context: any, _filename: string, callback: (err?: Error, result?: any) => any) {
282-
let err: Error | undefined
281+
function replEval (code: string, _context: any, _filename: string, callback: (err: Error | null, result?: any) => any) {
282+
let err: Error | null = null
283283
let result: any
284284

285285
// TODO: Figure out how to handle completion here.
286286
if (code === '.scope') {
287-
callback()
287+
callback(err)
288288
return
289289
}
290290

@@ -297,7 +297,6 @@ function replEval (code: string, _context: any, _filename: string, callback: (er
297297
err = new Recoverable(error)
298298
} else {
299299
console.error(error.diagnosticText)
300-
err = undefined
301300
}
302301
} else {
303302
err = error

0 commit comments

Comments
 (0)