7#include "fxjs/cfx_v8.h"
10#include "v8/include/v8-isolate.h"
16v8::Local<v8::Value>
CFX_V8::GetObjectProperty(
17 v8::Local<v8::Object> pObj,
18 ByteStringView bsUTF8PropertyName) {
19 return fxv8::ReentrantGetObjectPropertyHelper(GetIsolate(), pObj,
23std::vector<WideString>
CFX_V8::GetObjectPropertyNames(
24 v8::Local<v8::Object> pObj) {
25 return fxv8::ReentrantGetObjectPropertyNamesHelper(GetIsolate(), pObj);
28void CFX_V8::PutObjectProperty(v8::Local<v8::Object> pObj,
29 ByteStringView bsUTF8PropertyName,
30 v8::Local<v8::Value> pPut) {
31 fxv8::ReentrantPutObjectPropertyHelper(GetIsolate(), pObj, bsUTF8PropertyName,
37 m_pIsolate.ExtractAsDangling()->Dispose();
41 return fxv8::NewArrayHelper(GetIsolate());
45 return fxv8::NewObjectHelper(GetIsolate());
48void CFX_V8::PutArrayElement(v8::Local<v8::Array> pArray,
50 v8::Local<v8::Value> pValue) {
51 fxv8::ReentrantPutArrayElementHelper(GetIsolate(), pArray, index, pValue);
54v8::Local<v8::Value>
CFX_V8::GetArrayElement(v8::Local<v8::Array> pArray,
56 return fxv8::ReentrantGetArrayElementHelper(GetIsolate(), pArray, index);
59size_t
CFX_V8::GetArrayLength(v8::Local<v8::Array> pArray) {
60 return fxv8::GetArrayLengthHelper(pArray);
64 return fxv8::NewNumberHelper(GetIsolate(), number);
68 return fxv8::NewNumberHelper(GetIsolate(), number);
72 return fxv8::NewNumberHelper(GetIsolate(), number);
76 return fxv8::NewBooleanHelper(GetIsolate(), b);
80 return fxv8::NewStringHelper(GetIsolate(), str);
87 return NewString(FX_UTF8Encode(str).AsStringView());
91 return fxv8::NewNullHelper(GetIsolate());
95 return fxv8::NewUndefinedHelper(GetIsolate());
99 return fxv8::NewDateHelper(GetIsolate(), d);
102int CFX_V8::ToInt32(v8::Local<v8::Value> pValue) {
103 return fxv8::ReentrantToInt32Helper(GetIsolate(), pValue);
106bool CFX_V8::ToBoolean(v8::Local<v8::Value> pValue) {
107 return fxv8::ReentrantToBooleanHelper(GetIsolate(), pValue);
110double CFX_V8::ToDouble(v8::Local<v8::Value> pValue) {
111 return fxv8::ReentrantToDoubleHelper(GetIsolate(), pValue);
114WideString
CFX_V8::ToWideString(v8::Local<v8::Value> pValue) {
115 return fxv8::ReentrantToWideStringHelper(GetIsolate(), pValue);
118ByteString
CFX_V8::ToByteString(v8::Local<v8::Value> pValue) {
119 return fxv8::ReentrantToByteStringHelper(GetIsolate(), pValue);
122v8::Local<v8::Object>
CFX_V8::ToObject(v8::Local<v8::Value> pValue) {
123 return fxv8::ReentrantToObjectHelper(GetIsolate(), pValue);
126v8::Local<v8::Array>
CFX_V8::ToArray(v8::Local<v8::Value> pValue) {
127 return fxv8::ReentrantToArrayHelper(GetIsolate(), pValue);
v8::Local< v8::Number > NewNumber(double number)
v8::Local< v8::Number > NewNumber(float number)
v8::Local< v8::Boolean > NewBoolean(bool b)
v8::Local< v8::String > NewString(WideStringView str)
v8::Local< v8::Array > NewArray()
CFX_V8(v8::Isolate *pIsolate)
v8::Local< v8::Date > NewDate(double d)
v8::Local< v8::Value > NewNull()
v8::Local< v8::Object > NewObject()
v8::Local< v8::Number > NewNumber(int number)
v8::Local< v8::String > NewString(ByteStringView str)
v8::Local< v8::Value > NewUndefined()
void operator()(v8::Isolate *ptr)