-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
10.0.1
-
x86_64
-
windows_10
A DESCRIPTION OF THE PROBLEM :
setter/getter with numeric property-names aren't working
in rhino it works...
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
if(typeof console == 'object') var print = console.log;
function X(){}
X.prototype = {};
var x = new X();
var s = null, g = null;
print(Object.defineProperty(X.prototype,'0',{get:function(){g = 1; return 1;},set:function(v){s = v;}}));
x['0'] = 6;
x['0'];
print("getter (1): "+g);
print("setter (6): "+s);
FREQUENCY : always
setter/getter with numeric property-names aren't working
in rhino it works...
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
if(typeof console == 'object') var print = console.log;
function X(){}
X.prototype = {};
var x = new X();
var s = null, g = null;
print(Object.defineProperty(X.prototype,'0',{get:function(){g = 1; return 1;},set:function(v){s = v;}}));
x['0'] = 6;
x['0'];
print("getter (1): "+g);
print("setter (6): "+s);
FREQUENCY : always
- duplicates
-
JDK-8201466 Nashorn: defineProperty setters/getters on prototype object ignored with numeric property names
-
- Resolved
-