src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
changeset 47738 e4d7a32e6a91
parent 47713 530f16bacbfd
child 48247 fa5a47cad0c9
equal deleted inserted replaced
47737:acfedb75dd51 47738:e4d7a32e6a91
  2048         assert property != null;
  2048         assert property != null;
  2049         assert property.needsDeclaration();
  2049         assert property.needsDeclaration();
  2050 
  2050 
  2051         final PropertyMap newMap = oldMap.replaceProperty(property, property.removeFlags(Property.NEEDS_DECLARATION));
  2051         final PropertyMap newMap = oldMap.replaceProperty(property, property.removeFlags(Property.NEEDS_DECLARATION));
  2052         setMap(newMap);
  2052         setMap(newMap);
  2053         set(key, value, 0);
  2053         set(key, value, NashornCallSiteDescriptor.CALLSITE_DECLARE);
  2054     }
  2054     }
  2055 
  2055 
  2056     /**
  2056     /**
  2057      * Find the appropriate GETINDEX method for an invoke dynamic call.
  2057      * Find the appropriate GETINDEX method for an invoke dynamic call.
  2058      *
  2058      *
  3069                 f = null;
  3069                 f = null;
  3070             }
  3070             }
  3071         }
  3071         }
  3072 
  3072 
  3073         if (f != null) {
  3073         if (f != null) {
  3074             if (!f.getProperty().isWritable() || !f.getProperty().hasNativeSetter()) {
  3074             if ((!f.getProperty().isWritable() && !NashornCallSiteDescriptor.isDeclaration(callSiteFlags)) || !f.getProperty().hasNativeSetter()) {
  3075                 if (isScopeFlag(callSiteFlags) && f.getProperty().isLexicalBinding()) {
  3075                 if (isScopeFlag(callSiteFlags) && f.getProperty().isLexicalBinding()) {
  3076                     throw typeError("assign.constant", key.toString()); // Overwriting ES6 const should throw also in non-strict mode.
  3076                     throw typeError("assign.constant", key.toString()); // Overwriting ES6 const should throw also in non-strict mode.
  3077                 }
  3077                 }
  3078                 if (isStrictFlag(callSiteFlags)) {
  3078                 if (isStrictFlag(callSiteFlags)) {
  3079                     throw typeError(
  3079                     throw typeError(