summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-24 09:36:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-24 17:17:03 +0000
commite49749265c4e503c37a316e4ca6eeff430d13b87 (patch)
treed75c0b641618e66477b2e992ae146f30a3e2dd9f /fpdfsdk/javascript/PublicMethods.cpp
parent826480cf599f61fe0366ab2bd5803dd53c9d0562 (diff)
downloadpdfium-e49749265c4e503c37a316e4ca6eeff430d13b87.tar.xz
Remove most CJS_Value Set methods
This CL removes all of the Set(*) methods from CJS_Value except for Set(v8::Local<v8::Value>). All uses of Set are changed to convert to a v8::Value before setting. Change-Id: I6e4d2cebec42fce5c039dc0a3abe46086cfdd34f Reviewed-on: https://pdfium-review.googlesource.com/16610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 5e428007ad..ccd2cfc885 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -122,15 +122,15 @@ void JSGlobalFunc(const char* func_name_string,
return;
std::vector<CJS_Value> parameters;
for (unsigned int i = 0; i < (unsigned int)info.Length(); i++) {
- parameters.push_back(CJS_Value(pRuntime, info[i]));
+ parameters.push_back(CJS_Value(info[i]));
}
- CJS_Value valueRes(pRuntime);
+ CJS_Value valueRes;
WideString sError;
if (!(*F)(pRuntime, parameters, valueRes, sError)) {
pRuntime->Error(JSFormatErrorString(func_name_string, nullptr, sError));
return;
}
- info.GetReturnValue().Set(valueRes.ToV8Value(pRuntime));
+ info.GetReturnValue().Set(valueRes.ToV8Value());
}
} // namespace
@@ -896,7 +896,7 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime,
if (iNegStyle == 1 || iNegStyle == 3) {
if (Field* fTarget = pEvent->Target_Field()) {
CJS_Array arColor;
- CJS_Value vColElm(pRuntime);
+ CJS_Value vColElm;
vColElm = CJS_Value(pRuntime, L"RGB");
arColor.SetElement(pRuntime, 0, vColElm);
vColElm = CJS_Value(pRuntime, 1);
@@ -913,7 +913,7 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime,
if (iNegStyle == 1 || iNegStyle == 3) {
if (Field* fTarget = pEvent->Target_Field()) {
CJS_Array arColor;
- CJS_Value vColElm(pRuntime);
+ CJS_Value vColElm;
vColElm = CJS_Value(pRuntime, L"RGB");
arColor.SetElement(pRuntime, 0, vColElm);
vColElm = CJS_Value(pRuntime, 0);
@@ -921,7 +921,7 @@ bool CJS_PublicMethods::AFNumber_Format(CJS_Runtime* pRuntime,
arColor.SetElement(pRuntime, 2, vColElm);
arColor.SetElement(pRuntime, 3, vColElm);
- CJS_Value vProp(pRuntime);
+ CJS_Value vProp;
fTarget->get_text_color(pRuntime, &vProp, &sError);
CFX_Color crProp =
@@ -1661,7 +1661,7 @@ bool CJS_PublicMethods::AFSimple_Calculate(CJS_Runtime* pRuntime,
return false;
}
- CJS_Value params1 = params[1];
+ CJS_Value params1(params[1]);
if (!params1.IsArrayObject() && params1.GetType() != CJS_Value::VT_string) {
sError = JSGetStringFromID(IDS_STRING_JSPARAMERROR);
return false;
@@ -1826,7 +1826,7 @@ bool CJS_PublicMethods::AFExtractNums(CJS_Runtime* pRuntime,
if (nums.GetLength(pRuntime) > 0)
vRet = CJS_Value(pRuntime, nums);
else
- vRet.SetNull(pRuntime);
+ vRet.Set(pRuntime->NewNull());
return true;
}