@@ -23,10 +23,7 @@ function getKey(prefix = "", key = null) {
23
23
let realKey = key || null ;
24
24
25
25
if ( ! realKey ) {
26
- realKey = Object . prototype . hasOwnProperty . call (
27
- { key : "key" , value : "value" } ,
28
- "key"
29
- )
26
+ realKey = Object . hasOwn ( { key : "key" , value : "value" } , "key" )
30
27
? "very very very very very very very very very long key"
31
28
: 1 ;
32
29
}
@@ -75,7 +72,7 @@ const objectVariable = {
75
72
// defer: deferFn((config) => (config.exist ? 'exist' : 'non exist'))
76
73
} ;
77
74
78
- objectVariable . log = function ( items , options = { } ) {
75
+ objectVariable . log = function log ( items , options = { } ) {
79
76
const concatenateAll = ( ...args ) => args . join ( "" ) . join ( Object . keys ( options ) ) ;
80
77
81
78
return concatenateAll ( this . addValue ( 1 ) . addValue ( items ) , options ) ;
@@ -103,7 +100,7 @@ const obj = {
103
100
104
101
console . log ( obj ) ;
105
102
106
- const has = Object . prototype . hasOwnProperty ;
103
+ const has = Object . hasOwn ;
107
104
108
105
handler ( ) ;
109
106
handler ( ) ;
@@ -186,7 +183,7 @@ switch (letVariable) {
186
183
187
184
arrayVariable . push ( letVariable ) ;
188
185
189
- Object . prototype . hasOwnProperty . call ( objectVariable , "id" ) ;
186
+ Object . hasOwn ( objectVariable , "id" ) ;
190
187
has . call ( objectVariable , "id" ) ;
191
188
192
189
const itemsCopy = [ ...arrayVariable ] ;
@@ -310,7 +307,7 @@ if (booleanVariable) {
310
307
[ 1 , 2 , 3 ] . map (
311
308
( number ) =>
312
309
`As time went by, the string containing the ${ number } became much ` +
313
- "longer. So we needed to break it over multiple lines."
310
+ "longer. So we needed to break it over multiple lines." ,
314
311
) ;
315
312
316
313
const itemHeightFoo = ( item ) => {
@@ -359,9 +356,9 @@ handler();
359
356
360
357
try {
361
358
render ( ) ;
362
- } catch ( error ) {
359
+ } catch ( err ) {
363
360
render ( {
364
- error ,
361
+ err ,
365
362
} ) ;
366
363
}
367
364
@@ -389,10 +386,10 @@ async function fetchJson(url) {
389
386
const text = await request . text ( ) ;
390
387
391
388
return JSON . parse ( text ) ;
392
- } catch ( error ) {
389
+ } catch ( err ) {
393
390
multiply ( 2 , 1 , 2 , 3 ) ;
394
391
395
- throw error ;
392
+ throw err ;
396
393
}
397
394
}
398
395
@@ -595,12 +592,12 @@ Promise.all([Promise.resolve("a"), "b", Promise.resolve("c")])
595
592
596
593
return 1 ;
597
594
} )
598
- . catch ( ( error ) => {
599
- throw error ;
595
+ . catch ( ( err ) => {
596
+ throw err ;
600
597
} )
601
- . then ( ( ) => Promise . race ( [ Promise . resolve ( "c" ) ] ) )
602
- . catch ( ( error ) => {
603
- throw error ;
598
+ . then ( ( ) => Promise . race ( [ Promise . resolve ( "c" ) , Promise . resolve ( "d" ) ] ) )
599
+ . catch ( ( err ) => {
600
+ throw err ;
604
601
} ) ;
605
602
606
603
class Base {
0 commit comments