1
1
/* eslint-disable no-debugger */
2
2
'use strict' ;
3
- var common = require ( '../common' ) ;
4
- var assert = require ( 'assert' ) ;
5
- var vm = require ( 'vm' ) ;
6
- var spawn = require ( 'child_process' ) . spawn ;
3
+ const common = require ( '../common' ) ;
4
+ const assert = require ( 'assert' ) ;
5
+ const vm = require ( 'vm' ) ;
6
+ const spawn = require ( 'child_process' ) . spawn ;
7
7
8
8
assert . throws ( function ( ) {
9
9
vm . runInDebugContext ( '*' ) ;
@@ -21,8 +21,8 @@ assert.throws(function() {
21
21
vm . runInDebugContext ( '(function(f) { f(f) })(function(f) { f(f) })' ) ;
22
22
} , / R a n g e E r r o r / ) ;
23
23
24
- assert . equal ( typeof vm . runInDebugContext ( 'this' ) , 'object' ) ;
25
- assert . equal ( typeof vm . runInDebugContext ( 'Debug' ) , 'object' ) ;
24
+ assert . strictEqual ( typeof vm . runInDebugContext ( 'this' ) , 'object' ) ;
25
+ assert . strictEqual ( typeof vm . runInDebugContext ( 'Debug' ) , 'object' ) ;
26
26
27
27
assert . strictEqual ( vm . runInDebugContext ( ) , undefined ) ;
28
28
assert . strictEqual ( vm . runInDebugContext ( 0 ) , 0 ) ;
@@ -46,11 +46,11 @@ assert.strictEqual(vm.runInDebugContext(undefined), undefined);
46
46
debugger ;
47
47
}
48
48
49
- assert . equal ( breaks , 0 ) ;
49
+ assert . strictEqual ( breaks , 0 ) ;
50
50
Debug . setListener ( ondebugevent ) ;
51
- assert . equal ( breaks , 0 ) ;
51
+ assert . strictEqual ( breaks , 0 ) ;
52
52
breakpoint ( ) ;
53
- assert . equal ( breaks , 1 ) ;
53
+ assert . strictEqual ( breaks , 1 ) ;
54
54
}
55
55
56
56
// Can set listeners and breakpoints on a single line file
@@ -73,24 +73,24 @@ assert.strictEqual(vm.runInDebugContext(undefined), undefined);
73
73
74
74
// See https://github.com/nodejs/node/issues/1190, fatal errors should not
75
75
// crash the process.
76
- var script = common . fixturesDir + '/vm-run-in-debug-context.js' ;
77
- var proc = spawn ( process . execPath , [ script ] ) ;
78
- var data = [ ] ;
76
+ const script = common . fixturesDir + '/vm-run-in-debug-context.js' ;
77
+ let proc = spawn ( process . execPath , [ script ] ) ;
78
+ const data = [ ] ;
79
79
proc . stdout . on ( 'data' , common . fail ) ;
80
80
proc . stderr . on ( 'data' , data . push . bind ( data ) ) ;
81
81
proc . stderr . once ( 'end' , common . mustCall ( function ( ) {
82
- var haystack = Buffer . concat ( data ) . toString ( 'utf8' ) ;
82
+ const haystack = Buffer . concat ( data ) . toString ( 'utf8' ) ;
83
83
assert ( / S y n t a x E r r o r : U n e x p e c t e d t o k e n \* / . test ( haystack ) ) ;
84
84
} ) ) ;
85
85
proc . once ( 'exit' , common . mustCall ( function ( exitCode , signalCode ) {
86
- assert . equal ( exitCode , 1 ) ;
87
- assert . equal ( signalCode , null ) ;
86
+ assert . strictEqual ( exitCode , 1 ) ;
87
+ assert . strictEqual ( signalCode , null ) ;
88
88
} ) ) ;
89
89
90
90
proc = spawn ( process . execPath , [ script , 'handle-fatal-exception' ] ) ;
91
91
proc . stdout . on ( 'data' , common . fail ) ;
92
92
proc . stderr . on ( 'data' , common . fail ) ;
93
93
proc . once ( 'exit' , common . mustCall ( function ( exitCode , signalCode ) {
94
- assert . equal ( exitCode , 42 ) ;
95
- assert . equal ( signalCode , null ) ;
94
+ assert . strictEqual ( exitCode , 42 ) ;
95
+ assert . strictEqual ( signalCode , null ) ;
96
96
} ) ) ;
0 commit comments