Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: backport 6d32be2 from v8's upstream #2916

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deps/v8/src/v8natives.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var GlobalFunction = global.Function;
var GlobalNumber = global.Number;
var GlobalObject = global.Object;
var InternalArray = utils.InternalArray;
var SetFunctionName = utils.SetFunctionName;

var MathAbs;
var ProxyDelegateCallAndConstruct;
Expand Down Expand Up @@ -1705,7 +1704,8 @@ function FunctionBind(this_arg) { // Length is 1.

var name = this.name;
var bound_name = IS_STRING(name) ? name : "";
SetFunctionName(result, bound_name, "bound");
%DefineDataPropertyUnchecked(result, "name", "bound " + bound_name,
DONT_ENUM | READ_ONLY);

// We already have caller and arguments properties on functions,
// which are non-configurable. It therefore makes no sence to
Expand Down
7 changes: 5 additions & 2 deletions deps/v8/test/mjsunit/function-bind-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
function f() {}
var fb = f.bind({});
assertEquals('bound f', fb.name);
assertEquals('function bound f() { [native code] }', fb.toString());

Object.defineProperty(f, 'name', {value: 42});
var fb2 = f.bind({});
assertEquals('bound ', fb2.name);
assertEquals('function bound () { [native code] }', fb2.toString());

function g() {}
var gb = g.bind({});
assertEquals('bound g', gb.name);
assertEquals('bound f', fb.name);