-
Bug
-
Resolution: Fixed
-
P4
-
None
-
8u31
-
x86
-
windows_8
A DESCRIPTION OF THE PROBLEM :
In the explanation of the Object.bindProperties() function, it should be noted that only properties of the second passed-in object "that do not exist in the first passed-in object yet" are bound.
The following example shows that changing the value of the global x does not change the value of obj.x, even though Object.bindProperties(this,obj) was done:
jjs> x = 2;
2
jjs> var obj = {x:3}
jjs> Object.bindProperties(this,obj)
[object global]
jjs> x
2
jjs> x = 4
4
jjs> obj.x
3
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/shell.html#sthref28
In the explanation of the Object.bindProperties() function, it should be noted that only properties of the second passed-in object "that do not exist in the first passed-in object yet" are bound.
The following example shows that changing the value of the global x does not change the value of obj.x, even though Object.bindProperties(this,obj) was done:
jjs> x = 2;
2
jjs> var obj = {x:3}
jjs> Object.bindProperties(this,obj)
[object global]
jjs> x
2
jjs> x = 4
4
jjs> obj.x
3
URL OF FAULTY DOCUMENTATION :
http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/shell.html#sthref28