-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
None
-
generic
-
generic
A call from a nested function that requires a scope object to a function in a with-expression results in the latter function to be called with the global object rather than the with-expression as receiver.
The following script prints "error: [object global]" in Nashorn. It should not print anything.
var obj = {f: function() { return this; }};
with (obj) {
// a function designed to require a scope
var s = function() { var m = 1; x = function() { return m; }; return f(); }
if (s() !== obj) {
print("error: " + s());
}
}
The following script prints "error: [object global]" in Nashorn. It should not print anything.
var obj = {f: function() { return this; }};
with (obj) {
// a function designed to require a scope
var s = function() { var m = 1; x = function() { return m; }; return f(); }
if (s() !== obj) {
print("error: " + s());
}
}