Skip to content

Add JS::Error class to catch JS exception #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 96 additions & 20 deletions ext/js/bindgen/rb-js-abi-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ void rb_js_abi_host_string_free(rb_js_abi_host_string_t *ret) {
ret->ptr = NULL;
ret->len = 0;
}
void rb_js_abi_host_js_abi_result_free(rb_js_abi_host_js_abi_result_t *ptr) {
switch ((int32_t) ptr->tag) {
case 0: {
rb_js_abi_host_js_abi_value_free(&ptr->val.success);
break;
}
case 1: {
rb_js_abi_host_js_abi_value_free(&ptr->val.failure);
break;
}
}
}
void rb_js_abi_host_raw_integer_free(rb_js_abi_host_raw_integer_t *ptr) {
switch ((int32_t) ptr->tag) {
case 1: {
Expand All @@ -63,11 +75,27 @@ void rb_js_abi_host_list_js_abi_value_free(rb_js_abi_host_list_js_abi_value_t *p
free(ptr->ptr);
}
}
__attribute__((import_module("rb-js-abi-host"), import_name("eval-js: func(code: string) -> handle<js-abi-value>")))
int32_t __wasm_import_rb_js_abi_host_eval_js(int32_t, int32_t);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_eval_js(rb_js_abi_host_string_t *code) {
int32_t ret = __wasm_import_rb_js_abi_host_eval_js((int32_t) (*code).ptr, (int32_t) (*code).len);
return (rb_js_abi_host_js_abi_value_t){ ret };
__attribute__((import_module("rb-js-abi-host"), import_name("eval-js: func(code: string) -> variant { success(handle<js-abi-value>), failure(handle<js-abi-value>) }")))
void __wasm_import_rb_js_abi_host_eval_js(int32_t, int32_t, int32_t);
void rb_js_abi_host_eval_js(rb_js_abi_host_string_t *code, rb_js_abi_host_js_abi_result_t *ret0) {

__attribute__((aligned(4)))
uint8_t ret_area[8];
int32_t ptr = (int32_t) &ret_area;
__wasm_import_rb_js_abi_host_eval_js((int32_t) (*code).ptr, (int32_t) (*code).len, ptr);
rb_js_abi_host_js_abi_result_t variant;
variant.tag = (int32_t) (*((uint8_t*) (ptr + 0)));
switch ((int32_t) variant.tag) {
case 0: {
variant.val.success = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
case 1: {
variant.val.failure = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
}
*ret0 = variant;
}
__attribute__((import_module("rb-js-abi-host"), import_name("is-js: func(value: handle<js-abi-value>) -> bool")))
int32_t __wasm_import_rb_js_abi_host_is_js(int32_t);
Expand Down Expand Up @@ -182,11 +210,27 @@ bool rb_js_abi_host_js_value_strictly_equal(rb_js_abi_host_js_abi_value_t lhs, r
int32_t ret = __wasm_import_rb_js_abi_host_js_value_strictly_equal((lhs).idx, (rhs).idx);
return ret;
}
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-apply: func(target: handle<js-abi-value>, this-argument: handle<js-abi-value>, arguments: list<handle<js-abi-value>>) -> handle<js-abi-value>")))
int32_t __wasm_import_rb_js_abi_host_reflect_apply(int32_t, int32_t, int32_t, int32_t);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_apply(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_js_abi_value_t this_argument, rb_js_abi_host_list_js_abi_value_t *arguments) {
int32_t ret = __wasm_import_rb_js_abi_host_reflect_apply((target).idx, (this_argument).idx, (int32_t) (*arguments).ptr, (int32_t) (*arguments).len);
return (rb_js_abi_host_js_abi_value_t){ ret };
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-apply: func(target: handle<js-abi-value>, this-argument: handle<js-abi-value>, arguments: list<handle<js-abi-value>>) -> variant { success(handle<js-abi-value>), failure(handle<js-abi-value>) }")))
void __wasm_import_rb_js_abi_host_reflect_apply(int32_t, int32_t, int32_t, int32_t, int32_t);
void rb_js_abi_host_reflect_apply(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_js_abi_value_t this_argument, rb_js_abi_host_list_js_abi_value_t *arguments, rb_js_abi_host_js_abi_result_t *ret0) {

__attribute__((aligned(4)))
uint8_t ret_area[8];
int32_t ptr = (int32_t) &ret_area;
__wasm_import_rb_js_abi_host_reflect_apply((target).idx, (this_argument).idx, (int32_t) (*arguments).ptr, (int32_t) (*arguments).len, ptr);
rb_js_abi_host_js_abi_result_t variant;
variant.tag = (int32_t) (*((uint8_t*) (ptr + 0)));
switch ((int32_t) variant.tag) {
case 0: {
variant.val.success = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
case 1: {
variant.val.failure = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
}
*ret0 = variant;
}
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-construct: func(target: handle<js-abi-value>, arguments: list<handle<js-abi-value>>) -> handle<js-abi-value>")))
int32_t __wasm_import_rb_js_abi_host_reflect_construct(int32_t, int32_t, int32_t);
Expand All @@ -200,11 +244,27 @@ bool rb_js_abi_host_reflect_delete_property(rb_js_abi_host_js_abi_value_t target
int32_t ret = __wasm_import_rb_js_abi_host_reflect_delete_property((target).idx, (int32_t) (*property_key).ptr, (int32_t) (*property_key).len);
return ret;
}
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-get: func(target: handle<js-abi-value>, property-key: string) -> handle<js-abi-value>")))
int32_t __wasm_import_rb_js_abi_host_reflect_get(int32_t, int32_t, int32_t);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_get(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key) {
int32_t ret = __wasm_import_rb_js_abi_host_reflect_get((target).idx, (int32_t) (*property_key).ptr, (int32_t) (*property_key).len);
return (rb_js_abi_host_js_abi_value_t){ ret };
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-get: func(target: handle<js-abi-value>, property-key: string) -> variant { success(handle<js-abi-value>), failure(handle<js-abi-value>) }")))
void __wasm_import_rb_js_abi_host_reflect_get(int32_t, int32_t, int32_t, int32_t);
void rb_js_abi_host_reflect_get(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key, rb_js_abi_host_js_abi_result_t *ret0) {

__attribute__((aligned(4)))
uint8_t ret_area[8];
int32_t ptr = (int32_t) &ret_area;
__wasm_import_rb_js_abi_host_reflect_get((target).idx, (int32_t) (*property_key).ptr, (int32_t) (*property_key).len, ptr);
rb_js_abi_host_js_abi_result_t variant;
variant.tag = (int32_t) (*((uint8_t*) (ptr + 0)));
switch ((int32_t) variant.tag) {
case 0: {
variant.val.success = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
case 1: {
variant.val.failure = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
}
*ret0 = variant;
}
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-get-own-property-descriptor: func(target: handle<js-abi-value>, property-key: string) -> handle<js-abi-value>")))
int32_t __wasm_import_rb_js_abi_host_reflect_get_own_property_descriptor(int32_t, int32_t, int32_t);
Expand Down Expand Up @@ -246,11 +306,27 @@ bool rb_js_abi_host_reflect_prevent_extensions(rb_js_abi_host_js_abi_value_t tar
int32_t ret = __wasm_import_rb_js_abi_host_reflect_prevent_extensions((target).idx);
return ret;
}
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-set: func(target: handle<js-abi-value>, property-key: string, value: handle<js-abi-value>) -> bool")))
int32_t __wasm_import_rb_js_abi_host_reflect_set(int32_t, int32_t, int32_t, int32_t);
bool rb_js_abi_host_reflect_set(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key, rb_js_abi_host_js_abi_value_t value) {
int32_t ret = __wasm_import_rb_js_abi_host_reflect_set((target).idx, (int32_t) (*property_key).ptr, (int32_t) (*property_key).len, (value).idx);
return ret;
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-set: func(target: handle<js-abi-value>, property-key: string, value: handle<js-abi-value>) -> variant { success(handle<js-abi-value>), failure(handle<js-abi-value>) }")))
void __wasm_import_rb_js_abi_host_reflect_set(int32_t, int32_t, int32_t, int32_t, int32_t);
void rb_js_abi_host_reflect_set(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key, rb_js_abi_host_js_abi_value_t value, rb_js_abi_host_js_abi_result_t *ret0) {

__attribute__((aligned(4)))
uint8_t ret_area[8];
int32_t ptr = (int32_t) &ret_area;
__wasm_import_rb_js_abi_host_reflect_set((target).idx, (int32_t) (*property_key).ptr, (int32_t) (*property_key).len, (value).idx, ptr);
rb_js_abi_host_js_abi_result_t variant;
variant.tag = (int32_t) (*((uint8_t*) (ptr + 0)));
switch ((int32_t) variant.tag) {
case 0: {
variant.val.success = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
case 1: {
variant.val.failure = (rb_js_abi_host_js_abi_value_t){ *((int32_t*) (ptr + 4)) };
break;
}
}
*ret0 = variant;
}
__attribute__((import_module("rb-js-abi-host"), import_name("reflect-set-prototype-of: func(target: handle<js-abi-value>, prototype: handle<js-abi-value>) -> bool")))
int32_t __wasm_import_rb_js_abi_host_reflect_set_prototype_of(int32_t, int32_t);
Expand Down
18 changes: 14 additions & 4 deletions ext/js/bindgen/rb-js-abi-host.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ extern "C"
void rb_js_abi_host_string_set(rb_js_abi_host_string_t *ret, const char *s);
void rb_js_abi_host_string_dup(rb_js_abi_host_string_t *ret, const char *s);
void rb_js_abi_host_string_free(rb_js_abi_host_string_t *ret);
typedef struct {
uint8_t tag;
union {
rb_js_abi_host_js_abi_value_t success;
rb_js_abi_host_js_abi_value_t failure;
} val;
} rb_js_abi_host_js_abi_result_t;
#define RB_JS_ABI_HOST_JS_ABI_RESULT_SUCCESS 0
#define RB_JS_ABI_HOST_JS_ABI_RESULT_FAILURE 1
void rb_js_abi_host_js_abi_result_free(rb_js_abi_host_js_abi_result_t *ptr);
typedef struct {
uint8_t tag;
union {
Expand All @@ -37,7 +47,7 @@ extern "C"
size_t len;
} rb_js_abi_host_list_js_abi_value_t;
void rb_js_abi_host_list_js_abi_value_free(rb_js_abi_host_list_js_abi_value_t *ptr);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_eval_js(rb_js_abi_host_string_t *code);
void rb_js_abi_host_eval_js(rb_js_abi_host_string_t *code, rb_js_abi_host_js_abi_result_t *ret0);
bool rb_js_abi_host_is_js(rb_js_abi_host_js_abi_value_t value);
bool rb_js_abi_host_instance_of(rb_js_abi_host_js_abi_value_t value, rb_js_abi_host_js_abi_value_t klass);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_global_this(void);
Expand All @@ -53,17 +63,17 @@ extern "C"
void rb_js_abi_host_js_value_typeof(rb_js_abi_host_js_abi_value_t value, rb_js_abi_host_string_t *ret0);
bool rb_js_abi_host_js_value_equal(rb_js_abi_host_js_abi_value_t lhs, rb_js_abi_host_js_abi_value_t rhs);
bool rb_js_abi_host_js_value_strictly_equal(rb_js_abi_host_js_abi_value_t lhs, rb_js_abi_host_js_abi_value_t rhs);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_apply(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_js_abi_value_t this_argument, rb_js_abi_host_list_js_abi_value_t *arguments);
void rb_js_abi_host_reflect_apply(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_js_abi_value_t this_argument, rb_js_abi_host_list_js_abi_value_t *arguments, rb_js_abi_host_js_abi_result_t *ret0);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_construct(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_list_js_abi_value_t *arguments);
bool rb_js_abi_host_reflect_delete_property(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_get(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key);
void rb_js_abi_host_reflect_get(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key, rb_js_abi_host_js_abi_result_t *ret0);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_get_own_property_descriptor(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key);
rb_js_abi_host_js_abi_value_t rb_js_abi_host_reflect_get_prototype_of(rb_js_abi_host_js_abi_value_t target);
bool rb_js_abi_host_reflect_has(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key);
bool rb_js_abi_host_reflect_is_extensible(rb_js_abi_host_js_abi_value_t target);
void rb_js_abi_host_reflect_own_keys(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_list_js_abi_value_t *ret0);
bool rb_js_abi_host_reflect_prevent_extensions(rb_js_abi_host_js_abi_value_t target);
bool rb_js_abi_host_reflect_set(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key, rb_js_abi_host_js_abi_value_t value);
void rb_js_abi_host_reflect_set(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_string_t *property_key, rb_js_abi_host_js_abi_value_t value, rb_js_abi_host_js_abi_result_t *ret0);
bool rb_js_abi_host_reflect_set_prototype_of(rb_js_abi_host_js_abi_value_t target, rb_js_abi_host_js_abi_value_t prototype);
#ifdef __cplusplus
}
Expand Down
13 changes: 9 additions & 4 deletions ext/js/bindgen/rb-js-abi-host.wit
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
resource js-abi-value

eval-js: func(code: string) -> js-abi-value
variant js-abi-result {
success(js-abi-value),
failure(js-abi-value),
}

eval-js: func(code: string) -> js-abi-result
is-js: func(value: js-abi-value) -> bool
instance-of: func(value: js-abi-value, klass: js-abi-value) -> bool
global-this: func() -> js-abi-value
Expand All @@ -27,15 +32,15 @@ js-value-typeof: func(value: js-abi-value) -> string
js-value-equal: func(lhs: js-abi-value, rhs: js-abi-value) -> bool
js-value-strictly-equal: func(lhs: js-abi-value, rhs: js-abi-value) -> bool

reflect-apply: func(target: js-abi-value, this-argument: js-abi-value, arguments: list<js-abi-value>) -> js-abi-value
reflect-apply: func(target: js-abi-value, this-argument: js-abi-value, arguments: list<js-abi-value>) -> js-abi-result
reflect-construct: func(target: js-abi-value, arguments: list<js-abi-value>) -> js-abi-value
reflect-delete-property: func(target: js-abi-value, property-key: string) -> bool
reflect-get: func(target: js-abi-value, property-key: string) -> js-abi-value
reflect-get: func(target: js-abi-value, property-key: string) -> js-abi-result
reflect-get-own-property-descriptor: func(target: js-abi-value, property-key: string) -> js-abi-value
reflect-get-prototype-of: func(target: js-abi-value) -> js-abi-value
reflect-has: func(target: js-abi-value, property-key: string) -> bool
reflect-is-extensible: func(target: js-abi-value) -> bool
reflect-own-keys: func(target: js-abi-value) -> list<js-abi-value>
reflect-prevent-extensions: func(target: js-abi-value) -> bool
reflect-set: func(target: js-abi-value, property-key: string, value: js-abi-value) -> bool
reflect-set: func(target: js-abi-value, property-key: string, value: js-abi-value) -> js-abi-result
reflect-set-prototype-of: func(target: js-abi-value, prototype: js-abi-value) -> bool
33 changes: 28 additions & 5 deletions ext/js/js-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void rb_abi_lend_object(VALUE obj);

static VALUE rb_mJS;
static VALUE rb_cJS_Object;
static VALUE rb_cJS_Error;

static ID i_to_js;

Expand Down Expand Up @@ -76,6 +77,15 @@ static inline void rstring_to_abi_string(VALUE rstr,
memcpy(abi_str->ptr, RSTRING_PTR(rstr), abi_str->len);
}

static inline void
raise_js_error_if_failure(const rb_js_abi_host_js_abi_result_t *result) {
if (result->tag == RB_JS_ABI_HOST_JS_ABI_RESULT_FAILURE) {
VALUE js_err = jsvalue_s_new(result->val.failure);
VALUE rb_err = rb_class_new_instance(1, &js_err, rb_cJS_Error);
rb_exc_raise(rb_err);
}
}

/*
* call-seq:
* JS.eval(code) -> JS::Object
Expand All @@ -88,7 +98,10 @@ static inline void rstring_to_abi_string(VALUE rstr,
static VALUE _rb_js_eval_js(VALUE _, VALUE code_str) {
rb_js_abi_host_string_t abi_str;
rstring_to_abi_string(code_str, &abi_str);
return jsvalue_s_new(rb_js_abi_host_eval_js(&abi_str));
rb_js_abi_host_js_abi_result_t ret;
rb_js_abi_host_eval_js(&abi_str, &ret);
raise_js_error_if_failure(&ret);
return jsvalue_s_new(ret.val.success);
}

static VALUE _rb_js_is_js(VALUE _, VALUE obj) {
Expand Down Expand Up @@ -168,7 +181,10 @@ static VALUE _rb_js_obj_aref(VALUE obj, VALUE key) {
rb_js_abi_host_string_t key_abi_str;
key = rb_obj_as_string(key);
rstring_to_abi_string(key, &key_abi_str);
return jsvalue_s_new(rb_js_abi_host_reflect_get(p->abi, &key_abi_str));
rb_js_abi_host_js_abi_result_t ret;
rb_js_abi_host_reflect_get(p->abi, &key_abi_str, &ret);
raise_js_error_if_failure(&ret);
return jsvalue_s_new(ret.val.success);
}

/*
Expand All @@ -187,7 +203,10 @@ static VALUE _rb_js_obj_aset(VALUE obj, VALUE key, VALUE val) {
rb_js_abi_host_string_t key_abi_str;
key = rb_obj_as_string(key);
rstring_to_abi_string(key, &key_abi_str);
rb_js_abi_host_reflect_set(p->abi, &key_abi_str, v->abi);
rb_js_abi_host_js_abi_result_t ret;
rb_js_abi_host_reflect_set(p->abi, &key_abi_str, v->abi, &ret);
raise_js_error_if_failure(&ret);
rb_js_abi_host_js_abi_value_free(&ret.val.success);
RB_GC_GUARD(rv);
return val;
}
Expand Down Expand Up @@ -276,8 +295,10 @@ static VALUE _rb_js_obj_call(int argc, VALUE *argv, VALUE obj) {
rb_ary_push(rv_args, rb_proc);
}

VALUE result = jsvalue_s_new(
rb_js_abi_host_reflect_apply(abi_method->abi, p->abi, &abi_args));
rb_js_abi_host_js_abi_result_t ret;
rb_js_abi_host_reflect_apply(abi_method->abi, p->abi, &abi_args, &ret);
raise_js_error_if_failure(&ret);
VALUE result = jsvalue_s_new(ret.val.success);
RB_GC_GUARD(rv_args);
RB_GC_GUARD(method);
return result;
Expand Down Expand Up @@ -539,4 +560,6 @@ void Init_js() {
rb_define_method(rb_cTrueClass, "to_js", _rb_js_true_to_js, 0);
rb_define_method(rb_cFalseClass, "to_js", _rb_js_false_to_js, 0);
rb_define_method(rb_cProc, "to_js", _rb_js_proc_to_js, 0);

rb_cJS_Error = rb_define_class_under(rb_mJS, "Error", rb_eStandardError);
}
18 changes: 18 additions & 0 deletions ext/js/lib/js.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ def respond_to_missing?(sym, include_private)
self[sym].typeof == "function"
end
end

# A wrapper class for JavaScript Error to allow the Error to be thrown in Ruby.
class JS::Error
def initialize(exception)
@exception = exception
super
end

def message
stack = @exception[:stack]
if stack.typeof == "string"
# Error.stack contains the error message also
stack.to_s
else
@exception.to_s
end
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
export type JsAbiResult = JsAbiResultSuccess | JsAbiResultFailure;
export interface JsAbiResultSuccess {
tag: "success",
val: JsAbiValue,
}
export interface JsAbiResultFailure {
tag: "failure",
val: JsAbiValue,
}
export type RawInteger = RawIntegerF64 | RawIntegerBignum;
export interface RawIntegerF64 {
tag: "f64",
Expand All @@ -9,7 +18,7 @@ export interface RawIntegerBignum {
}
export function addRbJsAbiHostToImports(imports: any, obj: RbJsAbiHost, get_export: (name: string) => WebAssembly.ExportValue): void;
export interface RbJsAbiHost {
evalJs(code: string): JsAbiValue;
evalJs(code: string): JsAbiResult;
isJs(value: JsAbiValue): boolean;
instanceOf(value: JsAbiValue, klass: JsAbiValue): boolean;
globalThis(): JsAbiValue;
Expand All @@ -25,17 +34,17 @@ export interface RbJsAbiHost {
jsValueTypeof(value: JsAbiValue): string;
jsValueEqual(lhs: JsAbiValue, rhs: JsAbiValue): boolean;
jsValueStrictlyEqual(lhs: JsAbiValue, rhs: JsAbiValue): boolean;
reflectApply(target: JsAbiValue, thisArgument: JsAbiValue, arguments: JsAbiValue[]): JsAbiValue;
reflectApply(target: JsAbiValue, thisArgument: JsAbiValue, arguments: JsAbiValue[]): JsAbiResult;
reflectConstruct(target: JsAbiValue, arguments: JsAbiValue[]): JsAbiValue;
reflectDeleteProperty(target: JsAbiValue, propertyKey: string): boolean;
reflectGet(target: JsAbiValue, propertyKey: string): JsAbiValue;
reflectGet(target: JsAbiValue, propertyKey: string): JsAbiResult;
reflectGetOwnPropertyDescriptor(target: JsAbiValue, propertyKey: string): JsAbiValue;
reflectGetPrototypeOf(target: JsAbiValue): JsAbiValue;
reflectHas(target: JsAbiValue, propertyKey: string): boolean;
reflectIsExtensible(target: JsAbiValue): boolean;
reflectOwnKeys(target: JsAbiValue): JsAbiValue[];
reflectPreventExtensions(target: JsAbiValue): boolean;
reflectSet(target: JsAbiValue, propertyKey: string, value: JsAbiValue): boolean;
reflectSet(target: JsAbiValue, propertyKey: string, value: JsAbiValue): JsAbiResult;
reflectSetPrototypeOf(target: JsAbiValue, prototype: JsAbiValue): boolean;
dropJsAbiValue?: (val: JsAbiValue) => void;
}
Expand Down
Loading