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

Issue 3046010: Implement Function.prototype.bind (ES5 15.3.4.5).... (Closed)

Created:
10 years, 5 months ago by Rico
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein, aaron.heckmann, Mads Ager (chromium)
CC:
v8-dev
Visibility:
Public.

Description

Implement Function.prototype.bind (ES5 15.3.4.5). Please note that we do not implement correctly the setting of caller and arguments on the returned objects, since we already have these properties on function objects (and they are non-configurable). Also corrects indention in DefineOwnProperty. Committed: http://code.google.com/p/v8/source/detail?r=5124

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 9

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 4

Patch Set 6 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+273 lines, -15 lines) Patch
M src/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 chunk +21 lines, -0 lines 0 comments Download
M src/v8natives.js View 1 2 3 4 5 3 chunks +67 lines, -15 lines 1 comment Download
A test/mjsunit/function-bind.js View 2 3 4 5 1 chunk +184 lines, -0 lines 1 comment Download

Messages

Total messages: 7 (0 generated)
Rico
10 years, 5 months ago (2010-07-22 14:36:53 UTC) #1
Mads Ager (chromium)
LGTM with these comments addressed. http://codereview.chromium.org/3046010/diff/10001/11003 File src/v8natives.js (right): http://codereview.chromium.org/3046010/diff/10001/11003#newcode1126 src/v8natives.js:1126: args.unshift.apply(args, boundArgs); Could we ...
10 years, 5 months ago (2010-07-23 06:31:27 UTC) #2
Rico
Mads, please take another look. Changed thisArg to this_arg and boundArgs to bound_args. Refactored argument ...
10 years, 5 months ago (2010-07-23 07:45:14 UTC) #3
Mads Ager (chromium)
Fix length setting and this LGTM. http://codereview.chromium.org/3046010/diff/17001/18003 File src/v8natives.js (right): http://codereview.chromium.org/3046010/diff/17001/18003#newcode1146 src/v8natives.js:1146: %FunctionSetLength(result, this.length - ...
10 years, 5 months ago (2010-07-23 08:36:22 UTC) #4
Rico
http://codereview.chromium.org/3046010/diff/17001/18003 File src/v8natives.js (right): http://codereview.chromium.org/3046010/diff/17001/18003#newcode1146 src/v8natives.js:1146: %FunctionSetLength(result, this.length - argc_bound); On 2010/07/23 08:36:23, Mads Ager ...
10 years, 5 months ago (2010-07-23 10:08:51 UTC) #5
Lasse Reichstein
Late comment. http://codereview.chromium.org/3046010/diff/6006/24004 File test/mjsunit/function-bind.js (right): http://codereview.chromium.org/3046010/diff/6006/24004#newcode183 test/mjsunit/function-bind.js:183: assertFalse(obj2 instanceof f); This should be assertTrue ...
10 years, 5 months ago (2010-07-25 11:45:10 UTC) #6
Aaron.Heckmann_gmail.com
10 years, 5 months ago (2010-07-27 02:21:47 UTC) #7
global.print throws an error in node.js and should be removed.

http://codereview.chromium.org/3046010/diff/6006/24003
File src/v8natives.js (right):

http://codereview.chromium.org/3046010/diff/6006/24003#newcode1115
src/v8natives.js:1115: global.print(argc_bound);
Looks like this line should be removed?

Powered by Google App Engine
This is Rietveld 408576698