Remove GetType from CJS_Value
This CL removes the GetType method from CJS_Value and, instead,
retrieves the value from the v8 object directly.
Change-Id: Ia8390f3ead163c09a39cae493e75fccdd41a0961
Reviewed-on: https://pdfium-review.googlesource.com/16615
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 4623980..68fc305 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -1660,7 +1660,7 @@
ws.Replace(L",", L".");
vRet = CJS_Value(pRuntime->NewString(ws.c_str()));
vRet.MaybeCoerceToNumber(pRuntime);
- if (vRet.GetType() != CJS_Value::VT_number)
+ if (!vRet.ToV8Value()->IsNumber())
vRet = CJS_Value(pRuntime->NewNumber(0));
return true;
}
@@ -1675,7 +1675,7 @@
}
CJS_Value params1(params[1]);
- if (!params1.IsArrayObject() && params1.GetType() != CJS_Value::VT_string) {
+ if (!params1.IsArrayObject() && !params1.ToV8Value()->IsString()) {
sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return false;
}