Skip to content

Commit

Permalink
Use new upstream JS_JSONStringify
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Dec 21, 2019
1 parent 7bbcc7c commit f090255
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion quickjs-debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int js_transport_write_message_newline(JSDebuggerInfo *info, const char*
}

static int js_transport_write_value(JSDebuggerInfo *info, JSValue value) {
JSValue stringified = js_debugger_json_stringify(info->ctx, value);
JSValue stringified = JS_JSONStringify(info->ctx, value, JS_UNDEFINED, JS_UNDEFINED);
size_t len;
const char* str = JS_ToCStringLen(info->ctx, &len, stringified);
int ret = 0;
Expand Down
4 changes: 0 additions & 4 deletions quickjs-debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ JSDebuggerLocation js_debugger_current_location(JSContext *ctx, const uint8_t *c
// calls back into js_debugger_file_breakpoints.
int js_debugger_check_breakpoint(JSContext *ctx, uint32_t current_dirty, const uint8_t *cur_pc);

// could be moved out if js_json_stringify is made public.
// could also be implemented by constructing an eval call. clunky.
JSValue js_debugger_json_stringify(JSContext *ctx, JSValueConst value);

JSValue js_debugger_local_variables(JSContext *ctx, int stack_index);
JSValue js_debugger_closure_variables(JSContext *ctx, int stack_index);

Expand Down
9 changes: 0 additions & 9 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -50582,15 +50582,6 @@ JSDebuggerLocation js_debugger_current_location(JSContext *ctx, const uint8_t *c
return location;
}

JSValue js_debugger_json_stringify(JSContext *ctx, JSValueConst value) {
JSValueConst args[] = {
value,
JS_UNDEFINED,
JS_UNDEFINED,
};
return js_json_stringify(ctx, JS_UNDEFINED, 1, args);
}

JSDebuggerInfo *js_debugger_info(JSContext *ctx) {
return &ctx->debugger_info;
}
Expand Down

0 comments on commit f090255

Please sign in to comment.