OLD | NEW |
---|---|
(Empty) | |
1 function strict() { 'use strict'; return this; } | |
2 function lenient() { return this; } | |
3 var obj = {}; | |
4 | |
5 assertEquals(strict.bind(true)(), true); | |
Jakob Kummerow
2011/09/13 17:09:54
assertEquals takes the expected value as the first
rossberg
2011/09/13 17:14:00
Done. (Had C&P'ed this from Webkit.)
| |
6 assertEquals(strict.bind(42)(), 42); | |
7 assertEquals(strict.bind("")(), ""); | |
8 assertEquals(strict.bind(null)(), null); | |
9 assertEquals(strict.bind(undefined)(), undefined); | |
10 assertEquals(strict.bind(obj)(), obj); | |
11 | |
12 assertEquals(lenient.bind(true)() instanceof Boolean, true); | |
13 assertEquals(lenient.bind(42)() instanceof Number, true); | |
14 assertEquals(lenient.bind("")() instanceof String, true); | |
15 assertEquals(lenient.bind(null)(), this); | |
16 assertEquals(lenient.bind(undefined)(), this); | |
17 assertEquals(lenient.bind(obj)(), obj); | |
18 | |
OLD | NEW |