Class: Quickjs::VM
- Inherits:
-
Object
- Object
- Quickjs::VM
- Includes:
- PolyfillLoader
- Defined in:
- lib/quickjs/runnable.rb,
sig/quickjs.rbs,
ext/quickjsrb/quickjsrb.c
Defined Under Namespace
Classes: Log
Instance Method Summary collapse
- #call(*args) ⇒ Object
- #compile(source, **opts) ⇒ Runnable
- #define_function(*args) {|arg0| ... } ⇒ Object
- #dispose! ⇒ nil
- #disposed? ⇒ Boolean
- #drain_jobs! ⇒ Integer
- #eval_code(*args) ⇒ Object
- #gc! ⇒ nil
- #import(*args) ⇒ Object
-
#initialize(*args) ⇒ VM
constructor
A new instance of VM.
- #memory_poisoned? ⇒ Boolean
- #memory_usage ⇒ Hash[Symbol, Integer]
- #module_loader ⇒ module_loader_proc?
- #module_loader=(r_loader) ⇒ module_loader_proc?
- #on_log {|arg0| ... } ⇒ nil
- #on_unhandled_rejection {|arg0| ... } ⇒ nil
Constructor Details
#initialize(*args) ⇒ VM
Returns a new instance of VM.
1018 |
# File 'ext/quickjsrb/quickjsrb.c', line 1018
def initialize: (?features: Array[Symbol], ?memory_limit: Integer, ?max_stack_size: Integer, ?timeout_msec: Integer) -> void
|
Instance Method Details
#call(*args) ⇒ Object
1463 |
# File 'ext/quickjsrb/quickjsrb.c', line 1463
def call: (String | Symbol name, *untyped args) -> untyped
|
#compile(source, **opts) ⇒ Runnable
19 20 21 |
# File 'lib/quickjs/runnable.rb', line 19 def compile(source, **opts) Runnable.new(send(:_compile_to_bytecode, source, **opts)) end |
#define_function(name, flags) ⇒ Symbol #define_function(path, flags) ⇒ Array[Symbol]
1339 1340 |
# File 'ext/quickjsrb/quickjsrb.c', line 1339
def define_function: (String | Symbol name, *Symbol flags) { (*untyped) -> untyped } -> Symbol
| (Array[String | Symbol] path, *Symbol flags) { (*untyped) -> untyped } -> Array[Symbol]
|
#dispose! ⇒ nil
35 |
# File 'ext/quickjsrb/quickjsrb.c', line 35
def dispose!: () -> nil
|
#disposed? ⇒ Boolean
36 |
# File 'ext/quickjsrb/quickjsrb.c', line 36
def disposed?: () -> bool
|
#drain_jobs! ⇒ Integer
37 |
# File 'ext/quickjsrb/quickjsrb.c', line 37
def drain_jobs!: () -> Integer
|
#eval_code(*args) ⇒ Object
1197 |
# File 'ext/quickjsrb/quickjsrb.c', line 1197
def eval_code: (String code, ?async: bool, ?filename: String) -> untyped
|
#gc! ⇒ nil
33 |
# File 'ext/quickjsrb/quickjsrb.c', line 33
def gc!: () -> nil
|
#import(imported, from:, code_to_expose:) ⇒ true #import(imported, filename:, code_to_expose:) ⇒ true
1637 1638 |
# File 'ext/quickjsrb/quickjsrb.c', line 1637
def import: (String | Array[String] | Hash[Symbol, String] imported, from: String, ?code_to_expose: String?) -> true
| (String | Array[String] | Hash[Symbol, String] imported, filename: String, ?code_to_expose: String?) -> true
|
#memory_poisoned? ⇒ Boolean
34 |
# File 'ext/quickjsrb/quickjsrb.c', line 34
def memory_poisoned?: () -> bool
|
#memory_usage ⇒ Hash[Symbol, Integer]
32 |
# File 'ext/quickjsrb/quickjsrb.c', line 32
def memory_usage: () -> Hash[Symbol, Integer]
|
#module_loader ⇒ module_loader_proc?
1619 |
# File 'ext/quickjsrb/quickjsrb.c', line 1619
def module_loader: () -> (module_loader_proc | nil)
|
#module_loader=(r_loader) ⇒ module_loader_proc?
1602 |
# File 'ext/quickjsrb/quickjsrb.c', line 1602
def module_loader=: (module_loader_proc | nil) -> (module_loader_proc | nil)
|
#on_log {|arg0| ... } ⇒ nil
893 |
# File 'ext/quickjsrb/quickjsrb.c', line 893
def on_log: () { (Log) -> void } -> nil
|
#on_unhandled_rejection {|arg0| ... } ⇒ nil
1626 |
# File 'ext/quickjsrb/quickjsrb.c', line 1626
def on_unhandled_rejection: () { (Quickjs::RuntimeError) -> void } -> nil
|