@@ -170,10 +170,6 @@ if (process.env.NODE_V8_COVERAGE) {
170170 expected . atRunTime . add ( 'Internal Binding profiler' ) ;
171171}
172172
173- const difference = ( setA , setB ) => {
174- return new Set ( [ ...setA ] . filter ( ( x ) => ! setB . has ( x ) ) ) ;
175- } ;
176-
177173// Accumulate all the errors and print them at the end instead of throwing
178174// immediately which makes it harder to update the test.
179175const errorLogs = [ ] ;
@@ -187,8 +183,8 @@ function err(message) {
187183}
188184
189185if ( common . isMainThread ) {
190- const missing = difference ( expected . beforePreExec , actual . beforePreExec ) ;
191- const extra = difference ( actual . beforePreExec , expected . beforePreExec ) ;
186+ const missing = expected . beforePreExec . difference ( actual . beforePreExec ) ;
187+ const extra = actual . beforePreExec . difference ( expected . beforePreExec ) ;
192188 if ( missing . size !== 0 ) {
193189 err ( 'These builtins are now no longer loaded before pre-execution.' ) ;
194190 err ( 'If this is intentional, remove them from `expected.beforePreExec`.' ) ;
@@ -222,8 +218,8 @@ if (!common.isMainThread) {
222218}
223219
224220{
225- const missing = difference ( expected . atRunTime , actual . atRunTime ) ;
226- const extra = difference ( actual . atRunTime , expected . atRunTime ) ;
221+ const missing = expected . atRunTime . difference ( actual . atRunTime ) ;
222+ const extra = actual . atRunTime . difference ( expected . atRunTime ) ;
227223 if ( missing . size !== 0 ) {
228224 err ( 'These builtins are now no longer loaded at run time.' ) ;
229225 err ( 'If this is intentional, remove them from `expected.atRunTime`.' ) ;
0 commit comments