summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/function-bind.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/function-bind.js')
-rw-r--r--deps/v8/test/mjsunit/function-bind.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/deps/v8/test/mjsunit/function-bind.js b/deps/v8/test/mjsunit/function-bind.js
index ca1ed7e489..826986943b 100644
--- a/deps/v8/test/mjsunit/function-bind.js
+++ b/deps/v8/test/mjsunit/function-bind.js
@@ -27,7 +27,8 @@
// Flags: --allow-natives-syntax
-// Tests the Function.prototype.bind (ES 15.3.4.5) method.
+// Tests the Function.prototype.bind method.
+
// Simple tests.
function foo(x, y, z) {
@@ -39,24 +40,29 @@ assertEquals(3, foo.length);
var f = foo.bind(foo);
assertEquals([foo, 3, 1], f(1, 2, 3));
assertEquals(3, f.length);
+assertEquals("function () { [native code] }", f.toString());
f = foo.bind(foo, 1);
assertEquals([foo, 3, 1], f(2, 3));
assertEquals(2, f.length);
+assertEquals("function () { [native code] }", f.toString());
f = foo.bind(foo, 1, 2);
assertEquals([foo, 3, 1], f(3));
assertEquals(1, f.length);
+assertEquals("function () { [native code] }", f.toString());
f = foo.bind(foo, 1, 2, 3);
assertEquals([foo, 3, 1], f());
assertEquals(0, f.length);
+assertEquals("function () { [native code] }", f.toString());
// Test that length works correctly even if more than the actual number
// of arguments are given when binding.
f = foo.bind(foo, 1, 2, 3, 4, 5, 6, 7, 8, 9);
assertEquals([foo, 9, 1], f());
assertEquals(0, f.length);
+assertEquals("function () { [native code] }", f.toString());
// Use a different bound object.
var obj = {x: 42, y: 43};
@@ -76,6 +82,7 @@ assertEquals(1, f.length);
f = f_bound_this.bind(obj, 2);
assertEquals(3, f());
assertEquals(0, f.length);
+assertEquals('[object Function]', Object.prototype.toString.call(f));
// Test chained binds.