- Author:
- Norris Boyd
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThis is returned from the various "getFooAndThis" methods, so it can return the result, the appropriate "this" object, and the name of the property so that a proper exception can be thrown if the result is not a function.static interfaceThis is an interface defining a message provider.static final classHelper to return a string or an integer. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<?>static final Class<?>static final Class<?>static final Class<?>static final Class<?>static final Class<?>static final Class<?>static final Class<?>static final Class<?>static final Object[]static final String[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Class<?>static final Class<?>static final Class<?>static final Class<?>static final ScriptRuntime.MessageProviderstatic final doublestatic final Doublestatic final doublestatic final Doublestatic final Class<?>static final Class<?>static final Class<Scriptable>static final Class<?>static final Class<?>static final Class<?>static final Integer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CharSequenceadd(CharSequence val1, Object val2) Deprecated.static Objectstatic CharSequenceadd(Object val1, CharSequence val2) Deprecated.Useadd(Object, Object, Context)insteadstatic Objectstatic voidaddInstructionCount(Context cx, int instructionsToAdd) static longadvanceStringIndex(String string, long index, boolean unicode) Implements the abstract operation AdvanceStringIndex.static ObjectapplyOrCall(boolean isApply, Context cx, VarScope scope, Object thisObj, Object[] args) Function.prototype.apply and Function.prototype.callstatic StringbigIntToString(BigInteger n, int base) static VarScopeReturns the object in the scope chain that has a given property.static doublebitwiseAND(double val1, double val2) static NumberbitwiseAND(Number val1, Number val2) static NumberbitwiseNOT(Number val) static doublebitwiseOR(double val1, double val2) static Numberstatic doublebitwiseXOR(double val1, double val2) static NumberbitwiseXOR(Number val1, Number val2) static ObjectDeprecated.The method is only present for compatibility.static ObjectcallIterator(Object obj, Context cx, VarScope scope) Given an object, get the "Symbol.iterator" element, throw a TypeError if it is not present, then call the result, (throwing a TypeError if the result is not a function), and return that result, whatever it is.static RefPerform function call in reference context.static ObjectcallSpecial(Context cx, Callable fun, Scriptable thisObj, Object[] args, VarScope scope, Object callerThis, int callType, String filename, int lineNumber, boolean isOptionalChainingCall) If "arg" is a "canonical numeric index," which means any number constructed from a string that doesn't have extra whitespace or non-standard formatting, return it -- otherwise return an empty option.static RegExpProxystatic intclamp(int value, int min, int max) Clamps value between min and max, inclusive.static booleanstatic booleanstatic booleancompareTo(double d1, double d2, int op) static Objectstatic EcmaErrorconstructError(String error, String message) static EcmaErrorconstructError(String error, String message, int lineNumberDelta) static EcmaErrorconstructError(String error, String message, String sourceName, int lineNumber, String lineSource, int columnNumber) static VarScopecreateArrowFunctionActivation(JSFunction funObj, Context cx, VarScope scope, Object[] args, boolean argsHasRest, boolean requiresArgumentObject) static VarScopecreateFunctionActivation(JSFunction funObj, Context cx, VarScope scope, Object[] args, boolean argsHasRest, boolean requiresArgumentObject) static VarScopecreateFunctionActivation(JSFunction funObj, VarScope scope, Object[] args) Deprecated.static voiddefineConst(Context cx, VarScope scope, String name) Creates an uninitialized const binding, to be initialized by its declaration.static ObjectDeprecated.static ObjectDeprecated.static ObjectThe delete operatorstatic <T extends PropHolder<T>>
booleandeleteObjectElem(T target, Object elem, Context cx) static voidDeprecated, for removal: This API element is subject to removal in a future version.static Numberstatic ScriptabledoObjectRest(Context cx, VarScope scope, Object source, Object[] excludeKeys) Helper for object rest properties in destructuring.static ObjectDeprecated.static ObjectdoTopCall(Callable callable, Context cx, VarScope scope, Object thisObj, Object[] args, boolean isTopLevelStrict) static ObjectDeprecated.static Objectstatic ObjectelemIncrDecr(Object obj, Object index, Context cx, int incrDecrMask) Deprecated.static ObjectelemIncrDecr(Object obj, Object index, Context cx, VarScope scope, int incrDecrMask) static voidenterActivationFunction(Context cx, VarScope scope) static VarScopeenterDotQuery(Object value, VarScope scope) static booleanenterFunctionStrictness(Context cx, boolean functionIsStrict) static VarScopeenterScope(VarScope scope) static VarScopestatic Objectstatic ObjectDeprecated.UseenumInit(Object, Context, VarScope, int)insteadstatic ObjectDeprecated.UseenumInit(Object, Context, VarScope, int)insteadstatic Objectstatic BooleanDeprecated.since 1.7.15.static Booleanstatic Objectstatic booleanImplement "IsLooselyEqual" from ECMA-262 (sec-islooselyequal), the abstract operation behind the == and !static StringescapeAttributeValue(Object value, Context cx) Escapes the reserved characters in a value of an attributestatic Stringstatic StringescapeString(String s, char escapeQuote) For escaping strings printed by object and array literals; not quite the same as 'escape.'static StringescapeTextValue(Object value, Context cx) Escapes the reserved characters in a value of a text nodestatic ObjectevalSpecial(Context cx, VarScope scope, Object thisArg, Object[] args, String filename, int lineNumber, boolean isStrict) The eval function property of the global object.static voidstatic voidexitFunctionStrictness(Context cx, boolean parentWasStrict) static Numberexponentiate(Number val1, Number val2) static voidfillObjectLiteral(Scriptable object, Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, VarScope scope) static ScriptablefindPrototype(JSFunction f, Object nt, TopLevel.Builtins type) static ScriptablefindPrototype(JSFunction f, Object nt, org.htmlunit.corejs.javascript.TopLevel.NativeErrors type) static ScriptablegetApplyOrCallThis(Context cx, VarScope scope, Object arg0, int l, Function target) static Object[]getArrayElements(Context cx, Scriptable object) static ScriptRuntime.LookupResultgetElemAndThis(Object obj, Object elem, Context cx, VarScope scope) Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available in the result.static ScriptRuntime.LookupResultgetElemAndThisOptional(Object obj, Object elem, Context cx, VarScope scope) static CallablegetElemFunctionAndThis(Object obj, Object elem, Context cx) Deprecated.static CallablegetElemFunctionAndThis(Object obj, Object elem, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.static CallablegetElemFunctionAndThisOptional(Object obj, Object elem, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.static FunctiongetExistingCtor(Context cx, VarScope scope, String constructorName) static FunctiongetExistingCtor(Context cx, VarScope scope, SymbolKey constructorName) static TopLevelstatic ScopeObjectgetLibraryScopeOrNull(VarScope scope) static StringgetMessage(String messageId, Object[] arguments) Deprecated.UsegetMessageById(String messageId, Object...args)insteadstatic StringgetMessage0(String messageId) Deprecated.UsegetMessageById(String messageId, Object...args)insteadstatic StringgetMessage1(String messageId, Object arg1) Deprecated.UsegetMessageById(String messageId, Object...args)insteadstatic StringgetMessage2(String messageId, Object arg1, Object arg2) Deprecated.UsegetMessageById(String messageId, Object...args)insteadstatic StringgetMessage3(String messageId, Object arg1, Object arg2, Object arg3) Deprecated.UsegetMessageById(String messageId, Object...args)insteadstatic StringDeprecated.UsegetMessageById(String messageId, Object...args)insteadstatic StringgetMessageById(String messageId, Object... args) static ScriptRuntime.LookupResultgetNameAndThis(String name, Context cx, VarScope scope) Prepare for calling name(...): return function corresponding to name and make current top scope available as part of the result.static ScriptRuntime.LookupResultgetNameAndThisOptional(String name, Context cx, VarScope scope) static CallablegetNameFunctionAndThis(String name, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.static CallablegetNameFunctionAndThisOptional(String name, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.static ObjectgetObjectElem(Object obj, Object elem, Context cx) Deprecated.UsegetObjectElem(Object, Object, Context, VarScope)insteadstatic ObjectgetObjectElem(Object obj, Object elem, Context cx, VarScope scope) Call obj.static ObjectgetObjectElem(Scriptable obj, Object elem, Context cx) static ObjectgetObjectIndex(Object obj, double dblIndex, Context cx) Deprecated.static ObjectgetObjectIndex(Object obj, double dblIndex, Context cx, VarScope scope) A cheaper and less general version of the above for well-known argument types.static ObjectgetObjectIndex(Scriptable obj, int index, Context cx) static ObjectgetObjectProp(Object obj, String property, Context cx) Deprecated.UsegetObjectProp(Object, String, Context, VarScope)insteadstatic ObjectgetObjectProp(Object obj, String property, Context cx, VarScope scope) Version of getObjectElem when elem is a valid JS identifier name.static ObjectgetObjectProp(Scriptable obj, String property, Context cx) static ObjectgetObjectPropNoWarn(Object obj, String property, Context cx) Deprecated.static ObjectgetObjectPropNoWarn(Object obj, String property, Context cx, VarScope scope) static ScriptRuntime.LookupResultgetPropAndThis(Object obj, String property, Context cx, VarScope scope) Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable in the result.static ScriptRuntime.LookupResultgetPropAndThisOptional(Object obj, String property, Context cx, VarScope scope) static CallablegetPropFunctionAndThis(Object obj, String property, Context cx) Deprecated.static CallablegetPropFunctionAndThis(Object obj, String property, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.static CallablegetPropFunctionAndThisOptional(Object obj, String property, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.static RegExpProxystatic Objectstatic ObjectgetSuperElem(Object elem, Scriptable superScriptable, Scriptable thisScriptable) static ObjectgetSuperIndex(Object superObject, double dblIndex, Context cx, VarScope scope, Object thisObject) static ObjectgetSuperProp(Object superObject, String property, Context cx, VarScope scope, Object thisObject, boolean noWarn) static ScriptablegetTemplateLiteralCallSite(Context cx, VarScope scope, Object[] strings, int index) static ScriptablegetThisForScope(VarScope scope, Object callThisArg) static TopLevelstatic ObjectgetTopLevelProp(VarScope scope, String id) static ScriptRuntime.LookupResultgetValueAndThis(Object value, Context cx) Prepare for calling <expression>(...): return function corresponding to <expression> and make parent scope of the function available in the result.static ScriptRuntime.LookupResultgetValueAndThisOptional(Object value, Context cx) static CallablegetValueFunctionAndThis(Object value, Context cx) Deprecated.UsegetValueAndThis(Object, Context)insteadstatic CallablegetValueFunctionAndThisOptional(Object value, Context cx) Deprecated, for removal: This API element is subject to removal in a future version.UsegetValueAndThisOptional(Object, Context)insteadstatic booleanhasObjectElem(Scriptable target, Object elem, Context cx) static booleanhasTopCall(Context cx) static booleanThe in operator.static longindexFromString(String str) Return -1L if str is not an index, or the index value as lower 32 bits of the result.static voidinitFunction(Context cx, VarScope scope, JSFunction function, int type, boolean fromEvalCode) static TopLevelinitSafeStandardObjects(Context cx, TopLevel scope, boolean sealed) static voidinitScript(ScriptOrFn execObj, Object thisObj, Context cx, VarScope scope, boolean evalScript) static TopLevelinitStandardObjects(Context cx, TopLevel scope, boolean sealed) static booleaninstanceOf(Object a, Object b, Context cx) The instanceof operator.static booleanisArrayLike(Scriptable obj) static booleanisArrayObject(Object obj) static booleanisIteratorDone(Context cx, Object result) Given an iterator result, return true if and only if there is a "done" property that's true.static booleanisJSLineTerminator(int c) static booleanstatic booleanstatic booleanstatic booleanisPrimitive(Object obj) static booleanisRhinoRuntimeType(Class<?> cl) static booleanNot all "NativeSymbol" instances are actually symbols.static booleanjsDelegatesTo(Scriptable lhs, Scriptable rhs) Delegates tostatic ScriptableDeprecated, for removal: This API element is subject to removal in a future version.static longstatic VarScopeleaveDotQuery(VarScope scope) static VarScopeleaveScope(VarScope scope) static doubleleftShift(double val1, double val2) static Numberstatic booleanloadFromIterable(Context cx, VarScope scope, Object arg1, BiConsumer<Object, Object> setter) This is used to handle all the special cases that are required when invoking Object.fromEntries or constructing a NativeMap or NativeWeakMap from an iterable.static Refstatic Refstatic Numberstatic Numberstatic ObjectLooks up a name in the scope chain and returns its value.static ObjectnameIncrDecr(VarScope scopeChain, String id, int incrDecrMask) Deprecated.UsenameIncrDecr(VarScope, String, Context, int)insteadstatic ObjectnameIncrDecr(VarScope scopeChain, String id, Context cx, int incrDecrMask) static Refstatic Refstatic Numberstatic ScriptablenewArrayLiteral(Object[] objects, int[] skipIndices, Context cx, VarScope scope) static ScriptablenewBuiltinObject(Context cx, VarScope scope, TopLevel.Builtins type, Object[] args) static VarScopenewCatchScope(Throwable t, VarScope lastCatchScope, String exceptionName, Context cx, VarScope scope) static ScriptableOperator new.static Scriptablestatic ScriptablenewObjectLiteral(Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, VarScope scope) static ScriptablenewObjectLiteral(Object[] propertyIds, Object[] propertyValues, Context cx, VarScope scope) Deprecated.static ObjectnewSpecial(Context cx, Object fun, Object[] args, VarScope scope, int callType) static RuntimeExceptionnotFoundError(VarScope object, String property) static RuntimeExceptionnotFunctionError(Object value) static RuntimeExceptionnotFunctionError(Object value, Object messageHelper) static RuntimeExceptionnotFunctionError(Object obj, Object value, String propertyName) static StringnumberToString(double d, int base) static Object[]padAndRestArguments(Context cx, VarScope scope, Object[] args, int argCount) Helper function for builtin objects that use the varargs form.static Object[]padArguments(Object[] args, int count) Helper function for builtin objects that use the varargs form.static ObjectpropIncrDecr(Object obj, String id, Context cx, int incrDecrMask) Deprecated.static ObjectpropIncrDecr(Object obj, String id, Context cx, VarScope scope, int incrDecrMask) static EcmaErrorrangeError(String message) static EcmaErrorrangeErrorById(String messageId, Object... args) static Objectstatic EcmaErrorreferenceError(String message) static Objectstatic ObjectrefIncrDecr(Ref ref, Context cx, int incrDecrMask) Deprecated.UserefIncrDecr(Ref, Context, VarScope, int)insteadstatic ObjectrefIncrDecr(Ref ref, Context cx, VarScope scope, int incrDecrMask) static ObjectDeprecated.UserefSet(Ref, Object, Context, VarScope)insteadstatic Objectstatic Numberstatic VarScopereplaceScope(VarScope scope) Gives the next iteration of a loop its own copy of the loop's block scope, leaving the one the finished iteration may have handed to a closure untouched.static booleanstatic booleanImplement "SameValueZero" from ECMA 7.2.9static Objectstatic voidsetBuiltinProtoAndParent(ScriptableObject obj, JSFunction f, Object nt, VarScope s, TopLevel.Builtins type) static voidsetBuiltinProtoAndParent(ScriptableObject obj, JSFunction f, Object nt, VarScope s, org.htmlunit.corejs.javascript.TopLevel.NativeErrors type) static voidsetBuiltinProtoAndParent(ScriptableObject object, VarScope scope, TopLevel.Builtins type) static Objectstatic ObjectsetDefaultNamespace(Object namespace, Context cx) static voidsetEnumNumbers(Object enumObj, boolean enumNumbers) static voidsetFunctionProtoAndParent(BaseFunction fn, Context cx, VarScope scope) static voidsetFunctionProtoAndParent(BaseFunction fn, Context cx, VarScope scope, boolean es6GeneratorFunction) static voidsetFunctionProtoAndParent(BaseFunction fn, VarScope scope) Deprecated.static voidsetFunctionProtoAndParent(BaseFunction fn, VarScope scope, boolean es6GeneratorFunction) Deprecated.static Objectstatic ObjectsetObjectElem(Object obj, Object elem, Object value, Context cx) Deprecated.static ObjectCall obj.static ObjectsetObjectElem(Scriptable obj, Object elem, Object value, Context cx) static ObjectsetObjectIndex(Object obj, double dblIndex, Object value, Context cx) Deprecated.static ObjectsetObjectIndex(Object obj, double dblIndex, Object value, Context cx, VarScope scope) A cheaper and less general version of the above for well-known argument types.static ObjectsetObjectIndex(Scriptable obj, int index, Object value, Context cx) static ObjectsetObjectProp(Object obj, String property, Object value, Context cx) Deprecated.static ObjectVersion of setObjectElem when elem is a valid JS identifier name.static ObjectsetObjectProp(Scriptable obj, String property, Object value, Context cx) static voidsetObjectProtoAndParent(ScriptableObject object, VarScope scope) static voidsetRegExpProxy(Context cx, RegExpProxy proxy) static ObjectsetSuperElem(Object superObject, Object elem, Object value, Context cx, VarScope scope, Object thisObject) Call super.static ObjectsetSuperElem(Scriptable superScriptable, Scriptable thisScriptable, Object elem, Object value, Context cx) static ObjectsetSuperIndex(Object superObject, double dblIndex, Object value, Context cx, VarScope scope, Object thisObject) A cheaper and less general version of the above for well-known argument types.static ObjectsetSuperIndex(Scriptable superScriptable, Scriptable thisScriptable, int index, Object value, Context cx) static ObjectsetSuperProp(Object superObject, String property, Object value, Context cx, VarScope scope, Object thisObject) Version of setSuperElem when elem is a valid JS identifier name.static ObjectsetSuperProp(Scriptable superScriptable, Scriptable thisScriptable, String property, Object value, Context cx) static booleanImplement "IsStrictlyEqual" from ECMA-262 (sec-isstrictlyequal), the abstract operation behind the === and !static doublesignedRightShift(double val1, double val2) static NumbersignedRightShift(Number val1, Number val2) static RefspecialRef(Object obj, String specialProperty, Context cx) Deprecated.UsespecialRef(Object, String, Context, VarScope)insteadstatic RefspecialRef(Object obj, String specialProperty, Context cx, VarScope scope) static voidstoreUint32Result(Context cx, long value) static Objectstatic Numberstatic Numberstatic EcmaErrorsyntaxError(String message) static EcmaErrorsyntaxErrorById(String messageId, Object... args) static longtestUint32String(String str) If str is a decimal presentation of Uint32 value, return it as long.static JavaScriptExceptionthrowCustomError(Context cx, VarScope scope, String constructorName, String message) Equivalent to executing "new $constructorName(message, sourceFileName, sourceLineNo)" from JavaScript.static voidThrows a ReferenceError "cannot delete a super property".static JavaScriptExceptionthrowError(Context cx, VarScope scope, String message) Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript.static BigIntegerConvert the value to a BigInt.static BigIntegerToBigInt applied to the String typestatic booleanConvert the value to a boolean.static CharSequencetoCharSequence(Object val) static intstatic inttoInt32(double d) static intSee ECMA 9.5.static intstatic doubletoInteger(double d) static doubleSee ECMA 9.4.static doublestatic doubletoIntegerOrInfinity(double d) static doublestatic ScriptabletoIterator(Context cx, Scriptable obj, boolean keyOnly) static longstatic longstatic doubleConvert the value to a number.static doublestatic doubleToNumber applied to the String typestatic NumberConvert the value to a Numeric (Number or BigInt).static ScriptableConvert the value to an object.static ScriptableDeprecated.UsetoObject(Context, VarScope, Object)instead.static Scriptablestatic ScriptableDeprecated.UsetoObject(VarScope, Object)instead.static ScriptabletoObjectOrNull(Context cx, Object obj) Deprecated.UsetoObjectOrNull(Context, Object, VarScope)insteadstatic ScriptabletoObjectOrNull(Context cx, Object obj, VarScope scope) static ObjecttoPrimitive(Object input) static ObjecttoPrimitive(Object input, Class<?> preferredType) The abstract operation ToPrimitive takes argument input (an ECMAScript language value) and optional argument preferredType (string or number) and returns either a normal completion containing an ECMAScript language value or a throw completion.static StringtoString(double val) Optimized version of toString(Object) for numbers.static StringConvert the value to a string.static StringIf id is a number or a string presentation of an int32 value, then id the returning StringIdOrIndex has the index set, otherwise the stringId is set.static charSee ECMA 9.7.static longtoUint32(double d) See ECMA 9.6.static longstatic EcmaErrorstatic EcmaErrortypeError0(String messageId) Deprecated.UsetypeErrorById(String messageId, Object...args)insteadstatic EcmaErrortypeError1(String messageId, Object arg1) Deprecated.UsetypeErrorById(String messageId, Object...args)insteadstatic EcmaErrortypeError2(String messageId, Object arg1, Object arg2) Deprecated.UsetypeErrorById(String messageId, Object...args)insteadstatic EcmaErrortypeError3(String messageId, String arg1, String arg2, String arg3) Deprecated.UsetypeErrorById(String messageId, Object...args)insteadstatic EcmaErrortypeErrorById(String messageId, Object... args) static BaseFunctionDeprecated.static BaseFunctionReturns representation of the [[ThrowTypeError]] object.static BaseFunctiontypeErrorThrower(VarScope scope) static StringThe typeof operatorstatic StringtypeofName(Context cx, VarScope scope, String id) The typeof operator that correctly handles the undefined casestatic RuntimeExceptionundefCallError(Object object, Object id) static RuntimeExceptionundefReadError(Object object, Object id) static RuntimeExceptionundefWriteError(Object object, Object id, Object value) static ObjectupdateDotQuery(boolean value, VarScope scope) static BooleanwrapBoolean(boolean b) static ScriptablewrapException(Throwable t, VarScope scope, Context cx) static IntegerwrapInt(int i) static NumberwrapNumber(double x) static ScriptablewrapRegExp(Context cx, VarScope scope, Object compiled)
-
Field Details
-
BooleanClass
-
ByteClass
-
CharacterClass
-
ClassClass
-
DoubleClass
-
FloatClass
-
IntegerClass
-
LongClass
-
NumberClass
-
ObjectClass
-
ShortClass
-
StringClass
-
DateClass
-
BigIntegerClass
-
ContextClass
-
ContextFactoryClass
-
FunctionClass
-
ScriptableObjectClass
-
ScriptableClass
-
VarScopeClass
-
NaN
public static final double NaN- See Also:
-
NaNobj
-
negativeZero
public static final double negativeZero -
zeroObj
-
negativeZeroObj
-
ENUMERATE_KEYS
public static final int ENUMERATE_KEYS- See Also:
-
ENUMERATE_VALUES
public static final int ENUMERATE_VALUES- See Also:
-
ENUMERATE_ARRAY
public static final int ENUMERATE_ARRAY- See Also:
-
ENUMERATE_KEYS_NO_ITERATOR
public static final int ENUMERATE_KEYS_NO_ITERATOR- See Also:
-
ENUMERATE_VALUES_NO_ITERATOR
public static final int ENUMERATE_VALUES_NO_ITERATOR- See Also:
-
ENUMERATE_ARRAY_NO_ITERATOR
public static final int ENUMERATE_ARRAY_NO_ITERATOR- See Also:
-
ENUMERATE_VALUES_IN_ORDER
public static final int ENUMERATE_VALUES_IN_ORDER- See Also:
-
messageProvider
-
emptyArgs
-
emptyStrings
-
-
Constructor Details
-
ScriptRuntime
protected ScriptRuntime()No instances should be created.
-
-
Method Details
-
typeErrorThrower
Deprecated.Returns representation of the [[ThrowTypeError]] object. See ECMA 5 spec, 13.2.3- Returns:
- a
BaseFunction
-
typeErrorThrower
Returns representation of the [[ThrowTypeError]] object. See ECMA 5 spec, 13.2.3 -
typeErrorThrower
-
concat
-
isRhinoRuntimeType
-
initSafeStandardObjects
-
initStandardObjects
-
getLibraryScopeOrNull
-
isJSLineTerminator
public static boolean isJSLineTerminator(int c) -
isJSWhitespaceOrLineTerminator
public static boolean isJSWhitespaceOrLineTerminator(int c) -
wrapBoolean
-
wrapInt
-
wrapNumber
-
toBoolean
Convert the value to a boolean.See ECMA 9.2.
-
toNumber
Convert the value to a number.See ECMA 9.3.
-
toNumber
-
toNumber
ToNumber applied to the String typeSee the #sec-tonumber-applied-to-the-string-type section of ECMA
-
toBigInt
Convert the value to a BigInt. -
toBigInt
ToBigInt applied to the String type -
toNumeric
Convert the value to a Numeric (Number or BigInt).toNumber does not allow java.math.BigInteger. toNumeric allows java.math.BigInteger.
See ECMA 7.1.3 (v11.0).
-
toIndex
-
padArguments
Helper function for builtin objects that use the varargs form. ECMA function formal arguments are undefined if not supplied; this function pads the argument array out to the expected length, if necessary. -
padAndRestArguments
Helper function for builtin objects that use the varargs form. ECMA function formal arguments are undefined if not supplied; this function pads the argument array out to the expected length, if necessary. Also the rest parameter array construction is done here. -
doObjectRest
public static Scriptable doObjectRest(Context cx, VarScope scope, Object source, Object[] excludeKeys) Helper for object rest properties in destructuring. Creates a shallow copy of the source object excluding the specified keys.- Parameters:
cx- the current Contextscope- the current scopesource- the source objectexcludeKeys- array of property names to exclude- Returns:
- a new object with all properties except the excluded ones
-
escapeString
-
escapeString
For escaping strings printed by object and array literals; not quite the same as 'escape.' -
toCharSequence
-
toString
Convert the value to a string.See ECMA 9.8.
-
toString
-
toString
Optimized version of toString(Object) for numbers. -
numberToString
-
bigIntToString
-
toObject
-
toObjectOrNull
Deprecated.UsetoObjectOrNull(Context, Object, VarScope)insteadWarning: This doesn't allow to resolve primitive prototype properly when many top scopes are involved -
toObjectOrNull
- Parameters:
scope- the scope that should be used to resolve primitive prototype
-
toObject
Deprecated.UsetoObject(VarScope, Object)instead. -
toObject
Convert the value to an object.See ECMA 9.9.
-
toObject
@Deprecated public static Scriptable toObject(Context cx, VarScope scope, Object val, Class<?> staticClass) Deprecated.UsetoObject(Context, VarScope, Object)instead. -
call
@Deprecated public static Object call(Context cx, Object fun, Object thisArg, Object[] args, VarScope scope) Deprecated.The method is only present for compatibility. -
newObject
public static Scriptable newObject(Context cx, VarScope scope, String constructorName, Object[] args) -
newBuiltinObject
public static Scriptable newBuiltinObject(Context cx, VarScope scope, TopLevel.Builtins type, Object[] args) -
toInteger
See ECMA 9.4. -
toInteger
public static double toInteger(double d) -
toInteger
-
toLength
-
toLength
-
toInt32
See ECMA 9.5. -
toIntegerOrInfinity
-
toInt32
-
toInt32
public static int toInt32(double d) -
toIntegerOrInfinity
public static double toIntegerOrInfinity(double d) -
toUint32
public static long toUint32(double d) See ECMA 9.6.- Returns:
- long value representing 32 bits unsigned integer
-
toUint32
-
toUint16
See ECMA 9.7. -
canonicalNumericIndexString
If "arg" is a "canonical numeric index," which means any number constructed from a string that doesn't have extra whitespace or non-standard formatting, return it -- otherwise return an empty option. Defined in ECMA 7.1.21. -
advanceStringIndex
Implements the abstract operation AdvanceStringIndex. See ECMAScript spec 22.2.7.3 -
setDefaultNamespace
-
searchDefaultNamespace
-
getTopLevelProp
-
getExistingCtor
-
getExistingCtor
-
indexFromString
Return -1L if str is not an index, or the index value as lower 32 bits of the result. Note that the result needs to be cast to an int in order to produce the actual index, which may be negative.Note that this method on its own does not actually produce an index that is useful for an actual Object or Array, because it may be larger than Integer.MAX_VALUE. Most callers should instead call toStringOrIndex, which calls this under the covers.
-
testUint32String
If str is a decimal presentation of Uint32 value, return it as long. Othewise return -1L; -
toStringIdOrIndex
If id is a number or a string presentation of an int32 value, then id the returning StringIdOrIndex has the index set, otherwise the stringId is set. -
getObjectElem
Deprecated.UsegetObjectElem(Object, Object, Context, VarScope)insteadCall obj.[[Get]](id) -
getObjectElem
Call obj.[[Get]](id) -
getObjectElem
-
getSuperElem
-
getSuperElem
public static Object getSuperElem(Object elem, Scriptable superScriptable, Scriptable thisScriptable) -
getObjectProp
Deprecated.UsegetObjectProp(Object, String, Context, VarScope)insteadVersion of getObjectElem when elem is a valid JS identifier name. -
getObjectProp
Version of getObjectElem when elem is a valid JS identifier name.- Parameters:
scope- the scope that should be used to resolve primitive prototype
-
getObjectProp
-
getObjectPropNoWarn
Deprecated. -
getObjectPropNoWarn
-
getSuperProp
-
getObjectIndex
Deprecated.A cheaper and less general version of the above for well-known argument types. -
getObjectIndex
A cheaper and less general version of the above for well-known argument types. -
getObjectIndex
-
getSuperIndex
-
setObjectElem
Deprecated.Call obj.[[Put]](id, value) -
setObjectElem
public static Object setObjectElem(Object obj, Object elem, Object value, Context cx, VarScope scope) Call obj.[[Put]](id, value) -
setObjectElem
-
setSuperElem
public static Object setSuperElem(Object superObject, Object elem, Object value, Context cx, VarScope scope, Object thisObject) Call super.[[Put]](id, value) -
setSuperElem
public static Object setSuperElem(Scriptable superScriptable, Scriptable thisScriptable, Object elem, Object value, Context cx) -
setObjectProp
@Deprecated public static Object setObjectProp(Object obj, String property, Object value, Context cx) Deprecated.Version of setObjectElem when elem is a valid JS identifier name. -
setObjectProp
public static Object setObjectProp(Object obj, String property, Object value, Context cx, VarScope scope) Version of setObjectElem when elem is a valid JS identifier name. -
setObjectProp
-
setSuperProp
public static Object setSuperProp(Object superObject, String property, Object value, Context cx, VarScope scope, Object thisObject) Version of setSuperElem when elem is a valid JS identifier name. -
setSuperProp
public static Object setSuperProp(Scriptable superScriptable, Scriptable thisScriptable, String property, Object value, Context cx) -
setObjectIndex
@Deprecated public static Object setObjectIndex(Object obj, double dblIndex, Object value, Context cx) Deprecated.A cheaper and less general version of the above for well-known argument types. -
setObjectIndex
public static Object setObjectIndex(Object obj, double dblIndex, Object value, Context cx, VarScope scope) A cheaper and less general version of the above for well-known argument types. -
setObjectIndex
-
setSuperIndex
public static Object setSuperIndex(Object superObject, double dblIndex, Object value, Context cx, VarScope scope, Object thisObject) A cheaper and less general version of the above for well-known argument types. -
setSuperIndex
public static Object setSuperIndex(Scriptable superScriptable, Scriptable thisScriptable, int index, Object value, Context cx) -
deleteObjectElem
-
hasObjectElem
-
refGet
-
refSet
Deprecated.UserefSet(Ref, Object, Context, VarScope)instead -
refSet
-
refDel
-
specialRef
Deprecated.UsespecialRef(Object, String, Context, VarScope)instead -
specialRef
-
delete
Deprecated. -
delete
Deprecated.The delete operatorSee ECMA 11.4.1
In ECMA 0.19, the description of the delete operator (11.4.1) assumes that the [[Delete]] method returns a value. However, the definition of the [[Delete]] operator (8.6.2.5) does not define a return value. Here we assume that the [[Delete]] method doesn't return a value.
-
delete
The delete operatorSee ECMA 11.4.1
In ECMA 0.19, the description of the delete operator (11.4.1) assumes that the [[Delete]] method returns a value. However, the definition of the [[Delete]] operator (8.6.2.5) does not define a return value. Here we assume that the [[Delete]] method doesn't return a value.
-
name
Looks up a name in the scope chain and returns its value. -
bind
Returns the object in the scope chain that has a given property.The order of evaluation of an assignment expression involves evaluating the lhs to a reference, evaluating the rhs, and then modifying the reference with the rhs value. This method is used to 'bind' the given name to an object containing that property so that the side effects of evaluating the rhs do not affect which property is modified. Typically used in conjunction with setName.
See ECMA 10.1.4
-
setName
-
strictSetName
-
setConst
-
toIterator
-
enumInit
Deprecated.UseenumInit(Object, Context, VarScope, int)insteadFor backwards compatibility with generated class files -
enumInit
Deprecated.UseenumInit(Object, Context, VarScope, int)instead -
enumInit
-
setEnumNumbers
-
enumNext
Deprecated.since 1.7.15. UseenumNext(Object, Context)instead -
enumNext
-
enumId
-
enumValue
-
loadFromIterable
public static boolean loadFromIterable(Context cx, VarScope scope, Object arg1, BiConsumer<Object, Object> setter) This is used to handle all the special cases that are required when invoking Object.fromEntries or constructing a NativeMap or NativeWeakMap from an iterable.- Parameters:
cx- the current contextscope- the current scopearg1- the iterable object.setter- the setter to set the value- Returns:
- true, if arg1 was iterable.
-
getNameFunctionAndThis
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getNameFunctionAndThis(String name, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.Prepare for calling name(...): return function corresponding to name and make current top scope available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getNameFunctionAndThisOptional
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getNameFunctionAndThisOptional(String name, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version. -
getNameAndThis
Prepare for calling name(...): return function corresponding to name and make current top scope available as part of the result. -
getNameAndThisOptional
public static ScriptRuntime.LookupResult getNameAndThisOptional(String name, Context cx, VarScope scope) -
getElemFunctionAndThis
Deprecated.Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getElemFunctionAndThis
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getElemFunctionAndThis(Object obj, Object elem, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getElemFunctionAndThisOptional
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getElemFunctionAndThisOptional(Object obj, Object elem, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version. -
getElemAndThis
public static ScriptRuntime.LookupResult getElemAndThis(Object obj, Object elem, Context cx, VarScope scope) Prepare for calling obj[id](...): return function corresponding to obj[id] and make obj properly converted to Scriptable available in the result. -
getElemAndThisOptional
public static ScriptRuntime.LookupResult getElemAndThisOptional(Object obj, Object elem, Context cx, VarScope scope) -
getPropFunctionAndThis
Deprecated.Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. Warning: this doesn't allow to resolve primitive prototype properly when many top scopes are involved. -
getPropFunctionAndThis
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getPropFunctionAndThis(Object obj, String property, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version.Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getPropFunctionAndThisOptional
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getPropFunctionAndThisOptional(Object obj, String property, Context cx, VarScope scope) Deprecated, for removal: This API element is subject to removal in a future version. -
getPropAndThis
public static ScriptRuntime.LookupResult getPropAndThis(Object obj, String property, Context cx, VarScope scope) Prepare for calling obj.property(...): return function corresponding to obj.property and make obj properly converted to Scriptable in the result. -
getPropAndThisOptional
public static ScriptRuntime.LookupResult getPropAndThisOptional(Object obj, String property, Context cx, VarScope scope) -
getValueFunctionAndThis
Deprecated.UsegetValueAndThis(Object, Context)insteadPrepare for calling <expression>(...): return function corresponding to <expression> and make parent scope of the function available as ScriptRuntime.lastStoredScriptable() for consumption as thisObj. The caller must call ScriptRuntime.lastStoredScriptable() immediately after calling this method. -
getValueFunctionAndThisOptional
@Deprecated(since="1.8.1", forRemoval=true) public static Callable getValueFunctionAndThisOptional(Object value, Context cx) Deprecated, for removal: This API element is subject to removal in a future version.UsegetValueAndThisOptional(Object, Context)instead -
getValueAndThis
Prepare for calling <expression>(...): return function corresponding to <expression> and make parent scope of the function available in the result. -
getValueAndThisOptional
-
callIterator
Given an object, get the "Symbol.iterator" element, throw a TypeError if it is not present, then call the result, (throwing a TypeError if the result is not a function), and return that result, whatever it is. -
isIteratorDone
Given an iterator result, return true if and only if there is a "done" property that's true. -
callRef
Perform function call in reference context. Should always return value that can be passed torefGet(Ref, Context)orrefSet(Ref, Object, Context)arbitrary number of times. The args array reference should not be stored in any object that can be GC-reachable after this method returns. If this is necessary, store args.clone(), not args array itself. -
newObject
Operator new.See ECMA 11.2.2
-
callSpecial
-
newSpecial
-
applyOrCall
public static Object applyOrCall(boolean isApply, Context cx, VarScope scope, Object thisObj, Object[] args) Function.prototype.apply and Function.prototype.callSee Ecma 15.3.4.[34]
-
getApplyOrCallThis
public static Scriptable getApplyOrCallThis(Context cx, VarScope scope, Object arg0, int l, Function target) -
isArrayLike
- Returns:
- true if the passed in Scriptable looks like an array
-
evalSpecial
public static Object evalSpecial(Context cx, VarScope scope, Object thisArg, Object[] args, String filename, int lineNumber, boolean isStrict) The eval function property of the global object.See ECMA 15.1.2.1
-
typeof
The typeof operator -
typeofName
The typeof operator that correctly handles the undefined case -
isObject
-
add
-
add
Deprecated.Useadd(Object, Object, Context)instead12.8.3 The Addition Operator (+) 5. Let lprim be ? ToPrimitive(lval). 7. If Type(lprim) is String or Type(rprim) is String, then a. Let lstr be ? ToString(lprim).Should call toPrimitive before toCharSequence
-
add
Deprecated.Useadd(Object, Object, Context)instead12.8.3 The Addition Operator (+) 6. Let rprim be ? ToPrimitive(rval). 7. If Type(lprim) is String or Type(rprim) is String, then b. Let rstr be ? ToString(rprim).Should call toPrimitive before toCharSequence
-
subtract
-
multiply
-
divide
-
remainder
-
add
-
subtract
-
multiply
-
exponentiate
-
bitwiseAND
public static double bitwiseAND(double val1, double val2) -
bitwiseAND
-
bitwiseOR
public static double bitwiseOR(double val1, double val2) -
bitwiseOR
-
bitwiseXOR
public static double bitwiseXOR(double val1, double val2) -
bitwiseXOR
-
leftShift
public static double leftShift(double val1, double val2) -
leftShift
-
signedRightShift
public static double signedRightShift(double val1, double val2) -
signedRightShift
-
bitwiseNOT
-
nameIncrDecr
Deprecated.UsenameIncrDecr(VarScope, String, Context, int)insteadThe method is only present for compatibility. -
nameIncrDecr
-
propIncrDecr
Deprecated. -
propIncrDecr
-
elemIncrDecr
@Deprecated public static Object elemIncrDecr(Object obj, Object index, Context cx, int incrDecrMask) Deprecated. -
elemIncrDecr
-
refIncrDecr
Deprecated.UserefIncrDecr(Ref, Context, VarScope, int)instead -
refIncrDecr
-
negate
-
toPrimitive
-
toPrimitive
The abstract operation ToPrimitive takes argument input (an ECMAScript language value) and optional argument preferredType (string or number) and returns either a normal completion containing an ECMAScript language value or a throw completion. It converts its input argument to a non-Object type. If an object is capable of converting to more than one primitive type, it may use the optional hint preferredType to favour that type. -
eq
Implement "IsLooselyEqual" from ECMA-262 (sec-islooselyequal), the abstract operation behind the == and != operators. UnlikeshallowEq(Object, Object), values of different types may compare equal after conversion (e.g. 1 == "1"). -
same
-
sameZero
Implement "SameValueZero" from ECMA 7.2.9 -
isNaN
-
isPrimitive
-
shallowEq
Implement "IsStrictlyEqual" from ECMA-262 (sec-isstrictlyequal), the abstract operation behind the === and !== operators. Unlikeeq(Object, Object), values of different types never compare equal. -
instanceOf
The instanceof operator.- Returns:
- a instanceof b
-
jsDelegatesTo
Delegates to- Returns:
- true iff rhs appears in lhs' proto chain
-
in
The in operator.This is a new JS 1.3 language feature. The in operator mirrors the operation of the for .. in construct, and tests whether the rhs has the property given by the lhs. It is different from the for .. in construct in that:
- it doesn't perform ToObject on the right hand side
- it returns true for DontEnum properties.- Parameters:
a- the left hand operandb- the right hand operand- Returns:
- true if property name or element number a is a property of b
-
compare
-
compare
-
compareTo
public static boolean compareTo(double d1, double d2, int op) -
getGlobal
-
hasTopCall
-
getTopCallScope
-
doTopCall
@Deprecated public static Object doTopCall(Callable callable, Context cx, VarScope scope, Object thisObj, Object[] args) Deprecated. -
doTopCall
@Deprecated public static Object doTopCall(Script script, Context cx, VarScope scope, Object thisObj) Deprecated. -
doTopCall
-
doTopCall
-
addInstructionCount
-
initScript
public static void initScript(ScriptOrFn execObj, Object thisObj, Context cx, VarScope scope, boolean evalScript) -
createFunctionActivation
@Deprecated public static VarScope createFunctionActivation(JSFunction funObj, VarScope scope, Object[] args) Deprecated. -
createFunctionActivation
public static VarScope createFunctionActivation(JSFunction funObj, Context cx, VarScope scope, Object[] args, boolean argsHasRest, boolean requiresArgumentObject) -
createArrowFunctionActivation
public static VarScope createArrowFunctionActivation(JSFunction funObj, Context cx, VarScope scope, Object[] args, boolean argsHasRest, boolean requiresArgumentObject) -
enterActivationFunction
-
exitActivationFunction
-
enterFunctionStrictness
-
exitFunctionStrictness
-
newCatchScope
-
wrapException
-
enterWith
-
enterScope
-
leaveScope
-
defineConst
Creates an uninitialized const binding, to be initialized by its declaration. -
replaceScope
Gives the next iteration of a loop its own copy of the loop's block scope, leaving the one the finished iteration may have handed to a closure untouched. -
enterDotQuery
-
updateDotQuery
-
leaveDotQuery
-
setFunctionProtoAndParent
Deprecated. -
setFunctionProtoAndParent
-
setFunctionProtoAndParent
@Deprecated public static void setFunctionProtoAndParent(BaseFunction fn, VarScope scope, boolean es6GeneratorFunction) Deprecated. -
setFunctionProtoAndParent
public static void setFunctionProtoAndParent(BaseFunction fn, Context cx, VarScope scope, boolean es6GeneratorFunction) -
setObjectProtoAndParent
-
setBuiltinProtoAndParent
public static void setBuiltinProtoAndParent(ScriptableObject object, VarScope scope, TopLevel.Builtins type) -
setBuiltinProtoAndParent
public static void setBuiltinProtoAndParent(ScriptableObject obj, JSFunction f, Object nt, VarScope s, TopLevel.Builtins type) -
setBuiltinProtoAndParent
public static void setBuiltinProtoAndParent(ScriptableObject obj, JSFunction f, Object nt, VarScope s, org.htmlunit.corejs.javascript.TopLevel.NativeErrors type) -
findPrototype
-
findPrototype
public static Scriptable findPrototype(JSFunction f, Object nt, org.htmlunit.corejs.javascript.TopLevel.NativeErrors type) -
initFunction
public static void initFunction(Context cx, VarScope scope, JSFunction function, int type, boolean fromEvalCode) -
newArrayLiteral
public static Scriptable newArrayLiteral(Object[] objects, int[] skipIndices, Context cx, VarScope scope) -
newObjectLiteral
@Deprecated public static Scriptable newObjectLiteral(Object[] propertyIds, Object[] propertyValues, Context cx, VarScope scope) Deprecated.This method is here for backward compat with existing compiled code. It is called when an object literal is compiled. The next instance will be the version called from new code. This method only present for compatibility. -
newObjectLiteral
@Deprecated public static Scriptable newObjectLiteral(Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, VarScope scope) This method is here for backward compat with existing compiled code. This method only present for compatibility. -
fillObjectLiteral
public static void fillObjectLiteral(Scriptable object, Object[] propertyIds, Object[] propertyValues, int[] getterSetters, Context cx, VarScope scope) -
isArrayObject
-
getArrayElements
-
getMessage0
Deprecated.UsegetMessageById(String messageId, Object...args)instead -
getMessage1
Deprecated.UsegetMessageById(String messageId, Object...args)instead -
getMessage2
Deprecated.UsegetMessageById(String messageId, Object...args)instead -
getMessage3
@Deprecated public static String getMessage3(String messageId, Object arg1, Object arg2, Object arg3) Deprecated.UsegetMessageById(String messageId, Object...args)instead -
getMessage4
@Deprecated public static String getMessage4(String messageId, Object arg1, Object arg2, Object arg3, Object arg4) Deprecated.UsegetMessageById(String messageId, Object...args)instead -
getMessage
Deprecated.UsegetMessageById(String messageId, Object...args)instead -
getMessageById
-
constructError
-
constructError
-
constructError
-
rangeError
-
rangeErrorById
-
typeError
-
typeErrorById
-
typeError0
Deprecated.UsetypeErrorById(String messageId, Object...args)instead -
typeError1
Deprecated.UsetypeErrorById(String messageId, Object...args)instead -
typeError2
Deprecated.UsetypeErrorById(String messageId, Object...args)instead -
typeError3
@Deprecated public static EcmaError typeError3(String messageId, String arg1, String arg2, String arg3) Deprecated.UsetypeErrorById(String messageId, Object...args)instead -
undefReadError
-
undefCallError
-
undefWriteError
-
notFoundError
-
notFunctionError
-
notFunctionError
-
notFunctionError
-
syntaxError
-
syntaxErrorById
-
referenceError
-
getRegExpProxy
-
setRegExpProxy
-
checkRegExpProxy
-
wrapRegExp
-
getTemplateLiteralCallSite
public static Scriptable getTemplateLiteralCallSite(Context cx, VarScope scope, Object[] strings, int index) -
escapeAttributeValue
Escapes the reserved characters in a value of an attribute- Parameters:
value- Unescaped text- Returns:
- The escaped text
-
escapeTextValue
Escapes the reserved characters in a value of a text node- Parameters:
value- Unescaped text- Returns:
- The escaped text
-
memberRef
-
memberRef
-
nameRef
-
nameRef
-
storeUint32Result
-
lastUint32Result
-
lastStoredScriptable
@Deprecated(since="1.8.1", forRemoval=true) public static Scriptable lastStoredScriptable(Context cx) Deprecated, for removal: This API element is subject to removal in a future version. -
discardLastStoredScriptable
@Deprecated(since="1.8.1", forRemoval=true) public static void discardLastStoredScriptable(Context cx) Deprecated, for removal: This API element is subject to removal in a future version. -
isSymbol
Not all "NativeSymbol" instances are actually symbols. So account for that here rather than just by using an "instanceof" check. -
throwError
Equivalent to executing "new Error(message, sourceFileName, sourceLineNo)" from JavaScript.- Parameters:
cx- the current contextscope- the current scopemessage- the message- Returns:
- a JavaScriptException you should throw
-
throwCustomError
public static JavaScriptException throwCustomError(Context cx, VarScope scope, String constructorName, String message) Equivalent to executing "new $constructorName(message, sourceFileName, sourceLineNo)" from JavaScript.- Parameters:
cx- the current contextscope- the current scopemessage- the message- Returns:
- a JavaScriptException you should throw
-
throwDeleteOnSuperPropertyNotAllowed
public static void throwDeleteOnSuperPropertyNotAllowed()Throws a ReferenceError "cannot delete a super property". See ECMAScript spec 13.5.1.2 -
clamp
public static int clamp(int value, int min, int max) Clamps value between min and max, inclusive.- Returns:
- value if it is between min and max, otherwise min or max
-
getThisForScope
-
add(Object, Object, Context)instead