File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ Examples of **correct** code for this rule:
30
30
/* eslint guard-for-in: "error"*/
31
31
32
32
for (key in foo) {
33
+ if (Object .prototype .hasOwnProperty .call (foo, key)) {
34
+ doSomething (key);
35
+ }
33
36
if ({}.hasOwnProperty .call (foo, key)) {
34
37
doSomething (key);
35
38
}
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ Examples of **correct** code for this rule with the default `"all"` option:
47
47
48
48
(0 ).toString ();
49
49
50
+ (Object .prototype .toString .call ());
51
+
50
52
({}.toString .call ());
51
53
52
54
(function (){}) ? a () : b ();
@@ -121,6 +123,8 @@ Examples of **correct** code for this rule with the `"functions"` option:
121
123
122
124
(0 ).toString ();
123
125
126
+ (Object .prototype .toString .call ());
127
+
124
128
({}.toString .call ());
125
129
126
130
(function (){} ? a () : b ());
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ Examples of **correct** code for this rule:
23
23
``` js
24
24
/* eslint no-prototype-builtins: "error"*/
25
25
26
- var hasBarProperty = {} .hasOwnProperty .call (foo, " bar" );
26
+ var hasBarProperty = Object . prototype .hasOwnProperty .call (foo, " bar" );
27
27
28
- var isPrototypeOfBar = {} .isPrototypeOf .call (foo, bar);
28
+ var isPrototypeOfBar = Object . prototype .isPrototypeOf .call (foo, bar);
29
29
30
30
var barIsEnumerable = {}.propertyIsEnumerable .call (foo, " bar" );
31
31
```
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ function foo() {
18
18
console .log (arguments );
19
19
}
20
20
21
+ function foo (action ) {
22
+ var args = Array .prototype .slice .call (arguments , 1 );
23
+ action .apply (null , args);
24
+ }
25
+
21
26
function foo (action ) {
22
27
var args = [].slice .call (arguments , 1 );
23
28
action .apply (null , args);
You can’t perform that action at this time.
0 commit comments