MCPcopy Create free account
hub / github.com/nodejs/nan / Stringify

Method Stringify

nan_json.h:98–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 inline
99 Nan::MaybeLocal<v8::String> Stringify(v8::Local<v8::Object> json_object) {
100 Nan::EscapableHandleScope scope;
101 Nan::MaybeLocal<v8::String> result =
102#if NAN_JSON_H_NEED_STRINGIFY
103 Nan::To<v8::String>(stringify(json_object));
104#else
105 v8::JSON::Stringify(Nan::GetCurrentContext(), json_object);
106#endif // NAN_JSON_H_NEED_STRINGIFY
107 if (result.IsEmpty()) return v8::Local<v8::String>();
108 return scope.Escape(result.ToLocalChecked());
109 }
110
111 inline
112 Nan::MaybeLocal<v8::String> Stringify(v8::Local<v8::Object> json_object,

Callers 1

NAN_METHODFunction · 0.80

Calls 4

GetCurrentContextFunction · 0.85
EscapeMethod · 0.80
ToLocalCheckedMethod · 0.80
IsEmptyMethod · 0.45

Tested by

no test coverage detected