• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #include "fxjs/xfa/cjx_script.h"
8 
9 #include "fxjs/xfa/cfxjse_value.h"
10 #include "xfa/fxfa/parser/cxfa_script.h"
11 
CJX_Script(CXFA_Script * node)12 CJX_Script::CJX_Script(CXFA_Script* node) : CJX_Node(node) {}
13 
14 CJX_Script::~CJX_Script() = default;
15 
DynamicTypeIs(TypeTag eType) const16 bool CJX_Script::DynamicTypeIs(TypeTag eType) const {
17   return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
18 }
19 
stateless(CFXJSE_Value * pValue,bool bSetting,XFA_Attribute eAttribute)20 void CJX_Script::stateless(CFXJSE_Value* pValue,
21                            bool bSetting,
22                            XFA_Attribute eAttribute) {
23   if (bSetting) {
24     ThrowInvalidPropertyException();
25     return;
26   }
27   pValue->SetString(FX_UTF8Encode(WideStringView(L"0", 1)).AsStringView());
28 }
29