diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-24 11:23:25 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-24 17:17:44 +0000 |
commit | 1d8d9ac983fa9c7b6dfc3df736cfd3eae6908a60 (patch) | |
tree | 4508fee34d447c5753bdcc0568ad888873e838c2 /fpdfsdk/javascript/util.cpp | |
parent | e49749265c4e503c37a316e4ca6eeff430d13b87 (diff) | |
download | pdfium-1d8d9ac983fa9c7b6dfc3df736cfd3eae6908a60.tar.xz |
Remove CJS_Value constructors
This CL removes most of the CJS_Value constructors and leaves the
v8::Local<v8::Value> constructor as the only non-default construtor.
Change-Id: Ie98260d10eff645d0ca688b353e7d40ba1aac157
Reviewed-on: https://pdfium-review.googlesource.com/16611
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/util.cpp')
-rw-r--r-- | fpdfsdk/javascript/util.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<wchar_t>(arg)); - vRet = CJS_Value(pRuntime, wStr.c_str()); + vRet = CJS_Value(pRuntime->NewString(wStr.c_str())); return true; } |