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

Unified Diff: src/v8natives.js

Issue 2878057: Fix some bugs in Function.prototype.bind implementation. (Closed)
Patch Set: Created 10 years, 5 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
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 18e56c38ef5ada19a43fa4ef0da68530cc0deeaf..6eb13719638a9359fb30e3361e660b990e2fc8cb 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1105,7 +1105,7 @@ function FunctionBind(this_arg) { // Length is 1.
throw new $TypeError('Bind must be called on a function');
}
// this_arg is not an argument that should be bound.
- var argc_bound = %_ArgumentsLength() - 1;
+ var argc_bound = (%_ArgumentsLength() || 1) - 1;
if (argc_bound > 0) {
var bound_args = new $Array(argc_bound);
for(var i = 0; i < argc_bound; i++) {
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698