Skip to content

Commit

Permalink
Docs: correction in prefer-reflect docs (fixes #7069) (#7150)
Browse files Browse the repository at this point in the history
  • Loading branch information
sstern6 authored and kaicataldo committed Sep 28, 2016
1 parent e3f95de commit 66adac1
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions docs/rules/prefer-reflect.md
Expand Up @@ -38,30 +38,30 @@ Examples of **incorrect** code for this rule when used without exceptions:
```js
/*eslint prefer-reflect: "error"*/

foo.apply(undefined, args);
foo.apply(null, args);
obj.foo.apply(obj, args);
obj.foo.apply(other, args);

foo.call(undefined, arg);
foo.call(null, arg);
obj.foo.call(obj, arg);
obj.foo.call(other, arg);
myFunction.apply(undefined, args);
myFunction.apply(null, args);
obj.myMethod.apply(obj, args);
obj.myMethod.apply(other, args);

myFunction.call(undefined, arg);
myFunction.call(null, arg);
obj.myMethod.call(obj, arg);
obj.myMethod.call(other, arg);
```

Examples of **correct** code for this rule when used without exceptions:

```js
/*eslint prefer-reflect: "error"*/

Reflect.apply(undefined, args);
Reflect.apply(null, args);
Reflect.apply(obj.foo, obj, args);
Reflect.apply(obj.foo, other, args);
Reflect.apply(undefined, [arg]);
Reflect.apply(null, [arg]);
Reflect.apply(obj.foo, obj, [arg]);
Reflect.apply(obj.foo, other, [arg]);
Reflect.apply(myFunction, undefined, args);
Reflect.apply(myFunction, null, args);
Reflect.apply(obj.myMethod, obj, args);
Reflect.apply(obj.myMethod, other, args);
Reflect.apply(myFunction, undefined, [arg]);
Reflect.apply(myFunction, null, [arg]);
Reflect.apply(obj.myMethod, obj, [arg]);
Reflect.apply(obj.myMethod, other, [arg]);
```

Examples of **correct** code for this rule with the `{ "exceptions": ["apply"] }` option:
Expand All @@ -70,10 +70,10 @@ Examples of **correct** code for this rule with the `{ "exceptions": ["apply"] }
/*eslint prefer-reflect: ["error", { "exceptions": ["apply"] }]*/

// in addition to Reflect.apply(...):
foo.apply(undefined, args);
foo.apply(null, args);
obj.foo.apply(obj, args);
obj.foo.apply(other, args);
myFunction.apply(undefined, args);
myFunction.apply(null, args);
obj.myMethod.apply(obj, args);
obj.myMethod.apply(other, args);
```

Examples of **correct** code for this rule with the `{ "exceptions": ["call"] }` option:
Expand All @@ -82,10 +82,10 @@ Examples of **correct** code for this rule with the `{ "exceptions": ["call"] }`
/*eslint prefer-reflect: ["error", { "exceptions": ["call"] }]*/

// in addition to Reflect.apply(...):
foo.call(undefined, arg);
foo.call(null, arg);
obj.foo.call(obj, arg);
obj.foo.call(other, arg);
myFunction.call(undefined, arg);
myFunction.call(null, arg);
obj.myMethod.call(obj, arg);
obj.myMethod.call(other, arg);
```

### Reflect.defineProperty
Expand Down

0 comments on commit 66adac1

Please sign in to comment.