| 855 | } |
| 856 | |
| 857 | int32_t V8JavaScriptContext::valueToInt(const JSValue& value, JSExceptionTracker& exceptionTracker) { |
| 858 | v8::HandleScope handleScope(_isolate); |
| 859 | |
| 860 | auto val = v8::Local<v8::Int32>::Cast(fromValdiJSValue(_isolate, value, exceptionTracker)); |
| 861 | if (!exceptionTracker) { |
| 862 | return 0; |
| 863 | } |
| 864 | |
| 865 | if (!val->IsInt32()) { |
| 866 | exceptionTracker.onError("Value is not an int32 type and cannot be converted"); |
| 867 | return 0; |
| 868 | } |
| 869 | |
| 870 | return val->Value(); |
| 871 | } |
| 872 | |
| 873 | Ref<RefCountable> V8JavaScriptContext::valueToWrappedObject(const JSValue& value, |
| 874 | JSExceptionTracker& exceptionTracker) { |
no test coverage detected