JSString class

A UTF16 character buffer. The fundamental string representation in JavaScript.

Implemented types
Mixed-in types
  • AutoDisposeFinalizer

Constructors

JSString.new(JSStringRef _ref, {bool autoDispose = true})
JSString.fromString(String? string, {bool autoDispose = true})
Creates a JavaScript string from dart String. string The dart String.

Properties

hashCode int
The hash code for this object.
no setteroverride
length int
Returns the number of Unicode characters in a JavaScript string.
no setter
nativeFinalizer NativeFinalizer?
dart 对象回收器
getter/setter pairinherited
ref JSStringRef
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
string String?
Returns dart String
no setter

Methods

attach(Pointer<NativeFinalizerFunction> callback, Pointer<Void> token, {bool autoDispose = true, Object? detach, int? externalSize}) → dynamic
将引擎持有的指针和 dart 对象回收器绑定。确保 dart 对象销毁的时候,释放引擎持有的指针和资源
inherited
detach() → dynamic
将引擎持有的指针和资源释放
inherited
free() → void
Releases a JavaScript string.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
retain() JSString
Retains a JavaScript string. @result (JSStringRef) A JSString that is the same as string.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override