Package org.mozilla.javascript
Class Undefined
java.lang.Object
org.mozilla.javascript.Undefined
- All Implemented Interfaces:
Serializable
This class implements the Undefined value in JavaScript.
We represent "undefined" internally using two static objects -- "Undefined.instance" and SCRIPTABLE_UNDEFINED. Java code that needs to make something undefined should generally use the first, and use the second if a Scriptable object is absolutely required.
Java code that needs to test whether something is undefined must use the "isUndefined" method because of the multiple internal representations.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Object
This is the standard value for "undefined" in Rhino.private static final int
static final Scriptable
An alternate representation of undefined, to be used only when we need to pass it to a method that takes as Scriptable as a parameter.private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
static boolean
isUndefined
(Object obj) Safely test whether "obj" is undefined.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
instance
This is the standard value for "undefined" in Rhino. Java code that needs to represent "undefined" should use this object (rather than a new instance of this class). -
instanceHash
private static final int instanceHash -
SCRIPTABLE_UNDEFINED
An alternate representation of undefined, to be used only when we need to pass it to a method that takes as Scriptable as a parameter. This is used when we need to pass undefined as the "this" parmeter of a Callable instance, because we cannot change that interface without breaking backward compatibility.
-
-
Constructor Details
-
Undefined
private Undefined()
-
-
Method Details
-
readResolve
-
equals
-
hashCode
public int hashCode() -
isUndefined
Safely test whether "obj" is undefined. Java code must use this function rather than testing the value directly since we have two representations of undefined in Rhino.
-