New issue
Advanced search Search tips

Issue 852924 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Sep 25
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Name of bound function does not appear correctly in call stack

Reported by cha...@bitovi.com, Jun 14 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

Steps to reproduce the problem:
1. Go to https://jsbin.com/kahuqotaqi/1/edit?html,js,output
2. Open DevTools
3. Click the “Run with JS” button in the Output panel of JS Bin

What is the expected behavior?
Under Call Stack in DevTools’ sources, the first item in the list would be “Func 2 name”.

What went wrong?
The call stack shows “Func 1 name”; a new name can be assigned to functions created with .bind(), but their new name won’t show up in the DevTools call stack.

Did this work before? No 

Chrome version: 67.0.3396.87  Channel: stable
OS Version: OS X 10.13.5
Flash Version: 

Code to reproduce this for posterity:

const func1 = function() {
  debugger;
};
Object.defineProperty(func1, "name", {
  value: "Func 1 name"
});

const func2 = func1.bind(window);
Object.defineProperty(func2, "name", {
  value: "Func 2 name"
});

func2();
 
Labels: Needs-Triage-M67

Comment 2 by l...@chromium.org, Jun 16 2018

Owner: kozy@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Fixed (was: Assigned)
It is intended behavior, when function is called, V8 stores the target function only. Unfortunately, we can not afford to store bound function as well since this code is critical for performance.
Status: WontFix (was: Fixed)

Sign in to add a comment