dowdiness/js_engine/interpreter does not have a README file
pub(all) enum BindingKind {
LetBinding
ConstBinding
VarBinding
}pub(all) enum Callable {
UserFunc(FuncData)
ArrowFunc(FuncData)
UserFuncExt(FuncDataExt)
ArrowFuncExt(FuncDataExt)
NativeCallable(String, (Array[Value]) -> Value raise)
NonConstructableCallable(String, (Array[Value]) -> Value raise)
BoundFunc(Value, Value, Array[Value])
FuncCallMethod(Value)
FuncApplyMethod(Value)
MethodCallable(String, (Value, Array[Value]) -> Value raise)
InterpreterCallable(String, (Interpreter, Value, Array[Value]) -> Value raise)
ConstructorOnlyCallable(String, (Interpreter, Array[Value]) -> Value raise)
ClassConstructor(String, Value, Value?, (Array[String], Array[Stmt])?, Environment, Value)
}fn Environment::def(self : Environment, name : String, value : Value, kind : BindingKind) -> Unit raisepub(all) struct FuncData {
name : String?
params : Array[String]
body : Array[Stmt]
closure : Environment
}pub(all) struct FuncDataExt {
name : String?
params : Array[Param]
rest_param : String?
body : Array[Stmt]
closure : Environment
}fn Interpreter::enqueue_microtask(self : Interpreter, callback : Value, args : Array[Value]) -> Unitpub(all) struct ObjectData {
properties : Map[String, Value]
symbol_properties : Map[Int, Value]
prototype : Value
callable : Callable?
class_name : String
descriptors : Map[String, PropDescriptor]
symbol_descriptors : Map[Int, PropDescriptor]
extensible : Bool
}pub(all) struct PromiseData {
state : PromiseState
result : Value
fulfill_reactions : Array[PromiseReaction]
reject_reactions : Array[PromiseReaction]
is_handled : Bool
properties : Map[String, Value]
symbol_properties : Map[Int, Value]
}pub(all) struct PromiseReaction {
handler : Value?
resolve : Value
reject : Value
reaction_type : PromiseReactionType
}pub(all) enum PromiseState {
Pending
Fulfilled
Rejected
}pub(all) struct PropDescriptor {
writable : Bool
enumerable : Bool
configurable : Bool
}pub(all) struct SymbolData {
id : Int
description : String?
}pub(all) enum Value {
Number(Double)
String_(String)
Bool(Bool)
Null
Undefined
Object(ObjectData)
Array(ArrayData)
Symbol(SymbolData)
Map(MapData)
Set(SetData)
Promise(PromiseData)
}fn is_js_catchable_error(err : Error) -> Boolfn regex_match_at(pattern : String, flags : String, input : String, start_pos : Int) -> RegexMatch? raisefn string_replace_regex(s : String, pattern : String, flags : String, replacement : String) -> Value