Reviewers: Dan Ehrenberg, Toon Verwaest,

Message:
PTAL

I'll have to disable the stupid Blink tests again :'(

https://codereview.chromium.org/1214113005/diff/1/LayoutTests/inspector/sources/debugger/properties-special-expected.txt?context=100&column_width=80&tab_spaces=8

Description:
[es6] Bound function name

Instead of updating the SharedFuntionInfo set the name property on
the function directly.

BUG=v8:4278
LOG=N
[email protected], [email protected]
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

Please review this at https://codereview.chromium.org/1227523003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -4 lines):
  M src/v8natives.js
  M test/mjsunit/function-bind-name.js


Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 72cb8caa29c076e01856e9d76c9dc7c516226415..92769e25d2f0d96eda708111ee71533e66995d40 100644
--- a/src/v8natives.js
+++ b/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
Index: test/mjsunit/function-bind-name.js
diff --git a/test/mjsunit/function-bind-name.js b/test/mjsunit/function-bind-name.js index 3bebf3e72d9da5c2f11c2c6c3c13a9d918462d95..bbbc272918c424bc7b7955e0e04ace8bbde1da33 100644
--- a/test/mjsunit/function-bind-name.js
+++ b/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);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to