зеркало из https://github.com/mozilla/pjs.git
Added equals() method to override java.lang.Object.equals(). This is
necessary because the '==' operator won't work with LC2.
This commit is contained in:
Родитель
d4699b0f80
Коммит
c6cc90820d
|
@ -128,4 +128,17 @@ public final class JSObject {
|
|||
* JavaScript object.
|
||||
*/
|
||||
protected native void finalize();
|
||||
|
||||
/**
|
||||
* Override java.lang.Object.equals() because identity is not preserved
|
||||
* with instances of JSObject.
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
JSObject jsobj;
|
||||
|
||||
if (!(obj instanceof JSObject))
|
||||
return false;
|
||||
jsobj = (JSObject)obj;
|
||||
return (internal == jsobj.internal);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче