xref: /aosp_15_r20/external/pdfium/fxjs/xfa/cjx_script.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 The PDFium Authors
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/fxv8.h"
10 #include "v8/include/v8-primitive.h"
11 #include "xfa/fxfa/parser/cxfa_script.h"
12 
CJX_Script(CXFA_Script * node)13 CJX_Script::CJX_Script(CXFA_Script* node) : CJX_Node(node) {}
14 
15 CJX_Script::~CJX_Script() = default;
16 
DynamicTypeIs(TypeTag eType) const17 bool CJX_Script::DynamicTypeIs(TypeTag eType) const {
18   return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
19 }
20 
stateless(v8::Isolate * pIsolate,v8::Local<v8::Value> * pValue,bool bSetting,XFA_Attribute eAttribute)21 void CJX_Script::stateless(v8::Isolate* pIsolate,
22                            v8::Local<v8::Value>* pValue,
23                            bool bSetting,
24                            XFA_Attribute eAttribute) {
25   if (bSetting) {
26     ThrowInvalidPropertyException(pIsolate);
27     return;
28   }
29   *pValue = fxv8::NewStringHelper(pIsolate, "0");
30 }
31