summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjse_arguments.cpp2
-rw-r--r--fxjs/cfxjse_class.cpp8
-rw-r--r--fxjs/cfxjse_value.cpp2
-rw-r--r--fxjs/cjs_global.cpp20
-rw-r--r--fxjs/cjs_v8.cpp4
-rw-r--r--fxjs/fxjs_v8.cpp4
6 files changed, 21 insertions, 19 deletions
diff --git a/fxjs/cfxjse_arguments.cpp b/fxjs/cfxjse_arguments.cpp
index f390cefdf8..663996ce88 100644
--- a/fxjs/cfxjse_arguments.cpp
+++ b/fxjs/cfxjse_arguments.cpp
@@ -41,7 +41,7 @@ float CFXJSE_Arguments::GetFloat(int32_t index) const {
ByteString CFXJSE_Arguments::GetUTF8String(int32_t index) const {
v8::Local<v8::String> hString = (*m_pInfo)[index]->ToString();
- v8::String::Utf8Value szStringVal(hString);
+ v8::String::Utf8Value szStringVal(m_pInfo->GetIsolate(), hString);
return ByteString(*szStringVal);
}
diff --git a/fxjs/cfxjse_class.cpp b/fxjs/cfxjse_class.cpp
index 9515ef4b74..dd2181b853 100644
--- a/fxjs/cfxjse_class.cpp
+++ b/fxjs/cfxjse_class.cpp
@@ -81,7 +81,7 @@ void DynPropGetterAdapter_MethodCallback(
hCallBackInfo->GetInternalField(1).As<v8::String>();
ASSERT(lpClass && !hPropName.IsEmpty());
- v8::String::Utf8Value szPropName(hPropName);
+ v8::String::Utf8Value szPropName(info.GetIsolate(), hPropName);
WideString szFxPropName = WideString::FromUTF8(*szPropName);
CJS_Return result = lpClass->dynMethodCall(info, szFxPropName);
@@ -168,7 +168,7 @@ void NamedPropertyQueryCallback(
info.Data().As<v8::External>()->Value());
v8::Isolate* pIsolate = info.GetIsolate();
v8::HandleScope scope(pIsolate);
- v8::String::Utf8Value szPropName(property);
+ v8::String::Utf8Value szPropName(pIsolate, property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
auto lpThisValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
@@ -186,7 +186,7 @@ void NamedPropertyGetterCallback(
v8::Local<v8::Object> thisObject = info.Holder();
const FXJSE_CLASS_DESCRIPTOR* lpClass = static_cast<FXJSE_CLASS_DESCRIPTOR*>(
info.Data().As<v8::External>()->Value());
- v8::String::Utf8Value szPropName(property);
+ v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
auto lpThisValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
@@ -203,7 +203,7 @@ void NamedPropertySetterCallback(
v8::Local<v8::Object> thisObject = info.Holder();
const FXJSE_CLASS_DESCRIPTOR* lpClass = static_cast<FXJSE_CLASS_DESCRIPTOR*>(
info.Data().As<v8::External>()->Value());
- v8::String::Utf8Value szPropName(property);
+ v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
auto lpThisValue = pdfium::MakeUnique<CFXJSE_Value>(info.GetIsolate());
lpThisValue->ForceSetValue(thisObject);
diff --git a/fxjs/cfxjse_value.cpp b/fxjs/cfxjse_value.cpp
index f5bdd54653..d07b3565d3 100644
--- a/fxjs/cfxjse_value.cpp
+++ b/fxjs/cfxjse_value.cpp
@@ -384,7 +384,7 @@ ByteString CFXJSE_Value::ToString() const {
CFXJSE_ScopeUtil_IsolateHandleRootContext scope(m_pIsolate);
v8::Local<v8::Value> hValue = v8::Local<v8::Value>::New(m_pIsolate, m_hValue);
v8::Local<v8::String> hString = hValue->ToString();
- v8::String::Utf8Value hStringVal(hString);
+ v8::String::Utf8Value hStringVal(m_pIsolate, hString);
return ByteString(*hStringVal);
}
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index 23763544f5..eb66488d8e 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -22,8 +22,9 @@
namespace {
-WideString PropFromV8Prop(v8::Local<v8::String> property) {
- v8::String::Utf8Value utf8_value(property);
+WideString PropFromV8Prop(v8::Isolate* pIsolate,
+ v8::Local<v8::String> property) {
+ v8::String::Utf8Value utf8_value(pIsolate, property);
return WideString::FromUTF8(ByteStringView(*utf8_value, utf8_value.length()));
}
@@ -42,7 +43,8 @@ void JSSpecialPropQuery(const char*,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result = pObj->QueryProperty(PropFromV8Prop(property).c_str());
+ CJS_Return result =
+ pObj->QueryProperty(PropFromV8Prop(info.GetIsolate(), property).c_str());
info.GetReturnValue().Set(!result.HasError() ? 4 : 0);
}
@@ -61,8 +63,8 @@ void JSSpecialPropGet(const char* class_name,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result =
- pObj->GetProperty(pRuntime, PropFromV8Prop(property).c_str());
+ CJS_Return result = pObj->GetProperty(
+ pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
if (result.HasError()) {
pRuntime->Error(
JSFormatErrorString(class_name, "GetProperty", result.Error()));
@@ -89,8 +91,8 @@ void JSSpecialPropPut(const char* class_name,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result =
- pObj->SetProperty(pRuntime, PropFromV8Prop(property).c_str(), value);
+ CJS_Return result = pObj->SetProperty(
+ pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str(), value);
if (result.HasError()) {
pRuntime->Error(
JSFormatErrorString(class_name, "PutProperty", result.Error()));
@@ -112,8 +114,8 @@ void JSSpecialPropDel(const char* class_name,
return;
Alt* pObj = reinterpret_cast<Alt*>(pJSObj->GetEmbedObject());
- CJS_Return result =
- pObj->DelProperty(pRuntime, PropFromV8Prop(property).c_str());
+ CJS_Return result = pObj->DelProperty(
+ pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
if (result.HasError()) {
// TODO(dsinclair): Should this set the pRuntime->Error result?
// ByteString cbName =
diff --git a/fxjs/cjs_v8.cpp b/fxjs/cjs_v8.cpp
index 18bbed606c..8f77ec6a88 100644
--- a/fxjs/cjs_v8.cpp
+++ b/fxjs/cjs_v8.cpp
@@ -177,7 +177,7 @@ WideString CJS_V8::ToWideString(v8::Local<v8::Value> pValue) {
v8::MaybeLocal<v8::String> maybe_string = pValue->ToString(context);
if (maybe_string.IsEmpty())
return WideString();
- v8::String::Utf8Value s(maybe_string.ToLocalChecked());
+ v8::String::Utf8Value s(m_isolate, maybe_string.ToLocalChecked());
return WideString::FromUTF8(ByteStringView(*s, s.length()));
}
@@ -188,7 +188,7 @@ ByteString CJS_V8::ToByteString(v8::Local<v8::Value> pValue) {
v8::MaybeLocal<v8::String> maybe_string = pValue->ToString(context);
if (maybe_string.IsEmpty())
return ByteString();
- v8::String::Utf8Value s(maybe_string.ToLocalChecked());
+ v8::String::Utf8Value s(m_isolate, maybe_string.ToLocalChecked());
return ByteString(*s);
}
diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp
index 98f5ff720a..50345cfcd1 100644
--- a/fxjs/fxjs_v8.cpp
+++ b/fxjs/fxjs_v8.cpp
@@ -465,14 +465,14 @@ int CFXJS_Engine::Execute(const WideString& script, FXJSErr* pError) {
v8::Local<v8::Script> compiled_script;
if (!v8::Script::Compile(context, NewString(script.AsStringView()))
.ToLocal(&compiled_script)) {
- v8::String::Utf8Value error(try_catch.Exception());
+ v8::String::Utf8Value error(GetIsolate(), try_catch.Exception());
// TODO(tsepez): return error via pError->message.
return -1;
}
v8::Local<v8::Value> result;
if (!compiled_script->Run(context).ToLocal(&result)) {
- v8::String::Utf8Value error(try_catch.Exception());
+ v8::String::Utf8Value error(GetIsolate(), try_catch.Exception());
// TODO(tsepez): return error via pError->message.
return -1;
}