package tiny_languages

  1. Overview
  2. Docs
Small languages from scratch: Scheme, Lisp, Smalltalk-80, Pascal, BASIC, JavaScript, HTML, CSS and more

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.3.6.tar.gz
md5=7c636383d146d30ac6f2fa234a6253c8
sha512=c79f3823c5f8f57e5038eb640d487c61168b84aa07c61999d6622ef9fd0c890e2b03b4c6a7cdbbe9352a49e25dda00ac7bb14693cee8e3d7beeed251351a2af0

doc/tiny_languages.javascript/Js_value/index.html

Module Js_valueSource

Sourcetype value =
  1. | Undefined
  2. | Null
  3. | Bool of bool
  4. | Number of float
  5. | String of string
  6. | Object of obj
Sourceand obj = {
  1. id : int;
  2. mutable props : (string * value ref) list;
  3. kind : kind;
  4. mutable proto : obj option;
}
Sourceand 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
Sourceand host = {
  1. class_name : string;
  2. get : string -> value;
  3. set : string -> value -> unit;
  4. show : unit -> string;
}
Sourceand items = {
  1. mutable elements : value array;
  2. mutable length : int;
}
Sourceand closure = {
  1. func : Js_ast.func;
  2. scope : scope;
  3. this : value option;
}
Sourceand scope = {
  1. vars : (string, binding) Hashtbl.t;
  2. parent : scope option;
}
Sourceand binding = {
  1. mutable value : value;
  2. constant : bool;
}
Sourceexception Throw of value
Sourceval new_object : unit -> obj
Sourceval new_array : value list -> obj
Sourceval host_function : string -> (this:value -> value list -> value) -> value
Sourceval host_object : host -> value
Sourceval get_own : obj -> string -> value option
Sourceval set_own : obj -> string -> value -> unit
Sourceval keys : obj -> string list
Sourceval array_items : obj -> value list
Sourceval error : string -> string -> value
Sourceval throw : string -> string -> 'a
Sourceval typeof : value -> string
Sourceval truthy : value -> bool
Sourceval to_primitive : value -> value
Sourceval to_string : value -> string
Sourceval to_number : value -> float
Sourceval strict_equal : value -> value -> bool
Sourceval display : value -> string
Sourceval to_json : value -> string option