From 3cac3602f24f56413cc2ca312731675fc080b7ef Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 24 Oct 2017 15:15:27 -0400 Subject: 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 Commit-Queue: dsinclair --- fpdfsdk/javascript/PublicMethods.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/javascript/PublicMethods.cpp') diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp index 462398012d..68fc30572b 100644 --- a/fpdfsdk/javascript/PublicMethods.cpp +++ b/fpdfsdk/javascript/PublicMethods.cpp @@ -1660,7 +1660,7 @@ bool CJS_PublicMethods::AFMakeNumber(CJS_Runtime* pRuntime, 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 @@ bool CJS_PublicMethods::AFSimple_Calculate(CJS_Runtime* pRuntime, } 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; } -- cgit v1.2.3