149 final MethodHandle methodHandle = find.getSetter(type, NashornCallSiteDescriptor.isStrict(desc)); |
149 final MethodHandle methodHandle = find.getSetter(type, NashornCallSiteDescriptor.isStrict(desc)); |
150 |
150 |
151 assert methodHandle != null; |
151 assert methodHandle != null; |
152 assert property != null; |
152 assert property != null; |
153 |
153 |
|
154 final ScriptObject prototype = find.getOwner(); |
154 final MethodHandle boundHandle; |
155 final MethodHandle boundHandle; |
155 if (!property.hasSetterFunction() && find.isInherited()) { |
156 if (!property.hasSetterFunction(prototype) && find.isInherited()) { |
156 boundHandle = ScriptObject.bindTo(methodHandle, find.getOwner()); |
157 boundHandle = ScriptObject.bindTo(methodHandle, prototype); |
157 } else { |
158 } else { |
158 boundHandle = methodHandle; |
159 boundHandle = methodHandle; |
159 } |
160 } |
160 return new SetMethod(boundHandle, property); |
161 return new SetMethod(boundHandle, property); |
161 } |
162 } |