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
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index e2c990c..ab02f02 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -151,7 +151,7 @@
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())