28f7136ced
R=jkummerow@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/7892013 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
18 lines
655 B
JavaScript
18 lines
655 B
JavaScript
function strict() { 'use strict'; return this; }
|
|
function lenient() { return this; }
|
|
var obj = {};
|
|
|
|
assertEquals(true, strict.bind(true)());
|
|
assertEquals(42, strict.bind(42)());
|
|
assertEquals("", strict.bind("")());
|
|
assertEquals(null, strict.bind(null)()l);
|
|
assertEquals(undefined, strict.bind(undefined)());
|
|
assertEquals(obj, strict.bind(obj)());
|
|
|
|
assertEquals(true, lenient.bind(true)() instanceof Boolean);
|
|
assertEquals(true, lenient.bind(42)() instanceof Number);
|
|
assertEquals(true, lenient.bind("")() instanceof String);
|
|
assertEquals(this, lenient.bind(null)());
|
|
assertEquals(this, lenient.bind(undefined)());
|
|
assertEquals(obj, lenient.bind(obj)());
|