JSFValue<T> class abstract

抽象 JSValue 对象

Constructors

JSFValue.new(T jsValue)
JSFValue.makeBoolean(JSFContext ctx, bool v)
创建 bool 对象
JSFValue.makeError(JSFContext ctx, String errorStr)
创建 error 对象
JSFValue.makeFromJSONString(JSFContext ctx, String jsonStr)
从 JSON 字符串中创建 js 对象
JSFValue.makeNull(JSFContext ctx)
创建 null 对象
JSFValue.makeNumber(JSFContext ctx, int number)
创建 number 对象
JSFValue.makeString(JSFContext ctx, String str)
创建字符串对象
JSFValue.makeUndefined(JSFContext ctx)
创建 undefined 对象
JSFValue.throwInternalError(JSFContext ctx, String fmt)
抛出 InternalError 错误
JSFValue.throwOutOfMemory(JSFContext ctx, String fmt)
抛出 OutOfMemory 错误
JSFValue.throwReferenceError(JSFContext ctx, String fmt)
抛出 ReferenceError 错误
JSFValue.throwSyntaxError(JSFContext ctx, String fmt)
抛出 SyntaxError 错误
JSFValue.throwTypeError(JSFContext ctx, String fmt)
抛出 TypeError 错误

Properties

hashCode int
The hash code for this object.
no setteroverride
jsValue ↔ T
实际 js value 对象
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callAsConstructor({List<JSFValue>? arguments}) JSFValue
此 js 对象是构造函数,将它作为构造函数调用 arguments 是构造函数参数
callAsFunction({JSFValue? thiz, List<JSFValue>? arguments}) JSFValue
此 js 对象是函数,将它作为函数调用 {param} thiz 指定函数 this arguments 函数参数
dup() JSFValue
getProperty(String name) JSFValue
根据 name 获取 js 对象的属性值
getPropertyAtIndex(int index) JSFValue
根据 index 获取 js 对象的属性值
hasProperty(String name) bool
isArray() bool
在 dart 侧判断 js value 是否是 Array
isBoolean() bool
在 dart 侧判断 js value 是否是 bool
isDate() bool
在 dart 侧判断 js value 是否是 Date
isEqual(JSFValue other) bool
在 dart 侧判断两个 js value 是否严格相等
isError() bool
在 dart 侧判断 js value 是否是 Error
isFunction() bool
在 dart 侧判断 js value 是否是 Function
isNull() bool
在 dart 侧判断 js value 是否是 null
isNumber() bool
在 dart 侧判断 js value 是否是 number
isObject() bool
在 dart 侧判断 js value 是否是 Object
isPromise() bool
在 dart 侧判断 js value 是否是 Promise
isRegExp() bool
在 dart 侧判断 js value 是否是 RegExp
isString() bool
在 dart 侧判断 js value 是否是 String
isSymbol() bool
在 dart 侧判断 js value 是否是 Symbol
isUndefined() bool
在 dart 侧判断 js value 是否是 undefined
jsonString() String?
keys(JSFContext ctx) JSFValue
获取 js 对象的所有 key, 等同于 Object.keys(v)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setProperty(String name, JSFValue? v) → void
为 js 对象设置属性
toArray() List<JSFValue>?
js value 转为 js array
toBoolean() bool
转为 dart bool 值
toDart() → dynamic
js value 转为 dart
toJs() → dynamic
当前只支持 number、boolean、null、string 类型
toNumber() num
转为 dart num 值
toString() String
A string representation of this object.
override
toStringCopy() String?
底层复制一份
values(JSFContext ctx) JSFValue
获取 js 对象的所有 value, 等同于 Object.values(v)

Operators

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