Commit 0fdc7ae
authored
Fix bind example test
The current bind example test will succeed even without using `@bind`. This is because of the way that `e.foo` is being called in the example test. When it is called like `e.foo()`, the `e` is to the left of the dot, so `e` is passed in as the `this` argument to the `foo` function. So the test `assert.equal(e.foo(), e)` will be `true` regardless of whether `@bind` is used. To fix this, we can change the test to `assert.equal(e.call(null), e)` to explicitly pass in `null` as the `this` argument for `foo` using `Function.prototype.call`.1 parent 660ead2 commit 0fdc7ae
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments