@@ -24,51 +24,50 @@ assert.throws(function() {
24
24
// TODO(trevnorris): Is there a way to verify this is being run during
25
25
// bootstrap?
26
26
( function verifyExecutionOrder ( arg ) {
27
- const results_arr = [ ] ;
27
+ const results = [ ] ;
28
28
29
29
// Processing of the MicrotaskQueue is manually handled by node. They are not
30
30
// processed until after the nextTickQueue has been processed.
31
31
Promise . resolve ( 1 ) . then ( common . mustCall ( function ( ) {
32
- results_arr . push ( 7 ) ;
32
+ results . push ( 7 ) ;
33
33
} ) ) ;
34
34
35
35
// The nextTick should run after all immediately invoked calls.
36
36
process . nextTick ( common . mustCall ( function ( ) {
37
- results_arr . push ( 3 ) ;
37
+ results . push ( 3 ) ;
38
38
39
39
// Run same test again but while processing the nextTickQueue to make sure
40
40
// the following MakeCallback call breaks in the middle of processing the
41
41
// queue and allows the script to run normally.
42
42
process . nextTick ( common . mustCall ( function ( ) {
43
- results_arr . push ( 6 ) ;
43
+ results . push ( 6 ) ;
44
44
} ) ) ;
45
45
46
46
makeCallback ( { } , common . mustCall ( function ( ) {
47
- results_arr . push ( 4 ) ;
47
+ results . push ( 4 ) ;
48
48
} ) ) ;
49
49
50
- results_arr . push ( 5 ) ;
50
+ results . push ( 5 ) ;
51
51
} ) ) ;
52
52
53
- results_arr . push ( 0 ) ;
53
+ results . push ( 0 ) ;
54
54
55
55
// MakeCallback is calling the function immediately, but should then detect
56
56
// that a script is already in the middle of execution and return before
57
57
// either the nextTickQueue or MicrotaskQueue are processed.
58
58
makeCallback ( { } , common . mustCall ( function ( ) {
59
- results_arr . push ( 1 ) ;
59
+ results . push ( 1 ) ;
60
60
} ) ) ;
61
61
62
62
// This should run before either the nextTickQueue or MicrotaskQueue are
63
63
// processed. Previously MakeCallback would not detect this circumstance
64
64
// and process them immediately.
65
- results_arr . push ( 2 ) ;
65
+ results . push ( 2 ) ;
66
66
67
67
setImmediate ( common . mustCall ( function ( ) {
68
- for ( var i = 0 ; i < results_arr . length ; i ++ ) {
69
- assert . equal ( results_arr [ i ] ,
70
- i ,
71
- `verifyExecutionOrder(${ arg } ) results: ${ results_arr } ` ) ;
68
+ for ( var i = 0 ; i < results . length ; i ++ ) {
69
+ assert . strictEqual ( results [ i ] , i ,
70
+ `verifyExecutionOrder(${ arg } ) results: ${ results } ` ) ;
72
71
}
73
72
if ( arg === 1 ) {
74
73
// The tests are first run on bootstrap during LoadEnvironment() in
@@ -102,16 +101,16 @@ function checkDomains() {
102
101
const d2 = domain . create ( ) ;
103
102
const d3 = domain . create ( ) ;
104
103
105
- makeCallback ( { domain : d1 } , common . mustCall ( function ( ) {
106
- assert . equal ( d1 , process . domain ) ;
107
- makeCallback ( { domain : d2 } , common . mustCall ( function ( ) {
108
- assert . equal ( d2 , process . domain ) ;
109
- makeCallback ( { domain : d3 } , common . mustCall ( function ( ) {
110
- assert . equal ( d3 , process . domain ) ;
104
+ makeCallback ( { domain : d1 } , common . mustCall ( function ( ) {
105
+ assert . strictEqual ( d1 , process . domain ) ;
106
+ makeCallback ( { domain : d2 } , common . mustCall ( function ( ) {
107
+ assert . strictEqual ( d2 , process . domain ) ;
108
+ makeCallback ( { domain : d3 } , common . mustCall ( function ( ) {
109
+ assert . strictEqual ( d3 , process . domain ) ;
111
110
} ) ) ;
112
- assert . equal ( d2 , process . domain ) ;
111
+ assert . strictEqual ( d2 , process . domain ) ;
113
112
} ) ) ;
114
- assert . equal ( d1 , process . domain ) ;
113
+ assert . strictEqual ( d1 , process . domain ) ;
115
114
} ) ) ;
116
115
} ) ) ;
117
116
@@ -120,16 +119,16 @@ function checkDomains() {
120
119
const d2 = domain . create ( ) ;
121
120
const d3 = domain . create ( ) ;
122
121
123
- makeCallback ( { domain : d1 } , common . mustCall ( function ( ) {
124
- assert . equal ( d1 , process . domain ) ;
125
- makeCallback ( { domain : d2 } , common . mustCall ( function ( ) {
126
- assert . equal ( d2 , process . domain ) ;
127
- makeCallback ( { domain : d3 } , common . mustCall ( function ( ) {
128
- assert . equal ( d3 , process . domain ) ;
122
+ makeCallback ( { domain : d1 } , common . mustCall ( function ( ) {
123
+ assert . strictEqual ( d1 , process . domain ) ;
124
+ makeCallback ( { domain : d2 } , common . mustCall ( function ( ) {
125
+ assert . strictEqual ( d2 , process . domain ) ;
126
+ makeCallback ( { domain : d3 } , common . mustCall ( function ( ) {
127
+ assert . strictEqual ( d3 , process . domain ) ;
129
128
} ) ) ;
130
- assert . equal ( d2 , process . domain ) ;
129
+ assert . strictEqual ( d2 , process . domain ) ;
131
130
} ) ) ;
132
- assert . equal ( d1 , process . domain ) ;
131
+ assert . strictEqual ( d1 , process . domain ) ;
133
132
} ) ) ;
134
133
} ) , 1 ) ;
135
134
@@ -138,9 +137,9 @@ function checkDomains() {
138
137
process . nextTick ( common . mustCall ( function ( ) {
139
138
const d = domain . create ( ) ;
140
139
d . on ( 'error' , common . mustCall ( function ( e ) {
141
- assert . equal ( e . message , 'throw from domain 3' ) ;
140
+ assert . strictEqual ( e . message , 'throw from domain 3' ) ;
142
141
} ) ) ;
143
- makeCallback ( { domain : d } , function ( ) {
142
+ makeCallback ( { domain : d } , function ( ) {
144
143
throw new Error ( 'throw from domain 3' ) ;
145
144
} ) ;
146
145
throw new Error ( 'UNREACHABLE' ) ;
@@ -149,9 +148,9 @@ function checkDomains() {
149
148
setImmediate ( common . mustCall ( function ( ) {
150
149
const d = domain . create ( ) ;
151
150
d . on ( 'error' , common . mustCall ( function ( e ) {
152
- assert . equal ( e . message , 'throw from domain 2' ) ;
151
+ assert . strictEqual ( e . message , 'throw from domain 2' ) ;
153
152
} ) ) ;
154
- makeCallback ( { domain : d } , function ( ) {
153
+ makeCallback ( { domain : d } , function ( ) {
155
154
throw new Error ( 'throw from domain 2' ) ;
156
155
} ) ;
157
156
throw new Error ( 'UNREACHABLE' ) ;
@@ -160,9 +159,9 @@ function checkDomains() {
160
159
setTimeout ( common . mustCall ( function ( ) {
161
160
const d = domain . create ( ) ;
162
161
d . on ( 'error' , common . mustCall ( function ( e ) {
163
- assert . equal ( e . message , 'throw from domain 1' ) ;
162
+ assert . strictEqual ( e . message , 'throw from domain 1' ) ;
164
163
} ) ) ;
165
- makeCallback ( { domain : d } , function ( ) {
164
+ makeCallback ( { domain : d } , function ( ) {
166
165
throw new Error ( 'throw from domain 1' ) ;
167
166
} ) ;
168
167
throw new Error ( 'UNREACHABLE' ) ;
0 commit comments