#include "fxjs/cjs_global.h"
#include <memory>
#include <utility>
#include <vector>
#include "core/fxcrt/check.h"
#include "core/fxcrt/containers/contains.h"
#include "core/fxcrt/fx_extension.h"
#include "core/fxcrt/span.h"
#include "fxjs/cfx_globaldata.h"
#include "fxjs/cfx_keyvalue.h"
#include "fxjs/cjs_event_context.h"
#include "fxjs/cjs_object.h"
#include "fxjs/fxv8.h"
#include "fxjs/js_define.h"
#include "fxjs/js_resources.h"
#include "v8/include/v8-isolate.h"
namespace {
ByteString ByteStringFromV8Name(v8::Isolate* pIsolate,
v8::Local<v8::Name> name) { … }
}
CJS_Global::JSGlobalData::JSGlobalData() = default;
CJS_Global::JSGlobalData::~JSGlobalData() = default;
const JSMethodSpec CJS_Global::MethodSpecs[] = …;
uint32_t CJS_Global::ObjDefnID = …;
void CJS_Global::setPersistent_static(
const v8::FunctionCallbackInfo<v8::Value>& info) { … }
v8::Intercepted CJS_Global::queryprop_static(
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Integer>& info) { … }
v8::Intercepted CJS_Global::getprop_static(
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Value>& info) { … }
v8::Intercepted CJS_Global::putprop_static(
v8::Local<v8::Name> property,
v8::Local<v8::Value> value,
const v8::PropertyCallbackInfo<void>& info) { … }
v8::Intercepted CJS_Global::delprop_static(
v8::Local<v8::Name> property,
const v8::PropertyCallbackInfo<v8::Boolean>& info) { … }
void CJS_Global::enumprop_static(
const v8::PropertyCallbackInfo<v8::Array>& info) { … }
void CJS_Global::DefineAllProperties(CFXJS_Engine* pEngine) { … }
uint32_t CJS_Global::GetObjDefnID() { … }
void CJS_Global::DefineJSObjects(CFXJS_Engine* pEngine) { … }
CJS_Global::CJS_Global(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
: … { … }
CJS_Global::~CJS_Global() { … }
bool CJS_Global::HasProperty(const ByteString& propname) { … }
bool CJS_Global::DelProperty(const ByteString& propname) { … }
CJS_Result CJS_Global::GetProperty(CJS_Runtime* pRuntime,
const ByteString& propname) { … }
CJS_Result CJS_Global::SetProperty(CJS_Runtime* pRuntime,
const ByteString& propname,
v8::Local<v8::Value> vp) { … }
void CJS_Global::EnumProperties(
CJS_Runtime* pRuntime,
const v8::PropertyCallbackInfo<v8::Array>& info) { … }
CJS_Result CJS_Global::setPersistent(
CJS_Runtime* pRuntime,
pdfium::span<v8::Local<v8::Value>> params) { … }
void CJS_Global::UpdateGlobalPersistentVariables() { … }
void CJS_Global::CommitGlobalPersisitentVariables() { … }
std::vector<std::unique_ptr<CFX_KeyValue>> CJS_Global::ObjectToArray(
CJS_Runtime* pRuntime,
v8::Local<v8::Object> pObj) { … }
void CJS_Global::PutObjectProperty(v8::Local<v8::Object> pObj,
CFX_KeyValue* pData) { … }
void CJS_Global::DestroyGlobalPersisitentVariables() { … }
CJS_Result CJS_Global::SetGlobalVariables(const ByteString& propname,
CFX_Value::DataType nType,
double dData,
bool bData,
const ByteString& sData,
v8::Local<v8::Object> pData,
bool bDefaultPersistent) { … }