| 64 | } |
| 65 | |
| 66 | static Napi::Object Init(Napi::Env env, Napi::Value jshint) { |
| 67 | if (!jshint.IsNumber()) { |
| 68 | NAPI_THROW(Napi::Error::New(env, "Expected number"), Napi::Object()); |
| 69 | } |
| 70 | uint32_t hint = jshint.As<Napi::Number>(); |
| 71 | if (hint == 0) |
| 72 | env.SetInstanceData(new Addon(env)); |
| 73 | else |
| 74 | env.SetInstanceData<Addon, uint32_t, DeleteAddon>(new Addon(env), |
| 75 | new uint32_t(hint)); |
| 76 | Napi::Object result = Napi::Object::New(env); |
| 77 | result.DefineProperties({ |
| 78 | Napi::PropertyDescriptor::Accessor<Getter, Setter>("verbose"), |
| 79 | }); |
| 80 | |
| 81 | return result; |
| 82 | } |
| 83 | |
| 84 | private: |
| 85 | bool verbose = false; |
nothing calls this directly
no test coverage detected