| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fxfa/parser/cxfa_scriptcontext.h" | 7 #include "xfa/fxfa/parser/cxfa_scriptcontext.h" |
| 8 | 8 |
| 9 #include "core/fxcrt/fx_ext.h" | 9 #include "core/fxcrt/fx_ext.h" |
| 10 #include "fxjs/cfxjse_arguments.h" | 10 #include "fxjs/cfxjse_arguments.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 CFXJSE_Context* pVariableContext = nullptr; | 128 CFXJSE_Context* pVariableContext = nullptr; |
| 129 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); | 129 m_mapVariableToContext.GetNextAssoc(ps, pScriptNode, pVariableContext); |
| 130 | 130 |
| 131 delete ToThisProxy(pVariableContext->GetGlobalObject().get(), nullptr); | 131 delete ToThisProxy(pVariableContext->GetGlobalObject().get(), nullptr); |
| 132 delete pVariableContext; | 132 delete pVariableContext; |
| 133 } | 133 } |
| 134 m_mapVariableToContext.RemoveAll(); | 134 m_mapVariableToContext.RemoveAll(); |
| 135 | 135 |
| 136 m_upObjectArray.RemoveAll(); | 136 m_upObjectArray.RemoveAll(); |
| 137 } | 137 } |
| 138 |
| 138 void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) { | 139 void CXFA_ScriptContext::Initialize(v8::Isolate* pIsolate) { |
| 139 m_pIsolate = pIsolate; | 140 m_pIsolate = pIsolate; |
| 140 DefineJsContext(); | 141 DefineJsContext(); |
| 141 DefineJsClass(); | 142 DefineJsClass(); |
| 142 m_ResolveProcessor.reset(new CXFA_ResolveProcessor); | 143 m_ResolveProcessor.reset(new CXFA_ResolveProcessor); |
| 143 } | 144 } |
| 144 FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, | 145 FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType, |
| 145 const CFX_WideStringC& wsScript, | 146 const CFX_WideStringC& wsScript, |
| 146 CFXJSE_Value* hRetValue, | 147 CFXJSE_Value* hRetValue, |
| 147 CXFA_Object* pThisObject) { | 148 CXFA_Object* pThisObject) { |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 return; | 763 return; |
| 763 if (nodes.GetSize() > 0) | 764 if (nodes.GetSize() > 0) |
| 764 m_pScriptNodeArray->Copy(nodes); | 765 m_pScriptNodeArray->Copy(nodes); |
| 765 } | 766 } |
| 766 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { | 767 void CXFA_ScriptContext::AddNodesOfRunScript(CXFA_Node* pNode) { |
| 767 if (!m_pScriptNodeArray) | 768 if (!m_pScriptNodeArray) |
| 768 return; | 769 return; |
| 769 if (m_pScriptNodeArray->Find(pNode) == -1) | 770 if (m_pScriptNodeArray->Find(pNode) == -1) |
| 770 m_pScriptNodeArray->Add(pNode); | 771 m_pScriptNodeArray->Add(pNode); |
| 771 } | 772 } |
| OLD | NEW |