LiveEdit: works incorrect for nested function
Reported by
x.ce...@gmail.com,
Nov 24 2016
|
|||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2929.4 Safari/537.36
Steps to reproduce the problem:
for example I have a code
```
function abc() {
var a = 123;
setInterval(function(){
console.log(a);
}, 1000);
}
```
What is the expected behavior?
nested functions should also recompiled or change its closure scopes
What went wrong?
if I change "a" variable value to any other setInterval's function still linked with old "a" value
Did this work before? N/A
Chrome version: 57.0.2929.4 Channel: canary
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 24.0 r0
,
Nov 25 2016
,
Nov 28 2016
,
Jun 16 2017
,
Jun 16 2017
,
Jun 26 2018
It is expected. It is possible to edit callback passed into setInterval and change value there using liveedit as shown in comment #2. When you change value in outer scope we replace outer function code with new one but we do not run this function again since we only restart functions which are currently on stack. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by jmukthavaram@chromium.org
, Nov 25 2016Labels: Needs-Feedback
620 KB
620 KB View Download