Package org.mozilla.javascript
Class NativeMath
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.NativeMath
- All Implemented Interfaces:
Serializable
,ConstProperties
,DebuggableObject
,IdFunctionCall
,Scriptable
,SymbolScriptable
This class implements the Math native object. See ECMA 15.8.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Double
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final double
private static final Object
private static final int
private static final long
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecIdCall
(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) 'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.protected int
Return the name of the class.(package private) static void
init
(Scriptable scope, boolean sealed) protected void
initPrototypeId
(int id) private static double
private static int
private static double
js_pow
(double x, double y) private static double
js_trunc
(double d) Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getIds, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
Methods inherited from class org.mozilla.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
MATH_TAG
-
LOG2E
private static final double LOG2E- See Also:
-
Double32
-
Id_toSource
private static final int Id_toSource- See Also:
-
Id_abs
private static final int Id_abs- See Also:
-
Id_acos
private static final int Id_acos- See Also:
-
Id_asin
private static final int Id_asin- See Also:
-
Id_atan
private static final int Id_atan- See Also:
-
Id_atan2
private static final int Id_atan2- See Also:
-
Id_ceil
private static final int Id_ceil- See Also:
-
Id_cos
private static final int Id_cos- See Also:
-
Id_exp
private static final int Id_exp- See Also:
-
Id_floor
private static final int Id_floor- See Also:
-
Id_log
private static final int Id_log- See Also:
-
Id_max
private static final int Id_max- See Also:
-
Id_min
private static final int Id_min- See Also:
-
Id_pow
private static final int Id_pow- See Also:
-
Id_random
private static final int Id_random- See Also:
-
Id_round
private static final int Id_round- See Also:
-
Id_sin
private static final int Id_sin- See Also:
-
Id_sqrt
private static final int Id_sqrt- See Also:
-
Id_tan
private static final int Id_tan- See Also:
-
Id_cbrt
private static final int Id_cbrt- See Also:
-
Id_cosh
private static final int Id_cosh- See Also:
-
Id_expm1
private static final int Id_expm1- See Also:
-
Id_hypot
private static final int Id_hypot- See Also:
-
Id_log1p
private static final int Id_log1p- See Also:
-
Id_log10
private static final int Id_log10- See Also:
-
Id_sinh
private static final int Id_sinh- See Also:
-
Id_tanh
private static final int Id_tanh- See Also:
-
Id_imul
private static final int Id_imul- See Also:
-
Id_trunc
private static final int Id_trunc- See Also:
-
Id_acosh
private static final int Id_acosh- See Also:
-
Id_asinh
private static final int Id_asinh- See Also:
-
Id_atanh
private static final int Id_atanh- See Also:
-
Id_sign
private static final int Id_sign- See Also:
-
Id_log2
private static final int Id_log2- See Also:
-
Id_fround
private static final int Id_fround- See Also:
-
Id_clz32
private static final int Id_clz32- See Also:
-
LAST_METHOD_ID
private static final int LAST_METHOD_ID- See Also:
-
Id_E
private static final int Id_E- See Also:
-
Id_PI
private static final int Id_PI- See Also:
-
Id_LN10
private static final int Id_LN10- See Also:
-
Id_LN2
private static final int Id_LN2- See Also:
-
Id_LOG2E
private static final int Id_LOG2E- See Also:
-
Id_LOG10E
private static final int Id_LOG10E- See Also:
-
Id_SQRT1_2
private static final int Id_SQRT1_2- See Also:
-
Id_SQRT2
private static final int Id_SQRT2- See Also:
-
MAX_ID
private static final int MAX_ID- See Also:
-
-
Constructor Details
-
NativeMath
private NativeMath()
-
-
Method Details
-
init
-
getClassName
Description copied from class:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id) - Overrides:
initPrototypeId
in classIdScriptableObject
-
execIdCall
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) Description copied from class:IdScriptableObject
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.- Specified by:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in classIdScriptableObject
-
js_pow
private static double js_pow(double x, double y) -
js_hypot
-
js_trunc
private static double js_trunc(double d) -
js_imul
-
findPrototypeId
- Overrides:
findPrototypeId
in classIdScriptableObject
-