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

Print this page




 155             this.writable = JSType.toBoolean(sobj.get(WRITABLE));
 156         } else {
 157             delete(WRITABLE, false);
 158         }
 159 
 160         if (sobj.has(VALUE)) {
 161             this.value = sobj.get(VALUE);
 162         } else {
 163             delete(VALUE, false);
 164         }
 165 
 166         return this;
 167     }
 168 
 169     @Override
 170     public int type() {
 171         return DATA;
 172     }
 173 
 174     @Override













 175     public boolean equals(final Object obj) {
 176         if (this == obj) {
 177             return true;
 178         }
 179         if (! (obj instanceof DataPropertyDescriptor)) {
 180             return false;
 181         }
 182 
 183         final DataPropertyDescriptor other = (DataPropertyDescriptor)obj;
 184         return sameValue(configurable, other.configurable) &&
 185                sameValue(enumerable, other.enumerable) &&
 186                sameValue(writable, other.writable) &&
 187                sameValue(value, other.value);
 188     }
 189 
 190     @Override
 191     public int hashCode() {
 192         int hash = 5;
 193         hash = 43 * hash + Objects.hashCode(this.configurable);
 194         hash = 43 * hash + Objects.hashCode(this.enumerable);


 155             this.writable = JSType.toBoolean(sobj.get(WRITABLE));
 156         } else {
 157             delete(WRITABLE, false);
 158         }
 159 
 160         if (sobj.has(VALUE)) {
 161             this.value = sobj.get(VALUE);
 162         } else {
 163             delete(VALUE, false);
 164         }
 165 
 166         return this;
 167     }
 168 
 169     @Override
 170     public int type() {
 171         return DATA;
 172     }
 173 
 174     @Override
 175     public boolean hasAndEquals(final PropertyDescriptor otherDesc) {
 176         if (! (otherDesc instanceof DataPropertyDescriptor)) {
 177             return false;
 178         }
 179 
 180         final DataPropertyDescriptor other = (DataPropertyDescriptor)otherDesc;
 181         return (!has(CONFIGURABLE) || sameValue(configurable, other.configurable)) &&
 182                (!has(ENUMERABLE) || sameValue(enumerable, other.enumerable)) &&
 183                (!has(WRITABLE) || sameValue(writable, other.writable)) &&
 184                (!has(VALUE) || sameValue(value, other.value));
 185     }
 186 
 187     @Override
 188     public boolean equals(final Object obj) {
 189         if (this == obj) {
 190             return true;
 191         }
 192         if (! (obj instanceof DataPropertyDescriptor)) {
 193             return false;
 194         }
 195 
 196         final DataPropertyDescriptor other = (DataPropertyDescriptor)obj;
 197         return sameValue(configurable, other.configurable) &&
 198                sameValue(enumerable, other.enumerable) &&
 199                sameValue(writable, other.writable) &&
 200                sameValue(value, other.value);
 201     }
 202 
 203     @Override
 204     public int hashCode() {
 205         int hash = 5;
 206         hash = 43 * hash + Objects.hashCode(this.configurable);
 207         hash = 43 * hash + Objects.hashCode(this.enumerable);