Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƫl Zasso <mic.besace@gmail.com>2015-09-16 22:00:32 +0300
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2015-09-17 04:04:07 +0300
commit96670ebe3724d86c26af9d417c98a6842e0d11e7 (patch)
tree430b02df50e65a7b7a10c11afa1379bc9bf752cb
parent94972d5b13a60240b7d1bce74072009c38c502e6 (diff)
deps: backport 6d32be2 from v8's upstream
Original commit message: [es6] Bound function name Instead of updating the SharedFuntionInfo set the name property on the function directly. BUG=v8:4278 LOG=N R=verwaest@chromium.org, littledan@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1227523003 Cr-Commit-Position: refs/heads/master@{#29558} Fixes: https://github.com/nodejs/node/issues/2754 PR-URL: https://github.com/nodejs/node/pull/2916 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
-rw-r--r--deps/v8/src/v8natives.js4
-rw-r--r--deps/v8/test/mjsunit/function-bind-name.js7
2 files changed, 7 insertions, 4 deletions
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);