Class NativeRegExpCtor
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.IdScriptableObject
-
- org.htmlunit.corejs.javascript.BaseFunction
-
- org.htmlunit.corejs.javascript.regexp.NativeRegExpCtor
-
- All Implemented Interfaces:
java.io.Serializable,Callable,ConstProperties,Constructable,DebuggableObject,Function,IdFunctionCall,Scriptable,SymbolScriptable
class NativeRegExpCtor extends BaseFunction
This class implements the RegExp constructor 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.11
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static intDOLLAR_ID_BASEprivate static intId_AMPERSANDprivate static intId_BACK_QUOTEprivate static intId_DOLLAR_1private static intId_DOLLAR_2private static intId_DOLLAR_3private static intId_DOLLAR_4private static intId_DOLLAR_5private static intId_DOLLAR_6private static intId_DOLLAR_7private static intId_DOLLAR_8private static intId_DOLLAR_9private static intId_inputprivate static intId_lastMatchprivate static intId_lastParenprivate static intId_leftContextprivate static intId_multilineprivate static intId_PLUSprivate static intId_QUOTEprivate static intId_rightContextprivate static intId_STARprivate static intId_UNDERSCOREprivate intinputAttrprivate static intMAX_INSTANCE_IDprivate intmultilineAttrprivate static longserialVersionUIDprivate intstarAttrprivate intunderscoreAttr-
Fields inherited from class org.htmlunit.corejs.javascript.BaseFunction
Id_arguments, Id_arity, Id_length, Id_name, Id_prototype
-
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description NativeRegExpCtor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcall(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)Should be overridden.Scriptableconstruct(Context cx, Scriptable scope, java.lang.Object[] args)Call the function as a constructor.protected intfindInstanceIdInfo(java.lang.String s)Map name to id of instance property.intgetArity()java.lang.StringgetFunctionName()private static RegExpImplgetImpl()protected java.lang.StringgetInstanceIdName(int id)Map id back to property name it defines.protected java.lang.ObjectgetInstanceIdValue(int id)Get id value.intgetLength()protected intgetMaxInstanceId()Get maximum id findInstanceIdInfo can generate.protected voidsetInstanceIdAttributes(int id, int attr)Update the attributes of the given instance property.protected voidsetInstanceIdValue(int id, java.lang.Object value)Set or delete id value.-
Methods inherited from class org.htmlunit.corejs.javascript.BaseFunction
createObject, execIdCall, fillConstructorProperties, findPrototypeId, getClassName, getClassPrototype, getPrototypeProperty, getTypeOf, hasInstance, hasPrototypeProperty, initPrototypeId, isGeneratorFunction, setImmunePrototypeProperty, setPrototypeProperty, setPrototypePropertyAttributes, setStandardPropertyAttributes, setupDefaultPrototype
-
Methods inherited from class org.htmlunit.corejs.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, 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, has, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
Id_multiline
private static final int Id_multiline
- See Also:
- Constant Field Values
-
Id_STAR
private static final int Id_STAR
- See Also:
- Constant Field Values
-
Id_input
private static final int Id_input
- See Also:
- Constant Field Values
-
Id_UNDERSCORE
private static final int Id_UNDERSCORE
- See Also:
- Constant Field Values
-
Id_lastMatch
private static final int Id_lastMatch
- See Also:
- Constant Field Values
-
Id_AMPERSAND
private static final int Id_AMPERSAND
- See Also:
- Constant Field Values
-
Id_lastParen
private static final int Id_lastParen
- See Also:
- Constant Field Values
-
Id_PLUS
private static final int Id_PLUS
- See Also:
- Constant Field Values
-
Id_leftContext
private static final int Id_leftContext
- See Also:
- Constant Field Values
-
Id_BACK_QUOTE
private static final int Id_BACK_QUOTE
- See Also:
- Constant Field Values
-
Id_rightContext
private static final int Id_rightContext
- See Also:
- Constant Field Values
-
Id_QUOTE
private static final int Id_QUOTE
- See Also:
- Constant Field Values
-
DOLLAR_ID_BASE
private static final int DOLLAR_ID_BASE
- See Also:
- Constant Field Values
-
Id_DOLLAR_1
private static final int Id_DOLLAR_1
- See Also:
- Constant Field Values
-
Id_DOLLAR_2
private static final int Id_DOLLAR_2
- See Also:
- Constant Field Values
-
Id_DOLLAR_3
private static final int Id_DOLLAR_3
- See Also:
- Constant Field Values
-
Id_DOLLAR_4
private static final int Id_DOLLAR_4
- See Also:
- Constant Field Values
-
Id_DOLLAR_5
private static final int Id_DOLLAR_5
- See Also:
- Constant Field Values
-
Id_DOLLAR_6
private static final int Id_DOLLAR_6
- See Also:
- Constant Field Values
-
Id_DOLLAR_7
private static final int Id_DOLLAR_7
- See Also:
- Constant Field Values
-
Id_DOLLAR_8
private static final int Id_DOLLAR_8
- See Also:
- Constant Field Values
-
Id_DOLLAR_9
private static final int Id_DOLLAR_9
- See Also:
- Constant Field Values
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID
- See Also:
- Constant Field Values
-
multilineAttr
private int multilineAttr
-
starAttr
private int starAttr
-
inputAttr
private int inputAttr
-
underscoreAttr
private int underscoreAttr
-
-
Method Detail
-
getFunctionName
public java.lang.String getFunctionName()
- Overrides:
getFunctionNamein classBaseFunction
-
getLength
public int getLength()
- Overrides:
getLengthin classBaseFunction
-
getArity
public int getArity()
- Overrides:
getArityin classBaseFunction
-
call
public java.lang.Object call(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
Description copied from class:BaseFunctionShould be overridden.- Specified by:
callin interfaceCallable- Specified by:
callin interfaceFunction- Overrides:
callin classBaseFunction- 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 JavaScriptthisobjectargs- 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:FunctionCall the function as a constructor.This method is invoked by the runtime in order to satisfy a use of the JavaScript
newoperator. This method is expected to create a new object and return it.- Specified by:
constructin interfaceConstructable- Specified by:
constructin interfaceFunction- Overrides:
constructin classBaseFunction- Parameters:
cx- the current Context for this threadscope- an enclosing scope of the caller except when the function is called from a closure.args- the array of arguments- Returns:
- the allocated object
-
getImpl
private static RegExpImpl getImpl()
-
getMaxInstanceId
protected int getMaxInstanceId()
Description copied from class:IdScriptableObjectGet maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceIdin classBaseFunction
-
findInstanceIdInfo
protected int findInstanceIdInfo(java.lang.String s)
Description copied from class:IdScriptableObjectMap name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int).- Overrides:
findInstanceIdInfoin classBaseFunction
-
getInstanceIdName
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObjectMap id back to property name it defines.- Overrides:
getInstanceIdNamein classBaseFunction
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
Description copied from class:IdScriptableObjectGet 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:
getInstanceIdValuein classBaseFunction
-
setInstanceIdValue
protected void setInstanceIdValue(int id, java.lang.Object value)Description copied from class:IdScriptableObjectSet or delete id value. If value == NOT_FOUND , the implementation should make sure that the following getInstanceIdValue return NOT_FOUND.- Overrides:
setInstanceIdValuein classBaseFunction
-
setInstanceIdAttributes
protected void setInstanceIdAttributes(int id, int attr)Description copied from class:IdScriptableObjectUpdate 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:
setInstanceIdAttributesin classBaseFunction- Parameters:
id- the instance property idattr- the new attribute bitset
-
-