You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a let variable is captured by a function, it's value at the time it was captured should be used. Currently, Ladybird behaves as if a var variable was being captured.
Example:
<!DOCTYPE html><script>letresult="";letfunctionList=[];for(leti=0;i<9;i++){functionList.push(function(){returni;});}for(leti=0;i<functionList.length;i++){result+=functionList[i]();}// Output in Ladybird is: 999999999.// Output should be: 012345678.console.log(result);</script>
When a
let
variable is captured by a function, it's value at the time it was captured should be used. Currently, Ladybird behaves as if avar
variable was being captured.Example:
I initially spotted this while working on #23544, looking at this WPT subtest.
The text was updated successfully, but these errors were encountered: