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

Unified Diff: test/mjsunit/regress/regress-bind-receiver.js

Issue 7892013: Fix for .bind regression. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 months 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
« src/execution.cc ('K') | « src/execution.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+
« src/execution.cc ('K') | « src/execution.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698