summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-20 09:45:24 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-20 09:45:24 -0800
commitc7e4c4fe17f5c05671183a47541ea17f3dce75b5 (patch)
tree720c1c55e5125c6d5ebe85839137fc3a15496ca5 /fpdfsdk/src/javascript
parent7386e293a2b67794e6af02d0b71020a4bc987ce0 (diff)
downloadpdfium-c7e4c4fe17f5c05671183a47541ea17f3dce75b5.tar.xz
Update XFA fpdfsdk to match master
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1465663002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp4
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp7
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp16
3 files changed, 13 insertions, 14 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index a8da302700..003820aec1 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -779,8 +779,6 @@ FX_BOOL Document::mailDoc(IJS_Context* cc,
FX_BOOL Document::author(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
- ASSERT(m_pDocument != NULL);
-
CPDF_Dictionary* pDictionary =
m_pDocument->GetDocument()->GetPDFDoc()->GetInfo();
if (!pDictionary)
@@ -804,8 +802,6 @@ FX_BOOL Document::author(IJS_Context* cc,
FX_BOOL Document::info(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
- ASSERT(m_pDocument != NULL);
-
CPDF_Dictionary* pDictionary =
m_pDocument->GetDocument()->GetPDFDoc()->GetInfo();
if (!pDictionary)
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 8f705d51fa..ac6e99d1cd 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -29,9 +29,6 @@
#include "report.h"
#include "util.h"
-/* ------------------------------ CJS_Runtime ------------------------------ */
-v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(v8::Isolate* pIsolate);
-
// static
void IJS_Runtime::Initialize(unsigned int slot, void* isolate) {
FXJS_Initialize(slot, reinterpret_cast<v8::Isolate*>(isolate));
@@ -96,8 +93,7 @@ CJS_Runtime::~CJS_Runtime() {
for (auto* obs : m_observers)
obs->OnDestroyed();
- int size = m_ContextArray.GetSize();
- for (int i = 0; i < size; i++)
+ for (int i = 0; i < m_ContextArray.GetSize(); i++)
delete m_ContextArray.GetAt(i);
m_ContextArray.RemoveAll();
@@ -108,7 +104,6 @@ CJS_Runtime::~CJS_Runtime() {
if (m_isolateManaged)
m_isolate->Dispose();
- m_isolate = NULL;
}
void CJS_Runtime::DefineJSObjects() {
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 75327dd631..094f3e7dd7 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -62,10 +62,18 @@ static const FX_WCHAR* const months[] = {L"Jan",
L"Nov",
L"Dec"};
-static const FX_WCHAR* const fullmonths[] = {
- L"January", L"February", L"March", L"April",
- L"May", L"June", L"July", L"August",
- L"September", L"October", L"November", L"December"};
+static const FX_WCHAR* const fullmonths[] = {L"January",
+ L"February",
+ L"March",
+ L"April",
+ L"May",
+ L"June",
+ L"July",
+ L"August",
+ L"September",
+ L"October",
+ L"November",
+ L"December"};
FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string) {
CFX_WideString sTrim = StrTrim(string);