@@ -257,10 +257,11 @@ describe("miscellaneous tests", () => {
257
257
} )
258
258
259
259
it ( "should support overwriting globals" , ( ) => {
260
+ const { defineProperty } = Reflect
260
261
const consoleDescriptor = Reflect . getOwnPropertyDescriptor ( global , "console" )
261
262
const reflectDescriptor = Reflect . getOwnPropertyDescriptor ( global , "Reflect" )
262
263
263
- Reflect . defineProperty ( global , "console" , {
264
+ defineProperty ( global , "console" , {
264
265
configurable : true ,
265
266
value : {
266
267
dir ( ) {
@@ -270,7 +271,7 @@ describe("miscellaneous tests", () => {
270
271
writable : true
271
272
} )
272
273
273
- Reflect . defineProperty ( global , "Reflect" , {
274
+ defineProperty ( global , "Reflect" , {
274
275
configurable : true ,
275
276
value : {
276
277
get ( ) {
@@ -280,15 +281,13 @@ describe("miscellaneous tests", () => {
280
281
writable : true
281
282
} )
282
283
283
- const object = { }
284
-
285
284
const actual = [
286
- console . dir ( object ) ,
287
- Reflect . get ( object , "a" )
285
+ console . dir ( { } ) ,
286
+ Reflect . get ( { } , "a" )
288
287
]
289
288
290
- Object . defineProperty ( global , "console" , consoleDescriptor )
291
- Object . defineProperty ( global , "Reflect" , reflectDescriptor )
289
+ defineProperty ( global , "console" , consoleDescriptor )
290
+ defineProperty ( global , "Reflect" , reflectDescriptor )
292
291
293
292
assert . deepStrictEqual ( actual , [ "mock" , "mock" ] )
294
293
} )
0 commit comments