Name of bound function does not appear correctly in call stack
Reported by
cha...@bitovi.com,
Jun 14 2018
|
||||
Issue descriptionUserAgent: 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();
,
Jun 16 2018
,
Sep 25
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.
,
Sep 25
|
||||
►
Sign in to add a comment |
||||
Comment 1 by viswa.karala@chromium.org
, Jun 15 2018