summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-08-23 20:58:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-23 20:58:14 +0000
commit203339a2aa88bb31576233220d7ced73920a596f (patch)
tree895fc5fcc07107c8cc6f81b9c6e0f12faef9fc1e /fxjs
parent3b45012d57884b06915eb5a1f54fbba04a45e807 (diff)
downloadpdfium-203339a2aa88bb31576233220d7ced73920a596f.tar.xz
Fix shadowed variables
This CL fixes instances of variable shadowing that are discovered by turning on -Wshadow. BUG=pdfium:1137 Change-Id: I418d50de89ecbeb12e85b23a358bc61e8f16e888 Reviewed-on: https://pdfium-review.googlesource.com/41150 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjs_engine_embeddertest.cpp10
-rw-r--r--fxjs/cfxjse_engine.cpp1
-rw-r--r--fxjs/cfxjse_formcalc_context.cpp6
-rw-r--r--fxjs/xfa/cjx_tree.cpp6
4 files changed, 12 insertions, 11 deletions
diff --git a/fxjs/cfxjs_engine_embeddertest.cpp b/fxjs/cfxjs_engine_embeddertest.cpp
index ff866d3ee0..a9422ece98 100644
--- a/fxjs/cfxjs_engine_embeddertest.cpp
+++ b/fxjs/cfxjs_engine_embeddertest.cpp
@@ -51,10 +51,12 @@ TEST_F(CFXJSEngineEmbedderTest, MultipleEngines) {
engine2.InitializeEngine();
v8::Context::Scope context_scope(GetV8Context());
- Optional<IJS_Runtime::JS_Error> err = engine()->Execute(WideString(kScript0));
- EXPECT_FALSE(err);
- CheckAssignmentInEngineContext(engine(), kExpected0);
-
+ {
+ Optional<IJS_Runtime::JS_Error> err =
+ engine()->Execute(WideString(kScript0));
+ EXPECT_FALSE(err);
+ CheckAssignmentInEngineContext(engine(), kExpected0);
+ }
{
// engine1 executing in engine1's context doesn't affect main.
v8::Context::Scope context_scope1(engine1.GetV8Context());
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index 3b60989f32..c3b9dd3639 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -334,7 +334,6 @@ void CFXJSE_Engine::NormalPropertyGetter(CFXJSE_Value* pOriginalValue,
szPropName, pReturnValue, true);
if (!bRet) {
- WideString wsPropName = WideString::FromUTF8(szPropName);
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo =
XFA_GetScriptAttributeByName(pObject->GetElementType(),
wsPropName.AsStringView());
diff --git a/fxjs/cfxjse_formcalc_context.cpp b/fxjs/cfxjse_formcalc_context.cpp
index 34f5642844..41ec5783ff 100644
--- a/fxjs/cfxjse_formcalc_context.cpp
+++ b/fxjs/cfxjse_formcalc_context.cpp
@@ -780,11 +780,11 @@ bool IsIsoTimeFormat(const char* pData,
++iIndex;
char strSec[kSubSecondLength + 1];
- for (int i = 0; i < kSubSecondLength; ++i) {
- char c = pData[iIndex + i];
+ for (int j = 0; j < kSubSecondLength; ++j) {
+ char c = pData[iIndex + j];
if (!std::isdigit(c))
return false;
- strSec[i] = c;
+ strSec[j] = c;
}
strSec[kSubSecondLength] = '\0';
diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp
index 23f76583ed..5921f8bbe8 100644
--- a/fxjs/xfa/cjx_tree.cpp
+++ b/fxjs/xfa/cjx_tree.cpp
@@ -239,13 +239,13 @@ void CJX_Tree::ResolveNodeList(CFXJSE_Value* pValue,
if (resolveNodeRS.pScriptAttribute &&
resolveNodeRS.pScriptAttribute->eValueType == XFA_ScriptType::Object) {
for (auto& pObject : resolveNodeRS.objects) {
- auto pValue =
+ auto innerValue =
pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetIsolate());
CJX_Object* jsObject = pObject->JSObject();
(jsObject->*(resolveNodeRS.pScriptAttribute->callback))(
- pValue.get(), false, resolveNodeRS.pScriptAttribute->attribute);
+ innerValue.get(), false, resolveNodeRS.pScriptAttribute->attribute);
- CXFA_Object* obj = CFXJSE_Engine::ToObject(pValue.get());
+ CXFA_Object* obj = CFXJSE_Engine::ToObject(innerValue.get());
if (obj->IsNode())
pNodeList->Append(obj->AsNode());
}