Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
byroot
13y ago
0 comments
Save
Share
There is no way to be sure it can't be ever referenced:
function frame() { var str = "blah"; return function() { eval("console.log(str)"); } }
Edit: updated to use eval instead of setTimeout because setTimeout(string) do not share the scope.
0 comments
1 comments · 1 top-level
top
newest
oldest
masklinn
13y ago
eval already triggers a number of deoptimizations and specific behaviors because eval. It's not used in the example and thus entirely irrelevant.
j
/
k
navigate · click thread line to collapse