src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
equal
deleted
inserted
replaced
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( |