From b2f6f9158f54cee1825830c7ed57fe9d89cff26e Mon Sep 17 00:00:00 2001 From: etienneb Date: Wed, 27 Apr 2016 09:10:09 -0700 Subject: 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 --- fpdfsdk/javascript/JS_Value.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 maybeNum = m_pValue->ToNumber(m_pJSRuntime->GetIsolate()->GetCurrentContext()); if (maybeNum.IsEmpty()) -- cgit v1.2.3