public final class JSString extends JSPrimitive implements JSConstructorFactory.WithFunctions
Type | Property and Description |
---|---|
boolean |
usesOrdinaryGetOwn |
Modifier and Type | Class and Description |
---|---|
static class |
JSString.StringLengthProxyProperty |
JSConstructorFactory.Default, JSConstructorFactory.WithFunctions, JSConstructorFactory.WithFunctionsAndSpecies
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_NAME |
static String |
CLASS_NAME_EXTENSIONS |
static JSString |
INSTANCE |
static com.oracle.truffle.api.object.HiddenKey |
ITERATED_STRING_ID |
static String |
ITERATOR_CLASS_NAME |
static String |
ITERATOR_PROTOTYPE_NAME |
static String |
LENGTH |
static String |
PROTOTYPE_NAME |
static String |
REGEXP_ITERATOR_CLASS_NAME |
static com.oracle.truffle.api.object.HiddenKey |
REGEXP_ITERATOR_DONE_ID |
static com.oracle.truffle.api.object.HiddenKey |
REGEXP_ITERATOR_GLOBAL_ID |
static com.oracle.truffle.api.object.HiddenKey |
REGEXP_ITERATOR_ITERATED_STRING_ID |
static com.oracle.truffle.api.object.HiddenKey |
REGEXP_ITERATOR_ITERATING_REGEXP_ID |
static String |
REGEXP_ITERATOR_PROTOTYPE_NAME |
static com.oracle.truffle.api.object.HiddenKey |
REGEXP_ITERATOR_UNICODE_ID |
static com.oracle.truffle.api.object.HiddenKey |
STRING_ITERATOR_NEXT_INDEX_ID |
static String |
TYPE_NAME |
EMPTY_STRING_ARRAY
Modifier and Type | Method and Description |
---|---|
static com.oracle.truffle.api.object.DynamicObject |
create(JSContext context,
CharSequence value) |
static JSConstructor |
createConstructor(JSRealm realm) |
com.oracle.truffle.api.object.DynamicObject |
createPrototype(JSRealm realm,
com.oracle.truffle.api.object.DynamicObject ctor) |
boolean |
defineOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj,
Object key,
PropertyDescriptor desc,
boolean doThrow)
9.1.6 [[DefineOwnProperty]] (P, Desc).
|
boolean |
delete(com.oracle.truffle.api.object.DynamicObject thisObj,
Object key,
boolean isStrict)
9.1.10 [[Delete]] (P).
|
String |
getBuiltinToStringTag(com.oracle.truffle.api.object.DynamicObject object)
Returns builtinTag from step 14 of ES6+ 19.1.3.6.
|
static CharSequence |
getCharSequence(com.oracle.truffle.api.object.DynamicObject obj) |
String |
getClassName() |
String |
getClassName(com.oracle.truffle.api.object.DynamicObject object)
The [[Class]] internal property.
|
com.oracle.truffle.api.object.DynamicObject |
getIntrinsicDefaultProto(JSRealm realm) |
Object |
getOwnHelper(com.oracle.truffle.api.object.DynamicObject store,
Object thisObj,
long index)
Like getOwnProperty, but returns
null if value is not present instead of undefined. |
Object |
getOwnHelper(com.oracle.truffle.api.object.DynamicObject store,
Object thisObj,
Object key)
Like getOwnProperty, but returns
null if value is not present instead of undefined. |
PropertyDescriptor |
getOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj,
Object key)
9.1.5 [[GetOwnProperty]] (P).
|
List<Object> |
getOwnPropertyKeys(com.oracle.truffle.api.object.DynamicObject thisObj,
boolean strings,
boolean symbols)
GetOwnPropertyKeys (O, type).
|
static String |
getString(com.oracle.truffle.api.object.DynamicObject obj) |
static int |
getStringLength(com.oracle.truffle.api.object.DynamicObject obj) |
boolean |
hasOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj,
long index) |
boolean |
hasOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj,
Object key) |
static boolean |
isJSString(Object obj) |
com.oracle.truffle.api.object.Shape |
makeInitialShape(JSContext context,
com.oracle.truffle.api.object.DynamicObject prototype) |
boolean |
set(com.oracle.truffle.api.object.DynamicObject thisObj,
long index,
Object value,
Object receiver,
boolean isStrict) |
boolean |
set(com.oracle.truffle.api.object.DynamicObject thisObj,
Object key,
Object value,
Object receiver,
boolean isStrict)
9.1.9 [[Set]] (P, V, Receiver).
|
static PropertyDescriptor |
stringGetIndexProperty(com.oracle.truffle.api.object.DynamicObject thisObj,
Object key)
ES6, 9.4.3.1.1 StringGetIndexProperty (S, P).
|
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.
|
boolean |
usesOrdinaryGetOwnProperty() |
getHelper, getMethodHelper
checkProtoCycle, createSymbolSpeciesGetterFunction, delete, deletePropertyDefault, getHelper, getPrototypeOf, hasOnlyShapeProperties, hasProperty, hasProperty, invokeAccessorPropertySetter, isExtensible, ordinaryGetOwnProperty, ordinaryGetOwnPropertyIntl, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeysSlow, ordinarySet, ordinarySetIndex, ordinarySetWithReceiver, performOrdinarySetWithOwnDescriptor, preventExtensions, preventExtensionsImpl, putConstructorSpeciesGetter, setIntegrityLevel, setIntegrityLevelFast, setPropertySlow, setPrototypeOf, testIntegrityLevel, testIntegrityLevelFast, toString, usesOrdinaryIsExtensible
defaultToString, filterOwnPropertyKeys, formatToString, get, get, getToStringTag, isInstance, isInstance, isInstance, isInstance, ownPropertyKeys, testIntegrityLevelDefault
dispatch, equals, hashCode, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createConstructorAndPrototype
createConstructorObject, fillConstructor
public boolean usesOrdinaryGetOwnProperty
usesOrdinaryGetOwnProperty
in class JSNonProxy
public static final JSString INSTANCE
public static final String TYPE_NAME
public static final String CLASS_NAME
public static final String PROTOTYPE_NAME
public static final String CLASS_NAME_EXTENSIONS
public static final String LENGTH
public static final String ITERATOR_CLASS_NAME
public static final String ITERATOR_PROTOTYPE_NAME
public static final com.oracle.truffle.api.object.HiddenKey ITERATED_STRING_ID
public static final com.oracle.truffle.api.object.HiddenKey STRING_ITERATOR_NEXT_INDEX_ID
public static final String REGEXP_ITERATOR_CLASS_NAME
public static final String REGEXP_ITERATOR_PROTOTYPE_NAME
public static final com.oracle.truffle.api.object.HiddenKey REGEXP_ITERATOR_ITERATING_REGEXP_ID
public static final com.oracle.truffle.api.object.HiddenKey REGEXP_ITERATOR_ITERATED_STRING_ID
public static final com.oracle.truffle.api.object.HiddenKey REGEXP_ITERATOR_GLOBAL_ID
public static final com.oracle.truffle.api.object.HiddenKey REGEXP_ITERATOR_UNICODE_ID
public static final com.oracle.truffle.api.object.HiddenKey REGEXP_ITERATOR_DONE_ID
public static com.oracle.truffle.api.object.DynamicObject create(JSContext context, CharSequence value)
public boolean hasOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj, Object key)
hasOwnProperty
in class JSNonProxy
public static CharSequence getCharSequence(com.oracle.truffle.api.object.DynamicObject obj)
public static String getString(com.oracle.truffle.api.object.DynamicObject obj)
public static int getStringLength(com.oracle.truffle.api.object.DynamicObject obj)
public boolean hasOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj, long index)
hasOwnProperty
in class JSNonProxy
public Object getOwnHelper(com.oracle.truffle.api.object.DynamicObject store, Object thisObj, Object key)
JSNonProxy
null
if value is not present instead of undefined.getOwnHelper
in class JSNonProxy
public Object getOwnHelper(com.oracle.truffle.api.object.DynamicObject store, Object thisObj, long index)
JSNonProxy
null
if value is not present instead of undefined.getOwnHelper
in class JSNonProxy
public boolean set(com.oracle.truffle.api.object.DynamicObject thisObj, Object key, Object value, Object receiver, boolean isStrict)
JSClass
set
in class JSNonProxy
public boolean set(com.oracle.truffle.api.object.DynamicObject thisObj, long index, Object value, Object receiver, boolean isStrict)
set
in class JSNonProxy
public List<Object> getOwnPropertyKeys(com.oracle.truffle.api.object.DynamicObject thisObj, boolean strings, boolean symbols)
JSClass
getOwnPropertyKeys
in class JSNonProxy
public boolean delete(com.oracle.truffle.api.object.DynamicObject thisObj, Object key, boolean isStrict)
JSClass
delete
in class JSNonProxy
public com.oracle.truffle.api.object.DynamicObject createPrototype(JSRealm realm, com.oracle.truffle.api.object.DynamicObject ctor)
createPrototype
in interface JSConstructorFactory
public com.oracle.truffle.api.object.Shape makeInitialShape(JSContext context, com.oracle.truffle.api.object.DynamicObject prototype)
makeInitialShape
in class JSClass
public static JSConstructor createConstructor(JSRealm realm)
public String getClassName()
getClassName
in interface JSConstructorFactory
public String getClassName(com.oracle.truffle.api.object.DynamicObject object)
JSClass
getClassName
in class JSClass
object
- object to be usedpublic String getBuiltinToStringTag(com.oracle.truffle.api.object.DynamicObject object)
JSClass
getBuiltinToStringTag
in class JSNonProxy
object
- object to be usedJSClass.defaultToString(DynamicObject)
public String toDisplayStringImpl(com.oracle.truffle.api.object.DynamicObject obj, int depth, boolean allowSideEffects, JSContext context)
JSClass
toDisplayStringImpl
in class JSNonProxy
depth
- allowed nesting depthcontext
- the current language contextpublic static boolean isJSString(Object obj)
public PropertyDescriptor getOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj, Object key)
JSClass
getOwnProperty
in class JSNonProxy
public boolean usesOrdinaryGetOwnProperty()
usesOrdinaryGetOwnProperty
in class JSNonProxy
public boolean defineOwnProperty(com.oracle.truffle.api.object.DynamicObject thisObj, Object key, PropertyDescriptor desc, boolean doThrow)
JSClass
defineOwnProperty
in class JSNonProxy
public static PropertyDescriptor stringGetIndexProperty(com.oracle.truffle.api.object.DynamicObject thisObj, Object key)
public com.oracle.truffle.api.object.DynamicObject getIntrinsicDefaultProto(JSRealm realm)
getIntrinsicDefaultProto
in interface PrototypeSupplier