Package org.mozilla.javascript.regexp
Class NativeRegExp
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.regexp.NativeRegExp
-
- All Implemented Interfaces:
java.io.Serializable
,Callable
,ConstProperties
,DebuggableObject
,Function
,IdFunctionCall
,Scriptable
,SymbolScriptable
public class NativeRegExp extends IdScriptableObject implements Function
This class implements the RegExp native object. Revision History: Implementation in C by Brendan Eich Initial port to Java by Norris Boyd from jsregexp.c version 1.36 Merged up to version 1.38, which included Unicode support. Merged bug fixes in version 1.39. Merged JSFUN13_BRANCH changes up to 1.32.2.13- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ANCHOR_BOL
private static boolean
debug
private static int
Id_compile
private static int
Id_exec
private static int
Id_global
private static int
Id_ignoreCase
private static int
Id_lastIndex
private static int
Id_multiline
private static int
Id_prefix
private static int
Id_source
private static int
Id_test
private static int
Id_toSource
private static int
Id_toString
private static int
INDEX_LEN
static int
JSREG_FOLD
static int
JSREG_GLOB
static int
JSREG_MULTILINE
(package private) java.lang.Object
lastIndex
private int
lastIndexAttr
static int
MATCH
private static int
MAX_INSTANCE_ID
private static int
MAX_PROTOTYPE_ID
static int
PREFIX
private RECompiled
re
private static java.lang.Object
REGEXP_TAG
private static byte
REOP_ALNUM
private static byte
REOP_ALT
private static byte
REOP_ALTPREREQ
private static byte
REOP_ALTPREREQ2
private static byte
REOP_ALTPREREQi
private static byte
REOP_ASSERT
private static byte
REOP_ASSERT_NOT
private static byte
REOP_ASSERTNOTTEST
private static byte
REOP_ASSERTTEST
private static byte
REOP_BACKREF
private static byte
REOP_BOL
private static byte
REOP_CLASS
private static byte
REOP_DIGIT
private static byte
REOP_DOT
private static byte
REOP_EMPTY
private static byte
REOP_END
private static byte
REOP_ENDCHILD
private static byte
REOP_EOL
private static byte
REOP_FLAT
private static byte
REOP_FLAT1
private static byte
REOP_FLAT1i
private static byte
REOP_FLATi
private static byte
REOP_JUMP
private static byte
REOP_LPAREN
private static byte
REOP_MINIMALOPT
private static byte
REOP_MINIMALPLUS
private static byte
REOP_MINIMALQUANT
private static byte
REOP_MINIMALREPEAT
private static byte
REOP_MINIMALSTAR
private static byte
REOP_NCLASS
private static byte
REOP_NONALNUM
private static byte
REOP_NONDIGIT
private static byte
REOP_NONSPACE
private static byte
REOP_OPT
private static byte
REOP_PLUS
private static byte
REOP_QUANT
private static byte
REOP_REPEAT
private static byte
REOP_RPAREN
private static byte
REOP_SIMPLE_END
private static byte
REOP_SIMPLE_START
private static byte
REOP_SPACE
private static byte
REOP_STAR
private static byte
REOP_UCFLAT1
private static byte
REOP_UCFLAT1i
private static byte
REOP_WBDRY
private static byte
REOP_WNONBDRY
private static long
serialVersionUID
private static int
SymbolId_match
private static int
SymbolId_search
static int
TEST
-
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 Constructor Description NativeRegExp()
NativeRegExp(Scriptable scope, RECompiled regexpCompiled)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addCharacterRangeToCharSet(RECharSet cs, char c1, char c2)
private static void
addCharacterToCharSet(RECharSet cs, char c)
private static int
addIndex(byte[] array, int pc, int index)
private static boolean
backrefMatcher(REGlobalData gData, int parenIndex, java.lang.String input, int end)
private static boolean
calculateBitmapSize(CompilerState state, RENode target, char[] src, int index, int end)
java.lang.Object
call(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Call the function.private static boolean
classMatcher(REGlobalData gData, RECharSet charSet, char ch)
(package private) Scriptable
compile(Context cx, Scriptable scope, java.lang.Object[] args)
(package private) static RECompiled
compileRE(Context cx, java.lang.String str, java.lang.String global, boolean flat)
Scriptable
construct(Context cx, Scriptable scope, java.lang.Object[] args)
Call the function as a constructor.private static void
doFlat(CompilerState state, char c)
private static char
downcase(char ch)
private static int
emitREBytecode(CompilerState state, RECompiled re, int pc, RENode t)
private static java.lang.String
escapeRegExp(java.lang.Object src)
java.lang.Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned.private java.lang.Object
execSub(Context cx, Scriptable scopeObj, java.lang.Object[] args, int matchType)
private static boolean
executeREBytecode(REGlobalData gData, java.lang.String input, int end)
(package private) java.lang.Object
executeRegExp(Context cx, Scriptable scope, RegExpImpl res, java.lang.String str, int[] indexp, int matchType)
protected int
findInstanceIdInfo(java.lang.String s)
Map name to id of instance property.protected int
findPrototypeId(java.lang.String s)
protected int
findPrototypeId(Symbol k)
private static boolean
flatNIMatcher(REGlobalData gData, int matchChars, int length, java.lang.String input, int end)
private static boolean
flatNMatcher(REGlobalData gData, int matchChars, int length, java.lang.String input, int end)
java.lang.String
getClassName()
Return the name of the class.private static int
getDecimalValue(char c, CompilerState state, int maxValue, java.lang.String overflowMessageId)
(package private) int
getFlags()
private static RegExpImpl
getImpl(Context cx)
private static int
getIndex(byte[] array, int pc)
protected java.lang.String
getInstanceIdName(int id)
Map id back to property name it defines.protected java.lang.Object
getInstanceIdValue(int id)
Get id value.protected int
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.private static int
getOffset(byte[] array, int pc)
java.lang.String
getTypeOf()
Gets the value to be returned by the typeof operator called on this object.static void
init(Context cx, Scriptable scope, boolean sealed)
protected void
initPrototypeId(int id)
private static boolean
isControlLetter(char c)
(package private) static boolean
isDigit(char c)
private static boolean
isLineTerm(char c)
private static boolean
isREWhiteSpace(int c)
private static boolean
isWord(char c)
private static boolean
matchRegExp(REGlobalData gData, RECompiled re, java.lang.String input, int start, int end, boolean multiline)
private static boolean
parseAlternative(CompilerState state)
private static boolean
parseDisjunction(CompilerState state)
private static boolean
parseTerm(CompilerState state)
private static REProgState
popProgState(REGlobalData gData)
private static void
processCharSet(REGlobalData gData, RECharSet charSet)
private static void
processCharSetImpl(REGlobalData gData, RECharSet charSet)
private static void
pushBackTrackState(REGlobalData gData, byte op, int pc)
private static void
pushBackTrackState(REGlobalData gData, byte op, int pc, int cp, int continuationOp, int continuationPc)
private static void
pushProgState(REGlobalData gData, int min, int max, int cp, REBackTrackData backTrackLastToSave, int continuationOp, int continuationPc)
private static NativeRegExp
realThis(Scriptable thisObj, IdFunctionObject f)
private static boolean
reopIsSimple(int op)
private static void
reportError(java.lang.String messageId, java.lang.String arg)
private static void
reportWarning(Context cx, java.lang.String messageId, java.lang.String arg)
private static void
resolveForwardJump(byte[] array, int from, int pc)
protected void
setInstanceIdAttributes(int id, int attr)
Update the attributes of the given instance property.protected void
setInstanceIdValue(int id, java.lang.Object value)
Set or delete id value.private void
setLastIndex(java.lang.Object value)
private static int
simpleMatch(REGlobalData gData, java.lang.String input, int op, byte[] program, int pc, int end, boolean updatecp)
private static int
toASCIIHexDigit(int c)
java.lang.String
toString()
private static char
upcase(char ch)
-
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes
-
Methods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, 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, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
REGEXP_TAG
private static final java.lang.Object REGEXP_TAG
-
JSREG_GLOB
public static final int JSREG_GLOB
- See Also:
- Constant Field Values
-
JSREG_FOLD
public static final int JSREG_FOLD
- See Also:
- Constant Field Values
-
JSREG_MULTILINE
public static final int JSREG_MULTILINE
- See Also:
- Constant Field Values
-
TEST
public static final int TEST
- See Also:
- Constant Field Values
-
MATCH
public static final int MATCH
- See Also:
- Constant Field Values
-
PREFIX
public static final int PREFIX
- See Also:
- Constant Field Values
-
debug
private static final boolean debug
- See Also:
- Constant Field Values
-
REOP_SIMPLE_START
private static final byte REOP_SIMPLE_START
- See Also:
- Constant Field Values
-
REOP_EMPTY
private static final byte REOP_EMPTY
- See Also:
- Constant Field Values
-
REOP_BOL
private static final byte REOP_BOL
- See Also:
- Constant Field Values
-
REOP_EOL
private static final byte REOP_EOL
- See Also:
- Constant Field Values
-
REOP_WBDRY
private static final byte REOP_WBDRY
- See Also:
- Constant Field Values
-
REOP_WNONBDRY
private static final byte REOP_WNONBDRY
- See Also:
- Constant Field Values
-
REOP_DOT
private static final byte REOP_DOT
- See Also:
- Constant Field Values
-
REOP_DIGIT
private static final byte REOP_DIGIT
- See Also:
- Constant Field Values
-
REOP_NONDIGIT
private static final byte REOP_NONDIGIT
- See Also:
- Constant Field Values
-
REOP_ALNUM
private static final byte REOP_ALNUM
- See Also:
- Constant Field Values
-
REOP_NONALNUM
private static final byte REOP_NONALNUM
- See Also:
- Constant Field Values
-
REOP_SPACE
private static final byte REOP_SPACE
- See Also:
- Constant Field Values
-
REOP_NONSPACE
private static final byte REOP_NONSPACE
- See Also:
- Constant Field Values
-
REOP_BACKREF
private static final byte REOP_BACKREF
- See Also:
- Constant Field Values
-
REOP_FLAT
private static final byte REOP_FLAT
- See Also:
- Constant Field Values
-
REOP_FLAT1
private static final byte REOP_FLAT1
- See Also:
- Constant Field Values
-
REOP_FLATi
private static final byte REOP_FLATi
- See Also:
- Constant Field Values
-
REOP_FLAT1i
private static final byte REOP_FLAT1i
- See Also:
- Constant Field Values
-
REOP_UCFLAT1
private static final byte REOP_UCFLAT1
- See Also:
- Constant Field Values
-
REOP_UCFLAT1i
private static final byte REOP_UCFLAT1i
- See Also:
- Constant Field Values
-
REOP_CLASS
private static final byte REOP_CLASS
- See Also:
- Constant Field Values
-
REOP_NCLASS
private static final byte REOP_NCLASS
- See Also:
- Constant Field Values
-
REOP_SIMPLE_END
private static final byte REOP_SIMPLE_END
- See Also:
- Constant Field Values
-
REOP_QUANT
private static final byte REOP_QUANT
- See Also:
- Constant Field Values
-
REOP_STAR
private static final byte REOP_STAR
- See Also:
- Constant Field Values
-
REOP_PLUS
private static final byte REOP_PLUS
- See Also:
- Constant Field Values
-
REOP_OPT
private static final byte REOP_OPT
- See Also:
- Constant Field Values
-
REOP_LPAREN
private static final byte REOP_LPAREN
- See Also:
- Constant Field Values
-
REOP_RPAREN
private static final byte REOP_RPAREN
- See Also:
- Constant Field Values
-
REOP_ALT
private static final byte REOP_ALT
- See Also:
- Constant Field Values
-
REOP_JUMP
private static final byte REOP_JUMP
- See Also:
- Constant Field Values
-
REOP_ASSERT
private static final byte REOP_ASSERT
- See Also:
- Constant Field Values
-
REOP_ASSERT_NOT
private static final byte REOP_ASSERT_NOT
- See Also:
- Constant Field Values
-
REOP_ASSERTTEST
private static final byte REOP_ASSERTTEST
- See Also:
- Constant Field Values
-
REOP_ASSERTNOTTEST
private static final byte REOP_ASSERTNOTTEST
- See Also:
- Constant Field Values
-
REOP_MINIMALSTAR
private static final byte REOP_MINIMALSTAR
- See Also:
- Constant Field Values
-
REOP_MINIMALPLUS
private static final byte REOP_MINIMALPLUS
- See Also:
- Constant Field Values
-
REOP_MINIMALOPT
private static final byte REOP_MINIMALOPT
- See Also:
- Constant Field Values
-
REOP_MINIMALQUANT
private static final byte REOP_MINIMALQUANT
- See Also:
- Constant Field Values
-
REOP_ENDCHILD
private static final byte REOP_ENDCHILD
- See Also:
- Constant Field Values
-
REOP_REPEAT
private static final byte REOP_REPEAT
- See Also:
- Constant Field Values
-
REOP_MINIMALREPEAT
private static final byte REOP_MINIMALREPEAT
- See Also:
- Constant Field Values
-
REOP_ALTPREREQ
private static final byte REOP_ALTPREREQ
- See Also:
- Constant Field Values
-
REOP_ALTPREREQi
private static final byte REOP_ALTPREREQi
- See Also:
- Constant Field Values
-
REOP_ALTPREREQ2
private static final byte REOP_ALTPREREQ2
- See Also:
- Constant Field Values
-
REOP_END
private static final byte REOP_END
- See Also:
- Constant Field Values
-
ANCHOR_BOL
private static final int ANCHOR_BOL
- See Also:
- Constant Field Values
-
INDEX_LEN
private static final int INDEX_LEN
- See Also:
- Constant Field Values
-
Id_lastIndex
private static final int Id_lastIndex
- See Also:
- Constant Field Values
-
Id_source
private static final int Id_source
- See Also:
- Constant Field Values
-
Id_global
private static final int Id_global
- See Also:
- Constant Field Values
-
Id_ignoreCase
private static final int Id_ignoreCase
- See Also:
- Constant Field Values
-
Id_multiline
private static final int Id_multiline
- See Also:
- Constant Field Values
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID
- See Also:
- Constant Field Values
-
Id_compile
private static final int Id_compile
- See Also:
- Constant Field Values
-
Id_toString
private static final int Id_toString
- See Also:
- Constant Field Values
-
Id_toSource
private static final int Id_toSource
- See Also:
- Constant Field Values
-
Id_exec
private static final int Id_exec
- See Also:
- Constant Field Values
-
Id_test
private static final int Id_test
- See Also:
- Constant Field Values
-
Id_prefix
private static final int Id_prefix
- See Also:
- Constant Field Values
-
SymbolId_match
private static final int SymbolId_match
- See Also:
- Constant Field Values
-
SymbolId_search
private static final int SymbolId_search
- See Also:
- Constant Field Values
-
MAX_PROTOTYPE_ID
private static final int MAX_PROTOTYPE_ID
- See Also:
- Constant Field Values
-
re
private RECompiled re
-
lastIndex
java.lang.Object lastIndex
-
lastIndexAttr
private int lastIndexAttr
-
-
Constructor Detail
-
NativeRegExp
NativeRegExp(Scriptable scope, RECompiled regexpCompiled)
-
NativeRegExp
NativeRegExp()
-
-
Method Detail
-
init
public static void init(Context cx, Scriptable scope, boolean sealed)
-
getClassName
public java.lang.String 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
-
getTypeOf
public java.lang.String getTypeOf()
Gets the value to be returned by the typeof operator called on this object.- Overrides:
getTypeOf
in classScriptableObject
- Returns:
- "object"
- See Also:
ScriptableObject.getTypeOf()
-
call
public java.lang.Object call(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from interface:Function
Call the function. Note that the array of arguments is not guaranteed to have length greater than 0.- Specified by:
call
in interfaceCallable
- Specified by:
call
in interfaceFunction
- Parameters:
cx
- the current Context for this threadscope
- the scope to execute the function relative to. This is set to the value returned by getParentScope() except when the function is called from a closure.thisObj
- the JavaScriptthis
objectargs
- the array of arguments- Returns:
- the result of the call
-
construct
public Scriptable construct(Context cx, Scriptable scope, java.lang.Object[] args)
Description copied from interface:Function
Call the function as a constructor. This method is invoked by the runtime in order to satisfy a use of the JavaScriptnew
operator. This method is expected to create a new object and return it.
-
compile
Scriptable compile(Context cx, Scriptable scope, java.lang.Object[] args)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getImpl
private static RegExpImpl getImpl(Context cx)
-
escapeRegExp
private static java.lang.String escapeRegExp(java.lang.Object src)
-
execSub
private java.lang.Object execSub(Context cx, Scriptable scopeObj, java.lang.Object[] args, int matchType)
-
compileRE
static RECompiled compileRE(Context cx, java.lang.String str, java.lang.String global, boolean flat)
-
isDigit
static boolean isDigit(char c)
-
isWord
private static boolean isWord(char c)
-
isControlLetter
private static boolean isControlLetter(char c)
-
isLineTerm
private static boolean isLineTerm(char c)
-
isREWhiteSpace
private static boolean isREWhiteSpace(int c)
-
upcase
private static char upcase(char ch)
-
downcase
private static char downcase(char ch)
-
toASCIIHexDigit
private static int toASCIIHexDigit(int c)
-
parseDisjunction
private static boolean parseDisjunction(CompilerState state)
-
parseAlternative
private static boolean parseAlternative(CompilerState state)
-
calculateBitmapSize
private static boolean calculateBitmapSize(CompilerState state, RENode target, char[] src, int index, int end)
-
doFlat
private static void doFlat(CompilerState state, char c)
-
getDecimalValue
private static int getDecimalValue(char c, CompilerState state, int maxValue, java.lang.String overflowMessageId)
-
parseTerm
private static boolean parseTerm(CompilerState state)
-
resolveForwardJump
private static void resolveForwardJump(byte[] array, int from, int pc)
-
getOffset
private static int getOffset(byte[] array, int pc)
-
addIndex
private static int addIndex(byte[] array, int pc, int index)
-
getIndex
private static int getIndex(byte[] array, int pc)
-
emitREBytecode
private static int emitREBytecode(CompilerState state, RECompiled re, int pc, RENode t)
-
pushProgState
private static void pushProgState(REGlobalData gData, int min, int max, int cp, REBackTrackData backTrackLastToSave, int continuationOp, int continuationPc)
-
popProgState
private static REProgState popProgState(REGlobalData gData)
-
pushBackTrackState
private static void pushBackTrackState(REGlobalData gData, byte op, int pc)
-
pushBackTrackState
private static void pushBackTrackState(REGlobalData gData, byte op, int pc, int cp, int continuationOp, int continuationPc)
-
flatNMatcher
private static boolean flatNMatcher(REGlobalData gData, int matchChars, int length, java.lang.String input, int end)
-
flatNIMatcher
private static boolean flatNIMatcher(REGlobalData gData, int matchChars, int length, java.lang.String input, int end)
-
backrefMatcher
private static boolean backrefMatcher(REGlobalData gData, int parenIndex, java.lang.String input, int end)
-
addCharacterToCharSet
private static void addCharacterToCharSet(RECharSet cs, char c)
-
addCharacterRangeToCharSet
private static void addCharacterRangeToCharSet(RECharSet cs, char c1, char c2)
-
processCharSet
private static void processCharSet(REGlobalData gData, RECharSet charSet)
-
processCharSetImpl
private static void processCharSetImpl(REGlobalData gData, RECharSet charSet)
-
classMatcher
private static boolean classMatcher(REGlobalData gData, RECharSet charSet, char ch)
-
reopIsSimple
private static boolean reopIsSimple(int op)
-
simpleMatch
private static int simpleMatch(REGlobalData gData, java.lang.String input, int op, byte[] program, int pc, int end, boolean updatecp)
-
executeREBytecode
private static boolean executeREBytecode(REGlobalData gData, java.lang.String input, int end)
-
matchRegExp
private static boolean matchRegExp(REGlobalData gData, RECompiled re, java.lang.String input, int start, int end, boolean multiline)
-
executeRegExp
java.lang.Object executeRegExp(Context cx, Scriptable scope, RegExpImpl res, java.lang.String str, int[] indexp, int matchType)
-
getFlags
int getFlags()
-
reportWarning
private static void reportWarning(Context cx, java.lang.String messageId, java.lang.String arg)
-
reportError
private static void reportError(java.lang.String messageId, java.lang.String arg)
-
getMaxInstanceId
protected int getMaxInstanceId()
Description copied from class:IdScriptableObject
Get maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceId
in classIdScriptableObject
-
findInstanceIdInfo
protected int findInstanceIdInfo(java.lang.String s)
Description copied from class:IdScriptableObject
Map name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int)
.- Overrides:
findInstanceIdInfo
in classIdScriptableObject
-
getInstanceIdName
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObject
Map id back to property name it defines.- Overrides:
getInstanceIdName
in classIdScriptableObject
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
Description copied from class:IdScriptableObject
Get id value. If id value is constant, descendant can call cacheIdValue to store value in the permanent cache. Default implementation creates IdFunctionObject instance for given id and cache its value- Overrides:
getInstanceIdValue
in classIdScriptableObject
-
setLastIndex
private void setLastIndex(java.lang.Object value)
-
setInstanceIdValue
protected void setInstanceIdValue(int id, java.lang.Object value)
Description copied from class:IdScriptableObject
Set or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.- Overrides:
setInstanceIdValue
in classIdScriptableObject
-
setInstanceIdAttributes
protected void setInstanceIdAttributes(int id, int attr)
Description copied from class:IdScriptableObject
Update the attributes of the given instance property. Classes which want to support changing property attributes via Object.defineProperty must override this method. The default implementation throws InternalError.- Overrides:
setInstanceIdAttributes
in classIdScriptableObject
- Parameters:
id
- the instance property idattr
- the new attribute bitset
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in classIdScriptableObject
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.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
-
realThis
private static NativeRegExp realThis(Scriptable thisObj, IdFunctionObject f)
-
findPrototypeId
protected int findPrototypeId(Symbol k)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
-