| 19 | namespace ValdiJSCore { |
| 20 | |
| 21 | JSObjectRef JSCoreRef::asObjectRefOrThrow(Valdi::IJavaScriptContext& jsContext, |
| 22 | Valdi::JSExceptionTracker& exceptionTracker) const { |
| 23 | auto objectRef = asObjectRef(); |
| 24 | if (objectRef == nullptr) { |
| 25 | exceptionTracker.onError(Valdi::Error("Value is not an object")); |
| 26 | } |
| 27 | |
| 28 | return objectRef; |
| 29 | } |
| 30 | |
| 31 | std::pair<const char*, size_t> jsStringToUTF8(JSStringRef stringRef) { |
| 32 | if (stringRef == nullptr) { |
no test coverage detected