-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
P4
-
Affects Version/s: 9
-
Component/s: core-libs
-
None
-
generic
-
generic
The below program correctly prints "tada!" when run on v8; it incorrectly prints "TypeError: Cannot read property "x" from undefined" with Nashorn. The reason is that the self-symbol in the expression ("f") is not recognized as being potentially used when the function has eval inside of itself.
var g = function f() { print(eval("f.x")) }
g.x = "tada!"
g()
var g = function f() { print(eval("f.x")) }
g.x = "tada!"
g()