diff --git a/deps/v8/src/v8natives.js b/deps/v8/src/v8natives.js index 72cb8caa29c..92769e25d2f 100644 --- a/deps/v8/src/v8natives.js +++ b/deps/v8/src/v8natives.js @@ -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; @@ -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 diff --git a/deps/v8/test/mjsunit/function-bind-name.js b/deps/v8/test/mjsunit/function-bind-name.js index 3bebf3e72d9..bbbc272918c 100644 --- a/deps/v8/test/mjsunit/function-bind-name.js +++ b/deps/v8/test/mjsunit/function-bind-name.js @@ -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);