From 1d8d9ac983fa9c7b6dfc3df736cfd3eae6908a60 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 24 Oct 2017 11:23:25 -0400 Subject: Remove CJS_Value constructors This CL removes most of the CJS_Value constructors and leaves the v8::Local constructor as the only non-default construtor. Change-Id: Ie98260d10eff645d0ca688b353e7d40ba1aac157 Reviewed-on: https://pdfium-review.googlesource.com/16611 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/javascript/util.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/javascript/util.cpp') diff --git a/fpdfsdk/javascript/util.cpp b/fpdfsdk/javascript/util.cpp index 3d669b30ca..63179c84a8 100644 --- a/fpdfsdk/javascript/util.cpp +++ b/fpdfsdk/javascript/util.cpp @@ -132,7 +132,7 @@ bool util::printf(CJS_Runtime* pRuntime, } c_strResult.erase(c_strResult.begin()); - vRet = CJS_Value(pRuntime, c_strResult.c_str()); + vRet = CJS_Value(pRuntime->NewString(c_strResult.c_str())); return true; } @@ -185,7 +185,7 @@ bool util::printd(CJS_Runtime* pRuntime, return false; } - vRet = CJS_Value(pRuntime, swResult.c_str()); + vRet = CJS_Value(pRuntime->NewString(swResult.c_str())); return true; } @@ -259,7 +259,7 @@ bool util::printd(CJS_Runtime* pRuntime, wchar_t buf[64] = {}; FXSYS_wcsftime(buf, 64, cFormat.c_str(), &time); cFormat = buf; - vRet = CJS_Value(pRuntime, cFormat.c_str()); + vRet = CJS_Value(pRuntime->NewString(cFormat.c_str())); return true; } @@ -276,9 +276,9 @@ bool util::printx(CJS_Runtime* pRuntime, return false; } - vRet = CJS_Value(pRuntime, printx(params[0].ToWideString(pRuntime), - params[1].ToWideString(pRuntime)) - .c_str()); + vRet = CJS_Value(pRuntime->NewString( + printx(params[0].ToWideString(pRuntime), params[1].ToWideString(pRuntime)) + .c_str())); return true; } @@ -396,7 +396,7 @@ bool util::scand(CJS_Runtime* pRuntime, } if (!std::isnan(dDate)) { - vRet = CJS_Value(CJS_Date(pRuntime, dDate)); + vRet = CJS_Value(CJS_Date(pRuntime, dDate).ToV8Date()); } else { vRet.Set(pRuntime->NewNull()); } @@ -420,7 +420,7 @@ bool util::byteToChar(CJS_Runtime* pRuntime, } WideString wStr(static_cast(arg)); - vRet = CJS_Value(pRuntime, wStr.c_str()); + vRet = CJS_Value(pRuntime->NewString(wStr.c_str())); return true; } -- cgit v1.2.3