class Duktape::Context

Included Modules

Direct Known Subclasses

Defined in:

duktape/context.cr

Constructors

Instance Method Summary

Instance methods inherited from module Duktape::API::Type

check_type(index : LibDUK::Index, type : Symbol) check_type, check_type_mask(index : LibDUK::Index, mask : UInt32)
check_type_mask(index : LibDUK::Index, mask : LibDUK::TypeMask)
check_type_mask(index, types : Array(Symbol))
check_type_mask
, get_type(index : LibDUK::Index) get_type, get_type_mask(index : LibDUK::Index) get_type_mask, is_array(index : LibDUK::Index) is_array, is_boolean(index : LibDUK::Index) is_boolean, is_bound_function(index : LibDUK::Index) is_bound_function, is_buffer(index : LibDUK::Index) is_buffer, is_buffer_data(index : LibDUK::Index) is_buffer_data, is_callable(index : LibDUK::Index) is_callable, is_constructable(index : LibDUK::Index) is_constructable, is_constructor_call is_constructor_call, is_dynamic_buffer(index : LibDUK::Index) is_dynamic_buffer, is_ecmascript_function(index : LibDUK::Index) is_ecmascript_function, is_external_buffer(index : LibDUK::Index) is_external_buffer, is_fixed_buffer(index : LibDUK::Index) is_fixed_buffer, is_function(index : LibDUK::Index) is_function, is_lightfunc(index : LibDUK::Index) is_lightfunc, is_nan(index : LibDUK::Index) is_nan, is_null(index : LibDUK::Index) is_null, is_null_or_undefined(index : LibDUK::Index) is_null_or_undefined, is_number(index : LibDUK::Index) is_number, is_object(index : LibDUK::Index) is_object, is_object_coercible(index : LibDUK::Index) is_object_coercible, is_pointer(index : LibDUK::Index) is_pointer, is_primitive(index : LibDUK::Index) is_primitive, is_proc(index : LibDUK::Index) is_proc, is_strict_call is_strict_call, is_string(index : LibDUK::Index) is_string, is_symbol(index : LibDUK::Index) is_symbol, is_thread(index : LibDUK::Index) is_thread, is_undefined(index : LibDUK::Index) is_undefined

Instance methods inherited from module Duktape::API::Time

components_to_time(components : LibDUK::TimeComponents) components_to_time, get_now get_now, time_to_components(value : Float64) time_to_components

Instance methods inherited from module Duktape::API::Thread

resume(state : Slice(LibDUK::ThreadState)) resume, suspend suspend

Instance methods inherited from module Duktape::API::Strings

char_code_at(index : LibDUK::Index, offset : Int32) char_code_at, concat(count : Int32) concat, decode_string(index : LibDUK::Index, &func : Pointer(Void), Int32 -> Int32) decode_string, join(count : Int32) join, map_string(index : LibDUK::Index, &func : Pointer(Void), Int32 -> Int32) map_string, substring(index : LibDUK::Index, start : Int32, last : Int32) substring, trim(index : LibDUK::Index) trim

Instance methods inherited from module Duktape::API::Stack

check_stack(extra : Int32) check_stack, check_stack_top(top : Int32) check_stack_top, copy(from : Int32, to : Int32) copy, dup(from : Int32) dup, dup_top dup_top, empty? empty?, get_top get_top, get_top_index get_top_index, insert(to : Int32) insert, is_valid_index(index : LibDUK::Index) is_valid_index, normalize_index(index : LibDUK::Index) normalize_index, pull(from : LibDUK::Index) pull, remove(index : LibDUK::Index) remove, replace(to : Int32) replace, require_normalize_index(index : LibDUK::Index) require_normalize_index, require_stack(extra : Int32) require_stack, require_stack_top(top : Int32) require_stack_top, require_top_index require_top_index, require_valid_index(index : LibDUK::Index) require_valid_index, set_top(index : LibDUK::Index) set_top, swap(idx_1 : Int32, idx_2 : Int32) swap, swap_top(idx : Int32) swap_top, valid_index?(index : LibDUK::Index) valid_index?

Instance methods inherited from module Duktape::API::Require

require_boolean(index : LibDUK::Index) require_boolean, require_buffer(index : LibDUK::Index) require_buffer, require_callable(index : LibDUK::Index) require_callable, require_constructable(index : LibDUK::Index) require_constructable, require_constructor_call require_constructor_call, require_context(index : LibDUK::Index) require_context, require_function(index : LibDUK::Index) require_function, require_heapptr(index : LibDUK::Index) require_heapptr, require_int(index : LibDUK::Index) require_int, require_lstring(index : LibDUK::Index) require_lstring, require_null(index : LibDUK::Index) require_null, require_number(index : LibDUK::Index) require_number, require_object(index : LibDUK::Index) require_object, require_object_coercible(index : LibDUK::Index) require_object_coercible, require_pointer(index : LibDUK::Index) require_pointer, require_proc(index : LibDUK::Index) require_proc, require_string(index : LibDUK::Index) require_string, require_type_mask(index : LibDUK::Index, types : Array(Symbol) | UInt32)
require_type_mask(index : LibDUK::Index, types : LibDUK::TypeMask)
require_type_mask
, require_uint(index : LibDUK::Index) require_uint, require_undefined(index : LibDUK::Index) require_undefined

Instance methods inherited from module Duktape::API::Push

<<(value : Bool)
<<(value : Int::Signed)
<<(value : Int::Unsigned)
<<(value : String)
<<(value : Nil)
<<(value : Float)
<<
, push_array push_array, push_bare_array push_bare_array, push_bare_object push_bare_object, push_boolean(value : Bool) push_boolean, push_buffer(size : Int, resizable = false) push_buffer, push_context_dump push_context_dump, push_current_function push_current_function, push_current_thread push_current_thread, push_dynamic_buffer(size : Int) push_dynamic_buffer, push_error_object(err : Int32, msg : String)
push_error_object(err : LibDUK::Err, msg : String)
push_error_object
, push_external_buffer push_external_buffer, push_false push_false, push_fixed_buffer(size : Int) push_fixed_buffer, push_global_object push_global_object, push_global_proc(name : String, nargs : Int32 = 0, &block : LibDUK::Context -> Int32) push_global_proc, push_global_stash push_global_stash, push_heap_stash push_heap_stash, push_heapptr(ptr : Pointer(Void)) push_heapptr, push_int(value : Int) push_int, push_lstring(str : String, len : Int) push_lstring, push_nan push_nan, push_new_target push_new_target, push_null push_null, push_number(value : Float) push_number, push_object push_object, push_pointer(ptr : Pointer(Void)) push_pointer, push_proc(nargs : Int32 = 0, &block : LibDUK::Context -> Int32) push_proc, push_proxy push_proxy, push_string(str : String) push_string, push_this push_this, push_thread push_thread, push_thread_new_globalenv push_thread_new_globalenv, push_thread_stash(target_ctx : LibDUK::Context)
push_thread_stash(target_ctx : Duktape::Context)
push_thread_stash
, push_true push_true, push_uint(value : UInt8 | UInt16 | UInt32 | UInt64) push_uint, push_undefined push_undefined

Instance methods inherited from module Duktape::API::Prop

def_prop(index : LibDUK::Index, flags : UInt32)
def_prop(index : LibDUK::Index, flags : LibDUK::DefProp)
def_prop
, del_prop(index : LibDUK::Index) del_prop, del_prop_index(index : LibDUK::Index, arr_index : UInt32) del_prop_index, del_prop_string(index : LibDUK::Index, key : String) del_prop_string, get_global_string(key : String) get_global_string, get_prop(index : LibDUK::Index) get_prop, get_prop_index(index : LibDUK::Index, arr_index : UInt32) get_prop_index, get_prop_string(index : LibDUK::Index, key : String) get_prop_string, has_prop(index : LibDUK::Index) has_prop, has_prop_index(index : LibDUK::Index, arr_index : UInt32) has_prop_index, has_prop_string(index : LibDUK::Index, key : String) has_prop_string, put_global_heapptr(key : Pointer(Void)) put_global_heapptr, put_global_string(key : String) put_global_string, put_prop(index : LibDUK::Index) put_prop, put_prop_index(index : LibDUK::Index, arr_index : UInt32) put_prop_index, put_prop_string(index : LibDUK::Index, key : String) put_prop_string

Instance methods inherited from module Duktape::API::Pop

pop pop, pop_2 pop_2, pop_3 pop_3, pop_n(count : Int32) pop_n

Instance methods inherited from module Duktape::API::Opt

opt_boolean(index : LibDUK::Index, value : Bool) opt_boolean, opt_context(index : LibDUK::Index, value : LibDUK::Context) opt_context, opt_int(index : LibDUK::Index, value : Int) opt_int, opt_lstring(index : LibDUK::Index, value : String) opt_lstring, opt_number(index : LibDUK::Index, value : Float) opt_number, opt_string(index : LibDUK::Index, value : String) opt_string, opt_uint(index : LibDUK::Index, value : Int::Unsigned) opt_uint

Instance methods inherited from module Duktape::API::Object

compact(index : LibDUK::Index) compact, enum(index : LibDUK::Index, flags : UInt32)
enum(index : LibDUK::Index, flags : LibDUK::Enum)
enum
, equals(one : Int32, two : Int32) equals, freeze(index : LibDUK::Index) freeze, get_finalizer(index : LibDUK::Index) get_finalizer, get_prototype(index : LibDUK::Index) get_prototype, instanceof(one : Int32, two : Int32) instanceof, next(index : LibDUK::Index, get_val = false) next, samevalue(one : LibDUK::Index, two : LibDUK::Index) samevalue, seal(index : LibDUK::Index) seal, set_finalizer(index : LibDUK::Index) set_finalizer, set_global_object set_global_object, set_length(index : LibDUK::Index, size : Int) set_length, set_prototype(index : LibDUK::Index) set_prototype, strict_equals(one : Int32, two : Int32) strict_equals

Instance methods inherited from module Duktape::API::Math

random random

Instance methods inherited from module Duktape::API::Heap

gc gc

Instance methods inherited from module Duktape::API::Get

get_boolean(index : LibDUK::Index) get_boolean, get_buffer(index : LibDUK::Index) get_buffer, get_context(index : LibDUK::Index) get_context, get_global_heapptr(key : Pointer(Void)) get_global_heapptr, get_global_string(key : String) get_global_string, get_heapptr(index : LibDUK::Index) get_heapptr, get_int(index : LibDUK::Index) get_int, get_length(index : LibDUK::Index) get_length, get_lstring(index : LibDUK::Index) get_lstring, get_number(index : LibDUK::Index) get_number, get_pointer(index : LibDUK::Index) get_pointer, get_prop_string(index : LibDUK::Index, key : String) get_prop_string, get_string(index : LibDUK::Index) get_string, get_uint(index : LibDUK::Index) get_uint

Instance methods inherited from module Duktape::API::Eval

eval(str : String)
eval
eval
, eval!(str : String)
eval!
eval!
, eval_file(path : String) eval_file, eval_file!(path : String) eval_file!, eval_file_noresult(path : String) eval_file_noresult, eval_file_noresult!(path : String) eval_file_noresult!, eval_lstring(src : String, length : Int) eval_lstring, eval_lstring!(src : String, length : Int) eval_lstring!, eval_lstring_noresult(src : String, length : Int) eval_lstring_noresult, eval_lstring_noresult!(src : String, length : Int) eval_lstring_noresult!, eval_noresult eval_noresult, eval_noresult! eval_noresult!, eval_string(src : String) eval_string, eval_string!(src : String) eval_string!, eval_string_noresult(src : String) eval_string_noresult, eval_string_noresult!(src : String) eval_string_noresult!

Instance methods inherited from module Duktape::API::ErrorHandling

error(code : Int32, msg : String) error, fatal(msg : String) fatal, get_error_code(index : LibDUK::Index) get_error_code, is_error(index : LibDUK::Index) is_error, is_error?(index : LibDUK::Index) is_error?, raise_error(err = 0) raise_error, throw throw

Instance methods inherited from module Duktape::API::Debug

dump! dump!, stack stack

Instance methods inherited from module Duktape::API::Conversion

base64_decode(index : LibDUK::Index) base64_decode, base64_encode(index : LibDUK::Index) base64_encode, hex_decode(index : LibDUK::Index) hex_decode, hex_encode(index : LibDUK::Index) hex_encode, json_decode(index : LibDUK::Index) json_decode, json_encode(index : LibDUK::Index) json_encode

Instance methods inherited from module Duktape::API::Compile

compile(str : String)
compile
compile
, compile!(str : String)
compile!
compile!
, compile_file(str : String) compile_file, compile_file!(str : String) compile_file!, compile_lstring(src : String, length : Int32) compile_lstring, compile_lstring!(src : String, length : Int32) compile_lstring!, compile_lstring_filename(src : String, length : Int32) compile_lstring_filename, compile_lstring_filename!(src : String, length : Int32) compile_lstring_filename!, compile_string(src : String) compile_string, compile_string!(src : String) compile_string!, compile_string_filename(src : String) compile_string_filename, compile_string_filename!(src : String) compile_string_filename!, dump_function dump_function, load_function load_function

Instance methods inherited from module Duktape::API::Coercion

buffer_to_string(index : Int) buffer_to_string, safe_to_lstring(index : Int) safe_to_lstring, safe_to_stacktrace(index : Int) safe_to_stacktrace, safe_to_string(index : Int) safe_to_string, to_boolean(index : Int) to_boolean, to_buffer(index : Int) to_buffer, to_dynamic_buffer(index : Int) to_dynamic_buffer, to_fixed_buffer(index : Int) to_fixed_buffer, to_int(index : Int) to_int, to_int32(index : Int) to_int32, to_lstring(index : Int) to_lstring, to_null(index : Int) to_null, to_number(index : Int) to_number, to_object(index : Int) to_object, to_pointer(index : Int) to_pointer, to_primitive(index : Int, hint = LibDUK::Hint::String) to_primitive, to_stacktrace(index : Int) to_stacktrace, to_string(index : Int) to_string, to_uint(index : Int) to_uint, to_uint16(index : Int) to_uint16, to_uint32(index : Int) to_uint32, to_undefined(index : Int) to_undefined

Instance methods inherited from module Duktape::API::Call

call(nargs : Int32) call, call_failure(error = :error) call_failure, call_method(nargs : Int32) call_method, call_prop(index : LibDUK::Index, nargs : Int32) call_prop, call_success call_success, new(nargs : Int32) new, return(ret_val : Int32) return, return_undefined return_undefined, safe_call(nargs : Int32 = 0, nrets : Int32 = 0, &block : LibDUK::Context -> Int32) safe_call

Instance methods inherited from module Duktape::API::Buffer

config_buffer(index : LibDUK::Index, buf : Slice(UInt8)) config_buffer, get_buffer_data(index : LibDUK::Index) get_buffer_data, push_buffer_object(index : LibDUK::Index, byte_offset : Int32, byte_length : Int32, flags : UInt32)
push_buffer_object(index : LibDUK::Index, byte_offset : Int32, byte_length : Int32, flags : LibDUK::BufObj)
push_buffer_object
, require_buffer_data(index : LibDUK::Index) require_buffer_data, resize_buffer(index : LibDUK::Index, size : Int32) resize_buffer, steal_buffer(index : LibDUK::Index) steal_buffer

Constructor Detail

def self.new(context : LibDUK::Context) #

[View source]
def self.new #

[View source]

Instance Method Detail

def ctx #

[View source]
def destroy_heap! #

[View source]
def finalize #

[View source]
def heap_destroyed? : Bool #

[View source]
def raw #

[View source]
def sandbox? #

[View source]
def should_gc? : Bool #

[View source]
def timeout #

[View source]
def timeout? #

[View source]