public final class JSRegExp extends JSNonProxy implements JSConstructorFactory.Default, PrototypeSupplier
usesOrdinaryGetOwnProperty| Modifier and Type | Class and Description |
|---|---|
static class |
JSRegExp.LazyNamedCaptureGroupProperty |
static class |
JSRegExp.LazyRegexResultIndexProxyProperty
Since we cannot use nodes here, access to this property is special-cased in
com.oracle.truffle.js.nodes.access.PropertyGetNode.LazyRegexResultIndexPropertyGetNode
. |
JSConstructorFactory.Default.WithSpeciesJSConstructorFactory.Default, JSConstructorFactory.WithFunctions, JSConstructorFactory.WithFunctionsAndSpecies| Modifier and Type | Field and Description |
|---|---|
static com.oracle.truffle.api.strings.TruffleString |
CLASS_NAME |
static com.oracle.truffle.api.strings.TruffleString |
DOT_ALL |
static com.oracle.truffle.api.strings.TruffleString |
FLAGS |
static com.oracle.truffle.api.strings.TruffleString |
GLOBAL |
static com.oracle.truffle.api.strings.TruffleString |
GROUPS |
static com.oracle.truffle.api.object.HiddenKey |
GROUPS_RESULT_ID |
static com.oracle.truffle.api.strings.TruffleString |
HAS_INDICES |
static com.oracle.truffle.api.strings.TruffleString |
IGNORE_CASE |
static com.oracle.truffle.api.strings.TruffleString |
INDEX |
static com.oracle.truffle.api.strings.TruffleString |
INDICES |
static com.oracle.truffle.api.strings.TruffleString |
INPUT |
static JSRegExp |
INSTANCE |
static com.oracle.truffle.api.strings.TruffleString |
LAST_INDEX |
static PropertyProxy |
LAZY_INDEX_PROXY |
static int |
MAX_FLAGS_LENGTH |
static com.oracle.truffle.api.strings.TruffleString |
MULTILINE |
static com.oracle.truffle.api.strings.TruffleString |
PROTOTYPE_NAME |
static com.oracle.truffle.api.strings.TruffleString |
SOURCE |
static com.oracle.truffle.api.strings.TruffleString |
STICKY |
static com.oracle.truffle.api.strings.TruffleString |
UNICODE |
static com.oracle.truffle.api.strings.TruffleString |
UNICODE_SETS |
GET_SYMBOL_SPECIES_NAME| Modifier and Type | Method and Description |
|---|---|
static JSObjectFactory |
buildGroupsFactory(JSContext ctx,
Object namedCaptureGroups) |
static JSRegExpObject |
create(JSContext context,
JSRealm realm,
JSDynamicObject proto,
Object compiledRegex,
JSObjectFactory groupsFactory)
Creates a new JavaScript RegExp object without a
lastIndex property. |
static JSRegExpObject |
create(JSContext context,
JSRealm realm,
JSDynamicObject proto,
Object compiledRegex,
JSObjectFactory groupsFactory,
boolean legacyFeaturesEnabled)
Creates a new JavaScript RegExp object without a
lastIndex property. |
static JSRegExpObject |
create(JSContext ctx,
JSRealm realm,
Object compiledRegex)
Creates a new JavaScript RegExp object (with a
lastIndex of 0). |
static JSRegExpObject |
create(JSContext context,
JSRealm realm,
Object compiledRegex,
JSObjectFactory groupsFactory)
Creates a new JavaScript RegExp object without a
lastIndex property. |
static JSRegExpObject |
create(JSContext context,
JSRealm realm,
Object compiledRegex,
JSObjectFactory groupsFactory,
boolean legacyFeaturesEnabled)
Creates a new JavaScript RegExp object without a
lastIndex property. |
static JSConstructor |
createConstructor(JSRealm realm) |
static JSDynamicObject |
createGroupsObject(JSRealm realm,
JSObjectFactory groupsFactory,
Object regexResult,
com.oracle.truffle.api.strings.TruffleString input,
boolean isIndices) |
JSDynamicObject |
createPrototype(JSRealm realm,
JSFunctionObject ctor) |
static com.oracle.truffle.api.strings.TruffleString |
escapeRegExpPattern(com.oracle.truffle.api.strings.TruffleString pattern) |
void |
fillConstructor(JSRealm realm,
JSDynamicObject constructor) |
com.oracle.truffle.api.strings.TruffleString |
getBuiltinToStringTag(JSDynamicObject object)
Returns builtinTag from step 14 of ES6+ 19.1.3.6.
|
com.oracle.truffle.api.strings.TruffleString |
getClassName() |
com.oracle.truffle.api.strings.TruffleString |
getClassName(JSDynamicObject object)
The [[Class]] internal property.
|
static Object |
getCompiledRegex(JSDynamicObject thisObj) |
static JSObjectFactory |
getGroupsFactory(JSDynamicObject thisObj) |
JSDynamicObject |
getIntrinsicDefaultProto(JSRealm realm)
Allows invokevirtual of this method instead of invokeinterface.
|
static boolean |
getLegacyFeaturesEnabled(JSDynamicObject thisObj) |
static Object |
getRealm(JSDynamicObject thisObj) |
static boolean |
isJSRegExp(Object obj) |
static com.oracle.truffle.api.object.Shape |
makeInitialGroupsObjectShape(JSContext context) |
com.oracle.truffle.api.object.Shape |
makeInitialShape(JSContext ctx,
JSDynamicObject thisObj) |
static com.oracle.truffle.api.strings.TruffleString |
prototypeToString(JSDynamicObject thisObj)
Format: '/' pattern '/' flags.
|
com.oracle.truffle.api.strings.TruffleString |
toDisplayStringImpl(JSDynamicObject obj,
boolean allowSideEffects,
ToDisplayStringFormat format,
int depth)
A more informative toString variant, mainly used for error messages.
|
static void |
updateCompilation(JSContext ctx,
JSDynamicObject thisObj,
Object regex) |
checkProtoCycle, createSymbolSpeciesGetterFunction, defineOwnProperty, delete, delete, deletePropertyDefault, getHelper, getHelper, getMethodHelper, getOwnHelper, getOwnHelper, getOwnProperty, getOwnPropertyKeys, getPrototypeOf, hasOnlyShapeProperties, hasOwnProperty, hasOwnProperty, hasProperty, hasProperty, invokeAccessorPropertySetter, isExtensible, ordinaryGetOwnProperty, ordinaryGetOwnPropertyIntl, ordinaryIsExtensible, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeysSlow, ordinarySet, ordinarySetIndex, ordinarySetWithReceiver, performOrdinarySetWithOwnDescriptor, preventExtensions, preventExtensionsImpl, putConstructorSpeciesGetter, set, set, setIntegrityLevel, setIntegrityLevelFast, setPropertySlow, setPrototypeOf, testIntegrityLevel, testIntegrityLevelFast, toString, usesOrdinaryGetOwnProperty, usesOrdinaryIsExtensibledefaultToString, filterOwnPropertyKeys, formatToString, get, get, getToStringTag, isInstance, isInstance, isInstance, isInstance, ownPropertyKeys, testIntegrityLevelDefaultclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateConstructorAndPrototypecreateConstructorObjectpublic static final JSRegExp INSTANCE
public static final com.oracle.truffle.api.strings.TruffleString CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString PROTOTYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString MULTILINE
public static final com.oracle.truffle.api.strings.TruffleString GLOBAL
public static final com.oracle.truffle.api.strings.TruffleString IGNORE_CASE
public static final com.oracle.truffle.api.strings.TruffleString STICKY
public static final com.oracle.truffle.api.strings.TruffleString UNICODE
public static final com.oracle.truffle.api.strings.TruffleString DOT_ALL
public static final com.oracle.truffle.api.strings.TruffleString SOURCE
public static final com.oracle.truffle.api.strings.TruffleString FLAGS
public static final com.oracle.truffle.api.strings.TruffleString LAST_INDEX
public static final com.oracle.truffle.api.strings.TruffleString INPUT
public static final com.oracle.truffle.api.strings.TruffleString GROUPS
public static final com.oracle.truffle.api.strings.TruffleString INDEX
public static final com.oracle.truffle.api.strings.TruffleString INDICES
public static final com.oracle.truffle.api.strings.TruffleString HAS_INDICES
public static final com.oracle.truffle.api.strings.TruffleString UNICODE_SETS
public static final PropertyProxy LAZY_INDEX_PROXY
public static final com.oracle.truffle.api.object.HiddenKey GROUPS_RESULT_ID
public static final int MAX_FLAGS_LENGTH
public static Object getCompiledRegex(JSDynamicObject thisObj)
public static JSObjectFactory getGroupsFactory(JSDynamicObject thisObj)
public static Object getRealm(JSDynamicObject thisObj)
public static boolean getLegacyFeaturesEnabled(JSDynamicObject thisObj)
public static JSRegExpObject create(JSContext ctx, JSRealm realm, Object compiledRegex)
lastIndex of 0).
This overload incurs hitting a CompilerDirectives.TruffleBoundary when having to examine the
compiledRegex for information about named capture groups. In order to avoid a
CompilerDirectives.TruffleBoundary in cases when your regular expression has no named capture groups,
consider using the com.oracle.truffle.js.nodes.intl.CreateRegExpNode.
public static JSRegExpObject create(JSContext context, JSRealm realm, JSDynamicObject proto, Object compiledRegex, JSObjectFactory groupsFactory)
lastIndex property.public static JSRegExpObject create(JSContext context, JSRealm realm, Object compiledRegex, JSObjectFactory groupsFactory)
lastIndex property.public static JSRegExpObject create(JSContext context, JSRealm realm, JSDynamicObject proto, Object compiledRegex, JSObjectFactory groupsFactory, boolean legacyFeaturesEnabled)
lastIndex property.public static JSRegExpObject create(JSContext context, JSRealm realm, Object compiledRegex, JSObjectFactory groupsFactory, boolean legacyFeaturesEnabled)
lastIndex property.public static void updateCompilation(JSContext ctx, JSDynamicObject thisObj, Object regex)
public static JSDynamicObject createGroupsObject(JSRealm realm, JSObjectFactory groupsFactory, Object regexResult, com.oracle.truffle.api.strings.TruffleString input, boolean isIndices)
public static JSObjectFactory buildGroupsFactory(JSContext ctx, Object namedCaptureGroups)
public static com.oracle.truffle.api.strings.TruffleString prototypeToString(JSDynamicObject thisObj)
Example: /ab*c/gi
public static boolean isJSRegExp(Object obj)
public JSDynamicObject createPrototype(JSRealm realm, JSFunctionObject ctor)
createPrototype in interface JSConstructorFactorypublic com.oracle.truffle.api.object.Shape makeInitialShape(JSContext ctx, JSDynamicObject thisObj)
makeInitialShape in class JSClasspublic static com.oracle.truffle.api.object.Shape makeInitialGroupsObjectShape(JSContext context)
public void fillConstructor(JSRealm realm, JSDynamicObject constructor)
fillConstructor in interface JSConstructorFactorypublic static JSConstructor createConstructor(JSRealm realm)
public com.oracle.truffle.api.strings.TruffleString getClassName()
getClassName in interface JSConstructorFactorypublic com.oracle.truffle.api.strings.TruffleString getClassName(JSDynamicObject object)
JSClassgetClassName in class JSClassobject - object to be usedpublic com.oracle.truffle.api.strings.TruffleString getBuiltinToStringTag(JSDynamicObject object)
JSClassgetBuiltinToStringTag in class JSNonProxyobject - object to be usedJSClass.defaultToString(JSDynamicObject)public com.oracle.truffle.api.strings.TruffleString toDisplayStringImpl(JSDynamicObject obj, boolean allowSideEffects, ToDisplayStringFormat format, int depth)
JSClasstoDisplayStringImpl in class JSNonProxyformat - formatting parametersdepth - current nesting depthpublic JSDynamicObject getIntrinsicDefaultProto(JSRealm realm)
JSClassPrototypeSupplier.getIntrinsicDefaultProto in interface PrototypeSuppliergetIntrinsicDefaultProto in class JSClassPrototypeSupplier.getIntrinsicDefaultProto(com.oracle.truffle.js.runtime.JSRealm)public static com.oracle.truffle.api.strings.TruffleString escapeRegExpPattern(com.oracle.truffle.api.strings.TruffleString pattern)