9#include "third_party/base/numerics/safe_conversions.h"
10#include "v8/include/v8-container.h"
11#include "v8/include/v8-date.h"
12#include "v8/include/v8-exception.h"
13#include "v8/include/v8-isolate.h"
14#include "v8/include/v8-primitive.h"
15#include "v8/include/v8-value.h"
60 return v8::Null(pIsolate);
64 return v8::Undefined(pIsolate);
68 return v8::Int32::New(pIsolate, number);
72 return v8::Number::New(pIsolate, number);
76 return v8::Number::New(pIsolate, number);
80 return v8::Boolean::New(pIsolate, b);
85 return v8::String::NewFromUtf8(
86 pIsolate, str.unterminated_c_str(), v8::NewStringType::kNormal,
87 pdfium::base::checked_cast<
int>(str.GetLength()))
93 return NewStringHelper(pIsolate, FX_UTF8Encode(str).AsStringView());
97 return v8::Array::New(pIsolate);
102 v8::Local<v8::Array> result = NewArrayHelper(pIsolate);
103 for (size_t i = 0; i < values.size(); ++i) {
104 fxv8::ReentrantPutArrayElementHelper(
106 values[i].IsEmpty() ? fxv8::NewUndefinedHelper(pIsolate) : values[i]);
112 return v8::Object::New(pIsolate);
116 return v8::Date::New(pIsolate->GetCurrentContext(), d)
330 pIsolate->ThrowException(NewStringHelper(pIsolate, str));
334 pIsolate->ThrowException(NewStringHelper(pIsolate, str));
v8::Local< v8::Number > NewNumberHelper(v8::Isolate *pIsolate, int number)
v8::Local< v8::Value > ReentrantGetArrayElementHelper(v8::Isolate *pIsolate, v8::Local< v8::Array > pArray, size_t index)
v8::Local< v8::Date > NewDateHelper(v8::Isolate *pIsolate, double d)
bool IsBoolean(v8::Local< v8::Value > value)
v8::Local< v8::Object > ReentrantToObjectHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
void ThrowExceptionHelper(v8::Isolate *pIsolate, WideStringView str)
v8::Local< v8::Value > NewUndefinedHelper(v8::Isolate *pIsolate)
bool IsArray(v8::Local< v8::Value > value)
bool IsUndefined(v8::Local< v8::Value > value)
double ReentrantToDoubleHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
v8::Local< v8::String > NewStringHelper(v8::Isolate *pIsolate, WideStringView str)
bool ReentrantSetObjectOwnPropertyHelper(v8::Isolate *pIsolate, v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName, v8::Local< v8::Value > pValue)
bool ReentrantPutArrayElementHelper(v8::Isolate *pIsolate, v8::Local< v8::Array > pArray, size_t index, v8::Local< v8::Value > pValue)
v8::Local< v8::String > NewStringHelper(v8::Isolate *pIsolate, ByteStringView str)
bool IsInteger(v8::Local< v8::Value > value)
void ThrowExceptionHelper(v8::Isolate *pIsolate, ByteStringView str)
bool ReentrantHasObjectOwnPropertyHelper(v8::Isolate *pIsolate, v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName)
v8::Local< v8::Boolean > NewBooleanHelper(v8::Isolate *pIsolate, bool b)
v8::Local< v8::Array > NewArrayHelper(v8::Isolate *pIsolate, pdfium::span< v8::Local< v8::Value > > values)
v8::Local< v8::Value > ReentrantGetObjectPropertyHelper(v8::Isolate *pIsolate, v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName)
WideString ReentrantToWideStringHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
void ReentrantDeleteObjectPropertyHelper(v8::Isolate *pIsolate, v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName)
bool IsNumber(v8::Local< v8::Value > value)
bool ReentrantPutObjectPropertyHelper(v8::Isolate *pIsolate, v8::Local< v8::Object > pObj, ByteStringView bsUTF8PropertyName, v8::Local< v8::Value > pPut)
bool IsObject(v8::Local< v8::Value > value)
bool IsString(v8::Local< v8::Value > value)
ByteString ReentrantToByteStringHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
ByteString ToByteString(v8::Isolate *pIsolate, v8::Local< v8::String > pValue)
v8::Local< v8::Object > NewObjectHelper(v8::Isolate *pIsolate)
bool IsDate(v8::Local< v8::Value > value)
v8::Local< v8::Array > NewArrayHelper(v8::Isolate *pIsolate)
bool ReentrantToBooleanHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
size_t GetArrayLengthHelper(v8::Local< v8::Array > pArray)
v8::Local< v8::Number > NewNumberHelper(v8::Isolate *pIsolate, double number)
WideString ToWideString(v8::Isolate *pIsolate, v8::Local< v8::String > pValue)
v8::Local< v8::Value > NewNullHelper(v8::Isolate *pIsolate)
bool IsNull(v8::Local< v8::Value > value)
v8::Local< v8::Number > NewNumberHelper(v8::Isolate *pIsolate, float number)
float ReentrantToFloatHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
int32_t ReentrantToInt32Helper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
v8::Local< v8::Array > ReentrantToArrayHelper(v8::Isolate *pIsolate, v8::Local< v8::Value > pValue)
std::vector< WideString > ReentrantGetObjectPropertyNamesHelper(v8::Isolate *pIsolate, v8::Local< v8::Object > pObj)
bool IsFunction(v8::Local< v8::Value > value)