src/jdk/nashorn/internal/runtime/SetMethodCreator.java

changeset 379
682889823712
parent 291
fdfb4edd78d6
child 753
2f55fa4b2e88
equal deleted inserted replaced
378:39e17373d8df 379:682889823712
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 }

mercurial