Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8204651

setter/getter with numeric property-name

XMLWordPrintable

      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


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: