Module Js_value

type value =
  1. | Undefined
  2. | Null
  3. | Bool of bool
  4. | Number of float
  5. | String of string
  6. | Object of obj
and obj = {
  1. id : int;
  2. mutable props : (string * value Stdlib.ref) list;
  3. kind : kind;
  4. mutable proto : obj option;
}
and kind =
  1. | Plain
  2. | Array of items
  3. | Closure of closure
  4. | Host_function of string * this:value -> value list -> value
  5. | Host_object of host
  6. | Regexp of Js_regexp.t
and host = {
  1. class_name : string;
  2. get : string -> value;
  3. set : string -> value -> unit;
  4. show : unit -> string;
}
and items = {
  1. mutable elements : value array;
  2. mutable length : int;
}
and closure = {
  1. func : Js_ast.func;
  2. scope : scope;
  3. this : value option;
}
and scope = {
  1. vars : (string, binding) Stdlib.Hashtbl.t;
  2. parent : scope option;
}
and binding = {
  1. mutable value : value;
  2. constant : bool;
}
exception Throw of value
val new_object : unit -> obj
val new_array : value list -> obj
val host_function : string -> (this:value -> value list -> value) -> value
val host_object : host -> value
val get_own : obj -> string -> value option
val set_own : obj -> string -> value -> unit
val keys : obj -> string list
val array_items : obj -> value list
val error : string -> string -> value
val throw : string -> string -> 'a
val typeof : value -> string
val truthy : value -> bool
val to_primitive : value -> value
val to_string : value -> string
val to_number : value -> float
val strict_equal : value -> value -> bool
val display : value -> string
val to_json : value -> string option