src/jdk/nashorn/internal/objects/GenericPropertyDescriptor.java

Print this page




  38 /**
  39  * Generic Property descriptor is used to represent attributes an object property
  40  * that is neither a data property descriptor nor an accessor property descriptor.
  41  *
  42  * See ECMA 8.10 The Property Descriptor and Property Identifier Specification Types
  43  *
  44  */
  45 @ScriptClass("GenericPropertyDescriptor")
  46 public final class GenericPropertyDescriptor extends ScriptObject implements PropertyDescriptor {
  47     /** Is the property configurable? */
  48     @Property
  49     public Object configurable;
  50 
  51     /** Is the property writable? */
  52     @Property
  53     public Object enumerable;
  54 
  55     // initialized by nasgen
  56     private static PropertyMap $nasgenmap$;
  57 
  58     static PropertyMap getInitialMap() {
  59         return $nasgenmap$;
  60     }
  61 
  62     GenericPropertyDescriptor(final boolean configurable, final boolean enumerable, final Global global) {
  63         super(global.getObjectPrototype(), getInitialMap());
  64         this.configurable = configurable;
  65         this.enumerable   = enumerable;
  66     }
  67 
  68     @Override
  69     public boolean isConfigurable() {
  70         return JSType.toBoolean(configurable);
  71     }
  72 
  73     @Override
  74     public boolean isEnumerable() {
  75         return JSType.toBoolean(enumerable);
  76     }
  77 
  78     @Override
  79     public boolean isWritable() {
  80         // Not applicable for this. But simplifies flag calculations.
  81         return false;
  82     }
  83 




  38 /**
  39  * Generic Property descriptor is used to represent attributes an object property
  40  * that is neither a data property descriptor nor an accessor property descriptor.
  41  *
  42  * See ECMA 8.10 The Property Descriptor and Property Identifier Specification Types
  43  *
  44  */
  45 @ScriptClass("GenericPropertyDescriptor")
  46 public final class GenericPropertyDescriptor extends ScriptObject implements PropertyDescriptor {
  47     /** Is the property configurable? */
  48     @Property
  49     public Object configurable;
  50 
  51     /** Is the property writable? */
  52     @Property
  53     public Object enumerable;
  54 
  55     // initialized by nasgen
  56     private static PropertyMap $nasgenmap$;
  57 




  58     GenericPropertyDescriptor(final boolean configurable, final boolean enumerable, final Global global) {
  59         super(global.getObjectPrototype(), $nasgenmap$);
  60         this.configurable = configurable;
  61         this.enumerable   = enumerable;
  62     }
  63 
  64     @Override
  65     public boolean isConfigurable() {
  66         return JSType.toBoolean(configurable);
  67     }
  68 
  69     @Override
  70     public boolean isEnumerable() {
  71         return JSType.toBoolean(enumerable);
  72     }
  73 
  74     @Override
  75     public boolean isWritable() {
  76         // Not applicable for this. But simplifies flag calculations.
  77         return false;
  78     }
  79