7#ifndef FXJS_XFA_CFXJSE_CONTEXT_H_
8#define FXJS_XFA_CFXJSE_CONTEXT_H_
13#include "core/fxcrt/bytestring.h"
14#include "core/fxcrt/unowned_ptr.h"
15#include "v8/include/cppgc/persistent.h"
16#include "v8/include/v8-forward.h"
17#include "v8/include/v8-persistent-handle.h"
39 v8::Isolate* pIsolate,
42 CXFA_ThisProxy* pProxy);
50 void AddClass(std::unique_ptr<CFXJSE_Class> pClass);
56 v8::Local<v8::Object> pNewThisObject);
59 CFXJSE_Context(v8::Isolate* pIsolate, CXFA_ThisProxy* pProxy);
63 v8::Global<v8::Context> m_hContext;
64 UnownedPtr<v8::Isolate> m_pIsolate;
65 std::vector<std::unique_ptr<CFXJSE_Class>> m_rgClasses;
66 cppgc::Persistent<CXFA_ThisProxy> m_pProxy;
70 CFXJSE_HostObject* pNewBinding);
void FXJSE_ClearObjectBinding(v8::Local< v8::Object > hJSObject)
CFXJSE_HostObject * FXJSE_RetrieveObjectBinding(v8::Local< v8::Value > hValue)
void FXJSE_UpdateObjectBinding(v8::Local< v8::Object > hObject, CFXJSE_HostObject *pNewBinding)
const FXJSE_CLASS_DESCRIPTOR kNormalClassDescriptor
const FXJSE_CLASS_DESCRIPTOR kGlobalClassDescriptor
const FXJSE_CLASS_DESCRIPTOR kVariablesClassDescriptor
const FXJSE_CLASS_DESCRIPTOR kFormCalcDescriptor
bool IsName(ByteStringView name) const
const CFXJSE_Context * GetContext() const
static CFXJSE_Class * Create(CFXJSE_Context *pContext, const FXJSE_CLASS_DESCRIPTOR *pClassDescriptor, bool bIsJSGlobal)
UnownedPtr< const CFXJSE_Context > const m_pContext
v8::Global< v8::FunctionTemplate > m_hTemplate
CFXJSE_Class(const CFXJSE_Context *pContext)
v8::Local< v8::FunctionTemplate > GetTemplate(v8::Isolate *pIsolate)
UnownedPtr< const FXJSE_CLASS_DESCRIPTOR > m_pClassDescriptor
v8::Local< v8::Object > GetGlobalObject()
v8::Local< v8::Context > GetContext()
ExecutionResult ExecuteScript(ByteStringView bsScript, v8::Local< v8::Object > pNewThisObject)
void AddClass(std::unique_ptr< CFXJSE_Class > pClass)
static std::unique_ptr< CFXJSE_Context > Create(v8::Isolate *pIsolate, const FXJSE_CLASS_DESCRIPTOR *pGlobalClass, CFXJSE_HostObject *pGlobalObject, CXFA_ThisProxy *pProxy)
v8::Isolate * GetIsolate() const
void EnableCompatibleMode()
CFXJSE_Class * GetClassByName(ByteStringView szName) const
static ByteString Format(const char *pFormat,...)
void ThrowExceptionHelper(v8::Isolate *pIsolate, WideStringView str)
std::unique_ptr< CFXJSE_Value > value
ExecutionResult & operator=(ExecutionResult &&that) noexcept
ExecutionResult(ExecutionResult &&that) noexcept
ExecutionResult(bool sts, std::unique_ptr< CFXJSE_Value > val)
FXJSE_PropTypeGetter dynPropTypeGetter
FXJSE_PropSetter dynPropSetter
FXJSE_MethodCallback dynMethodCall
FXJSE_FuncCallback callbackProc