MCPcopy Create free account
hub / github.com/Snapchat/Valdi / valueToInt

Method valueToInt

valdi/src/valdi/v8/V8JavaScriptContext.cpp:857–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

855 } else {
856 val = val_;
857 }
858
859 if (!val->IsNumber()) {
860 exceptionTracker.onError("Value is not a number type and cannot be converted");
861 return 0;
862 }
863
864 double retval;
865 if (!val->NumberValue(context).To(&retval)) {
866 exceptionTracker.onError("Value could not be converted");
867 return 0;
868 }
869 return retval;
870}
871
872int32_t V8JavaScriptContext::valueToInt(const JSValue& value, JSExceptionTracker& exceptionTracker) {
873 v8::HandleScope handleScope(_isolate);
874

Callers 1

marshallMethod · 0.45

Calls 4

fromValdiJSValueFunction · 0.70
onErrorMethod · 0.65
CastFunction · 0.50
ValueMethod · 0.45

Tested by

no test coverage detected