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

changeset 1526
d731e6ba5037
parent 1515
4db30ae9ff23
child 1527
340b1462f3e2
equal deleted inserted replaced
1525:e93960ae0b1e 1526:d731e6ba5037
222 * {@code map} without invalidating the map as calling {@link #setProto(ScriptObject)} 222 * {@code map} without invalidating the map as calling {@link #setProto(ScriptObject)}
223 * would do. This should only be used for objects that are always constructed with the 223 * would do. This should only be used for objects that are always constructed with the
224 * same combination of prototype and property map. 224 * same combination of prototype and property map.
225 * 225 *
226 * @param proto the prototype object 226 * @param proto the prototype object
227 * @param map intial {@link PropertyMap} 227 * @param map initial {@link PropertyMap}
228 */ 228 */
229 protected ScriptObject(final ScriptObject proto, final PropertyMap map) { 229 protected ScriptObject(final ScriptObject proto, final PropertyMap map) {
230 this(map); 230 this(map);
231 this.proto = proto; 231 this.proto = proto;
232 } 232 }
1255 final ScriptObject oldProto = proto; 1255 final ScriptObject oldProto = proto;
1256 1256
1257 if (oldProto != newProto) { 1257 if (oldProto != newProto) {
1258 proto = newProto; 1258 proto = newProto;
1259 1259
1260 // Let current listeners know that the protototype has changed and set our map 1260 // Let current listeners know that the prototype has changed and set our map
1261 final PropertyListeners listeners = getMap().getListeners(); 1261 final PropertyListeners listeners = getMap().getListeners();
1262 if (listeners != null) { 1262 if (listeners != null) {
1263 listeners.protoChanged(); 1263 listeners.protoChanged();
1264 } 1264 }
1265 // Replace our current allocator map with one that is associated with the new prototype. 1265 // Replace our current allocator map with one that is associated with the new prototype.
1450 /** 1450 /**
1451 * Checking whether a script object is an instance of another. Used 1451 * Checking whether a script object is an instance of another. Used
1452 * in {@link ScriptFunction} for hasInstance implementation, walks 1452 * in {@link ScriptFunction} for hasInstance implementation, walks
1453 * the proto chain 1453 * the proto chain
1454 * 1454 *
1455 * @param instance instace to check 1455 * @param instance instance to check
1456 * @return true if 'instance' is an instance of this object 1456 * @return true if 'instance' is an instance of this object
1457 */ 1457 */
1458 public boolean isInstance(final ScriptObject instance) { 1458 public boolean isInstance(final ScriptObject instance) {
1459 return false; 1459 return false;
1460 } 1460 }
1867 * This generates "not a function" always 1867 * This generates "not a function" always
1868 * 1868 *
1869 * @param desc the call site descriptor. 1869 * @param desc the call site descriptor.
1870 * @param request the link request 1870 * @param request the link request
1871 * 1871 *
1872 * @return GuardedInvocation to be invoed at call site. 1872 * @return GuardedInvocation to be invoked at call site.
1873 */ 1873 */
1874 protected GuardedInvocation findCallMethod(final CallSiteDescriptor desc, final LinkRequest request) { 1874 protected GuardedInvocation findCallMethod(final CallSiteDescriptor desc, final LinkRequest request) {
1875 return notAFunction(desc); 1875 return notAFunction(desc);
1876 } 1876 }
1877 1877

mercurial