-
Notifications
You must be signed in to change notification settings - Fork 12
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
Jshooks [DO NOT MERGE] #318
base: dev
Are you sure you want to change the base?
Conversation
…ger_last_time, ledger_nonce, ledger_keylet
…ubfield slot_type slot_float compiling not tested
… float_sum float_sto float_sto_set float_invert float_divide float_one float_mantissa float_sign float_int float_log float_root
Co-authored-by: Denis Angell <dangell@transia.co>
77b8c83
to
532a471
Compare
if (!sto.has_value()) | ||
returnJS(INVALID_ARGUMENT); | ||
|
||
returnJS(__float_sto_set(hookCtx, applyCtx, j, sto->data(), sto->size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float_sto_set
should return successful value as bigint(XFL)
returnJS(__float_sto_set(hookCtx, applyCtx, j, sto->data(), sto->size())); | |
int64_t const out = __float_sto_set(hookCtx, applyCtx, j, sto->data(), sto->size()); | |
if (out < 0) | |
returnJS(out); | |
returnJSXFL(out); |
if (rt) | ||
JS_FreeRuntime(rt); | ||
if (ctx) | ||
JS_FreeContext(ctx); | ||
rt = NULL; | ||
ctx = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my environment, Object Leaks error occurred when running a local build, but changing it as suggested resolved the error.
Also, in the quickjs sample code, JS_FreeRuntime is called after JS_FreeContext, as suggested.
if (rt) | |
JS_FreeRuntime(rt); | |
if (ctx) | |
JS_FreeContext(ctx); | |
rt = NULL; | |
ctx = NULL; | |
if (ctx) | |
JS_FreeContext(ctx); | |
if (rt) | |
JS_FreeRuntime(rt); | |
ctx = NULL; | |
rt = NULL; |
int expr_len = | ||
snprintf(expr, 256, "%s(%d)", | ||
callback ? "Callback" : "Hook", | ||
hookArgument); | ||
|
||
if (expr_len < 7 || expr_len == 256) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes it possible to do #332 Request 2.
int expr_len = | |
snprintf(expr, 256, "%s(%d)", | |
callback ? "Callback" : "Hook", | |
hookArgument); | |
if (expr_len < 7 || expr_len == 256) | |
int expr_len = | |
snprintf(expr, 256, "%s(%d, otxn_json())", | |
callback ? "Callback" : "Hook", | |
hookArgument); | |
if (expr_len < 20 || expr_len == 256) |
uint32_t write_len) | ||
DEFINE_JS_FUNCNARG( | ||
JSValue, | ||
hook_account); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon
hook_account); | |
hook_account) |
High Level Overview of Change
Context of Change
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)