summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript
diff options
context:
space:
mode:
authoretienneb <etienneb@chromium.org>2016-04-27 09:10:09 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-27 09:10:09 -0700
commitb2f6f9158f54cee1825830c7ed57fe9d89cff26e (patch)
tree53d60f3447be548e4b1e3b2268874ddfe5172feb /fpdfsdk/javascript
parentb95901091d63ce09accec3088945955f969d46e1 (diff)
downloadpdfium-b2f6f9158f54cee1825830c7ed57fe9d89cff26e.tar.xz
Fix incorrect v8 TryCatch.
The Try-Catch object must live the whole lexical scope. Without the giving a name to the object, this is equivalent to create a temporary that is destroy at the end of the statement. /src/pdfium/pdfium/out/Debug/../../fpdfsdk/javascript/JS_Value.cpp:154:3: warning: object destroyed immediately after creation; did you mean to name the object? [misc-unused-raii] This issue was found by clang-tidy R=dsinclair BUG=589955 Review-Url: https://codereview.chromium.org/1929513002
Diffstat (limited to 'fpdfsdk/javascript')
-rw-r--r--fpdfsdk/javascript/JS_Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index e2c990c51c..ab02f02cfb 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -151,7 +151,7 @@ void CJS_Value::MaybeCoerceToNumber() {
if (bstr == "NaN")
bAllowNaN = true;
}
- v8::TryCatch(m_pJSRuntime->GetIsolate());
+ v8::TryCatch try_catch(m_pJSRuntime->GetIsolate());
v8::MaybeLocal<v8::Number> maybeNum =
m_pValue->ToNumber(m_pJSRuntime->GetIsolate()->GetCurrentContext());
if (maybeNum.IsEmpty())