Chromium Code Reviews| Index: test/mjsunit/regress/regress-bind-receiver.js |
| diff --git a/test/mjsunit/regress/regress-bind-receiver.js b/test/mjsunit/regress/regress-bind-receiver.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6cbde33bd48f6a43c79a9bc7319d0d0ef6b50c13 |
| --- /dev/null |
| +++ b/test/mjsunit/regress/regress-bind-receiver.js |
| @@ -0,0 +1,18 @@ |
| +function strict() { 'use strict'; return this; } |
| +function lenient() { return this; } |
| +var obj = {}; |
| + |
| +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.)
|
| +assertEquals(strict.bind(42)(), 42); |
| +assertEquals(strict.bind("")(), ""); |
| +assertEquals(strict.bind(null)(), null); |
| +assertEquals(strict.bind(undefined)(), undefined); |
| +assertEquals(strict.bind(obj)(), obj); |
| + |
| +assertEquals(lenient.bind(true)() instanceof Boolean, true); |
| +assertEquals(lenient.bind(42)() instanceof Number, true); |
| +assertEquals(lenient.bind("")() instanceof String, true); |
| +assertEquals(lenient.bind(null)(), this); |
| +assertEquals(lenient.bind(undefined)(), this); |
| +assertEquals(lenient.bind(obj)(), obj); |
| + |