Checks if the condition is true, schedules JS exception otherwise. Returns false if check failed.
| 16 | // Checks if the condition is true, schedules JS exception otherwise. |
| 17 | // Returns false if check failed. |
| 18 | inline bool Check(Napi::Env env, bool condition, const std::string& message) { |
| 19 | if (!condition) { |
| 20 | Napi::TypeError::New(env, message).ThrowAsJavaScriptException(); |
| 21 | } |
| 22 | |
| 23 | return condition; |
| 24 | } |
| 25 | |
| 26 | // Checks if the pointer is not null, throws JS exception otherwise. |
| 27 | template <typename T> |
no test coverage detected