Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: test/mjsunit/function-bind.js

Issue 1542963002: [runtime] Introduce dedicated JSBoundFunction to represent bound functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@FunctionConstructor
Patch Set: [arm64] Poke does not preserve flags with --debug-code. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/mjsunit/regress/regress-1229.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/function-bind.js
diff --git a/test/mjsunit/function-bind.js b/test/mjsunit/function-bind.js
index 9c1e1cb0d6f9e1d691f6fe3233730af102b61e72..826986943b9b0341e40cab7d824a212eb4f5afd2 100644
--- a/test/mjsunit/function-bind.js
+++ b/test/mjsunit/function-bind.js
@@ -40,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};
@@ -77,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.
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/mjsunit/regress/regress-1229.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698