| 9 | #include <nan.h> |
| 10 | |
| 11 | NAN_METHOD(Parse) { |
| 12 | Nan::JSON NanJSON; |
| 13 | |
| 14 | Nan::MaybeLocal<v8::String> inp = Nan::To<v8::String>(info[0]); |
| 15 | |
| 16 | if (!inp.IsEmpty()) { |
| 17 | Nan::MaybeLocal<v8::Value> result = NanJSON.Parse( |
| 18 | inp.ToLocalChecked() |
| 19 | ); |
| 20 | |
| 21 | if (!result.IsEmpty()) { |
| 22 | info.GetReturnValue().Set(result.ToLocalChecked()); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | NAN_MODULE_INIT(Init) { |
| 28 | Nan::Set(target |
nothing calls this directly
no test coverage detected