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 String |
CLASS_NAME |
static String |
DOT_ALL |
static String |
FLAGS |
static String |
GLOBAL |
static String |
GROUPS |
static com.oracle.truffle.api.object.HiddenKey |
GROUPS_RESULT_ID |
static String |
IGNORE_CASE |
static String |
INDEX |
static String |
INDICES |
static String |
INPUT |
static JSRegExp |
INSTANCE |
static String |
LAST_INDEX |
static PropertyProxy |
LAZY_INDEX_PROXY |
static String |
MULTILINE |
static String |
PROTOTYPE_NAME |
static String |
SOURCE |
static String |
STICKY |
static String |
UNICODE |
EMPTY_STRING_ARRAY| Modifier and Type | Method and Description |
|---|---|
static JSObjectFactory |
buildGroupsFactory(JSContext ctx,
Object namedCaptureGroups) |
static com.oracle.truffle.api.object.DynamicObject |
create(JSContext ctx,
Object compiledRegex)
Creates a new JavaScript RegExp object (with a
lastIndex of 0). |
static com.oracle.truffle.api.object.DynamicObject |
create(JSContext context,
Object compiledRegex,
JSObjectFactory groupsFactory)
Creates a new JavaScript RegExp object without a
lastIndex property. |
static com.oracle.truffle.api.object.DynamicObject |
create(JSContext context,
Object compiledRegex,
JSObjectFactory groupsFactory,
boolean legacyFeaturesEnabled)
Creates a new JavaScript RegExp object without a
lastIndex property. |
static JSConstructor |
createConstructor(JSRealm realm) |
static com.oracle.truffle.api.object.DynamicObject |
createGroupsObject(JSContext context,
JSObjectFactory groupsFactory,
Object regexResult,
String input,
boolean isIndices) |
com.oracle.truffle.api.object.DynamicObject |
createPrototype(JSRealm realm,
com.oracle.truffle.api.object.DynamicObject ctor) |
static CharSequence |
escapeRegExpPattern(CharSequence pattern) |
void |
fillConstructor(JSRealm realm,
com.oracle.truffle.api.object.DynamicObject constructor) |
String |
getBuiltinToStringTag(com.oracle.truffle.api.object.DynamicObject object)
Returns builtinTag from step 14 of ES6+ 19.1.3.6.
|
String |
getClassName() |
String |
getClassName(com.oracle.truffle.api.object.DynamicObject object)
The [[Class]] internal property.
|
static Object |
getCompiledRegex(com.oracle.truffle.api.object.DynamicObject thisObj) |
static JSObjectFactory |
getGroupsFactory(com.oracle.truffle.api.object.DynamicObject thisObj) |
com.oracle.truffle.api.object.DynamicObject |
getIntrinsicDefaultProto(JSRealm realm) |
static boolean |
getLegacyFeaturesEnabled(com.oracle.truffle.api.object.DynamicObject thisObj) |
static Object |
getRealm(com.oracle.truffle.api.object.DynamicObject 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,
com.oracle.truffle.api.object.DynamicObject thisObj) |
static String |
prototypeToString(com.oracle.truffle.api.object.DynamicObject thisObj)
Format: '/' pattern '/' flags, flags may contain 'g' (global), 'i' (ignore case) and 'm'
(multiline).
Example: /ab*c/gi |
String |
toDisplayStringImpl(com.oracle.truffle.api.object.DynamicObject obj,
int depth,
boolean allowSideEffects,
JSContext context)
A more informative toString variant, mainly used for error messages.
|
static void |
updateCompilation(JSContext ctx,
com.oracle.truffle.api.object.DynamicObject 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, 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, testIntegrityLevelDefaultdispatch, equals, hashCode, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateConstructorAndPrototypecreateConstructorObjectpublic static final JSRegExp INSTANCE
public static final String CLASS_NAME
public static final String PROTOTYPE_NAME
public static final String MULTILINE
public static final String GLOBAL
public static final String IGNORE_CASE
public static final String STICKY
public static final String UNICODE
public static final String DOT_ALL
public static final String SOURCE
public static final String FLAGS
public static final String LAST_INDEX
public static final String INPUT
public static final String GROUPS
public static final String INDEX
public static final String INDICES
public static final PropertyProxy LAZY_INDEX_PROXY
public static final com.oracle.truffle.api.object.HiddenKey GROUPS_RESULT_ID
public static Object getCompiledRegex(com.oracle.truffle.api.object.DynamicObject thisObj)
public static JSObjectFactory getGroupsFactory(com.oracle.truffle.api.object.DynamicObject thisObj)
public static Object getRealm(com.oracle.truffle.api.object.DynamicObject thisObj)
public static boolean getLegacyFeaturesEnabled(com.oracle.truffle.api.object.DynamicObject thisObj)
public static com.oracle.truffle.api.object.DynamicObject create(JSContext ctx, 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 com.oracle.truffle.api.object.DynamicObject create(JSContext context, Object compiledRegex, JSObjectFactory groupsFactory)
lastIndex property.public static com.oracle.truffle.api.object.DynamicObject create(JSContext context, Object compiledRegex, JSObjectFactory groupsFactory, boolean legacyFeaturesEnabled)
lastIndex property.public static void updateCompilation(JSContext ctx, com.oracle.truffle.api.object.DynamicObject thisObj, Object regex)
public static com.oracle.truffle.api.object.DynamicObject createGroupsObject(JSContext context, JSObjectFactory groupsFactory, Object regexResult, String input, boolean isIndices)
public static JSObjectFactory buildGroupsFactory(JSContext ctx, Object namedCaptureGroups)
public static String prototypeToString(com.oracle.truffle.api.object.DynamicObject thisObj)
/ab*c/gipublic static boolean isJSRegExp(Object obj)
public com.oracle.truffle.api.object.DynamicObject createPrototype(JSRealm realm, com.oracle.truffle.api.object.DynamicObject ctor)
createPrototype in interface JSConstructorFactorypublic com.oracle.truffle.api.object.Shape makeInitialShape(JSContext ctx, com.oracle.truffle.api.object.DynamicObject thisObj)
makeInitialShape in class JSClasspublic static com.oracle.truffle.api.object.Shape makeInitialGroupsObjectShape(JSContext context)
public void fillConstructor(JSRealm realm, com.oracle.truffle.api.object.DynamicObject constructor)
fillConstructor in interface JSConstructorFactorypublic static JSConstructor createConstructor(JSRealm realm)
public String getClassName()
getClassName in interface JSConstructorFactorypublic String getClassName(com.oracle.truffle.api.object.DynamicObject object)
JSClassgetClassName in class JSClassobject - object to be usedpublic String getBuiltinToStringTag(com.oracle.truffle.api.object.DynamicObject object)
JSClassgetBuiltinToStringTag in class JSNonProxyobject - object to be usedJSClass.defaultToString(DynamicObject)public String toDisplayStringImpl(com.oracle.truffle.api.object.DynamicObject obj, int depth, boolean allowSideEffects, JSContext context)
JSClasstoDisplayStringImpl in class JSNonProxydepth - allowed nesting depthcontext - the current language contextpublic com.oracle.truffle.api.object.DynamicObject getIntrinsicDefaultProto(JSRealm realm)
getIntrinsicDefaultProto in interface PrototypeSupplierpublic static CharSequence escapeRegExpPattern(CharSequence pattern)