Remove arg from CFXJSE_Value's constructor.
It is no longer used as of the previous change[1], but do this
in a separate step to keep the diff smaller.
-- Also remove some NDEBUG sections with ASSERTS() that are
easily hit based on document contents (avoids unused
variable warnings).
1. https://pdfium-review.googlesource.com/c/pdfium/+/75870
Bug: pdfium:1610
Change-Id: Ie41aa0707db391496ae64090d474dfb19dffb56e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/75890
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/xfa/cfxjse_class.cpp b/fxjs/xfa/cfxjse_class.cpp
index 21c4258..3a85760 100644
--- a/fxjs/xfa/cfxjse_class.cpp
+++ b/fxjs/xfa/cfxjse_class.cpp
@@ -189,7 +189,7 @@
v8::HandleScope scope(info.GetIsolate());
v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
- auto lpThisValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto lpThisValue = std::make_unique<CFXJSE_Value>();
lpThisValue->ForceSetValue(info.GetIsolate(), thisObject);
if (DynPropQueryAdapter(info.GetIsolate(), lpClass, lpThisValue.get(),
szFxPropName)) {
@@ -211,9 +211,9 @@
v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
- auto lpThisValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto lpThisValue = std::make_unique<CFXJSE_Value>();
lpThisValue->ForceSetValue(info.GetIsolate(), thisObject);
- auto lpNewValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto lpNewValue = std::make_unique<CFXJSE_Value>();
DynPropGetterAdapter(info.GetIsolate(), lpClass, lpThisValue.get(),
szFxPropName, lpNewValue.get());
info.GetReturnValue().Set(lpNewValue->DirectGetValue());
@@ -231,9 +231,9 @@
v8::String::Utf8Value szPropName(info.GetIsolate(), property);
ByteStringView szFxPropName(*szPropName, szPropName.length());
- auto lpThisValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto lpThisValue = std::make_unique<CFXJSE_Value>();
lpThisValue->ForceSetValue(info.GetIsolate(), thisObject);
- auto lpNewValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto lpNewValue = std::make_unique<CFXJSE_Value>();
lpNewValue->ForceSetValue(info.GetIsolate(), value);
DynPropSetterAdapter(info.GetIsolate(), lpClass, lpThisValue.get(),
szFxPropName, lpNewValue.get());
diff --git a/fxjs/xfa/cfxjse_context.cpp b/fxjs/xfa/cfxjse_context.cpp
index 54fd290..0515934 100644
--- a/fxjs/xfa/cfxjse_context.cpp
+++ b/fxjs/xfa/cfxjse_context.cpp
@@ -218,7 +218,7 @@
CFXJSE_Context::~CFXJSE_Context() = default;
std::unique_ptr<CFXJSE_Value> CFXJSE_Context::GetGlobalObject() {
- auto pValue = std::make_unique<CFXJSE_Value>(GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>();
CFXJSE_ScopeUtil_IsolateHandleContext scope(this);
v8::Local<v8::Context> hContext =
v8::Local<v8::Context>::New(GetIsolate(), m_hContext);
diff --git a/fxjs/xfa/cfxjse_engine.cpp b/fxjs/xfa/cfxjse_engine.cpp
index 7764232..bef3342 100644
--- a/fxjs/xfa/cfxjse_engine.cpp
+++ b/fxjs/xfa/cfxjse_engine.cpp
@@ -554,7 +554,7 @@
return false;
ByteString btScript = wsScript->ToUTF8();
- auto hRetValue = std::make_unique<CFXJSE_Value>(GetIsolate());
+ auto hRetValue = std::make_unique<CFXJSE_Value>();
CXFA_Node* pThisObject = pParent->GetParent();
CFXJSE_Context* pVariablesContext =
CreateVariablesContext(pScriptNode, pThisObject);
@@ -582,7 +582,7 @@
CFXJSE_Context* pVariableContext = it->second.get();
std::unique_ptr<CFXJSE_Value> pObject = pVariableContext->GetGlobalObject();
- auto hVariableValue = std::make_unique<CFXJSE_Value>(GetIsolate());
+ auto hVariableValue = std::make_unique<CFXJSE_Value>();
if (!bGetter) {
pObject->SetObjectOwnProperty(GetIsolate(), szPropName, pValue);
return true;
@@ -604,7 +604,7 @@
void CFXJSE_Engine::RemoveBuiltInObjs(CFXJSE_Context* pContext) const {
const ByteStringView kObjNames[2] = {"Number", "Date"};
std::unique_ptr<CFXJSE_Value> pObject = pContext->GetGlobalObject();
- auto hProp = std::make_unique<CFXJSE_Value>(GetIsolate());
+ auto hProp = std::make_unique<CFXJSE_Value>();
for (const auto& obj : kObjNames) {
if (pObject->GetObjectProperty(GetIsolate(), obj, hProp.get()))
pObject->DeleteObjectProperty(GetIsolate(), obj);
@@ -703,7 +703,7 @@
rndFind.m_ScriptAttribute.callback &&
nStart <
pdfium::base::checked_cast<int32_t>(wsExpression.GetLength())) {
- auto pValue = std::make_unique<CFXJSE_Value>(GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>();
CJX_Object* jsObject = rndFind.m_Objects.front()->JSObject();
(*rndFind.m_ScriptAttribute.callback)(
GetIsolate(), jsObject, pValue.get(), false,
@@ -788,7 +788,7 @@
if (iter != m_mapObjectToValue.end())
return iter->second.get();
- auto jsValue = std::make_unique<CFXJSE_Value>(GetIsolate());
+ auto jsValue = std::make_unique<CFXJSE_Value>();
jsValue->SetHostObject(GetIsolate(), pCJXObject, m_pJsClass.Get());
CFXJSE_Value* pValue = jsValue.get();
diff --git a/fxjs/xfa/cfxjse_formcalc_context.cpp b/fxjs/xfa/cfxjse_formcalc_context.cpp
index 0052af5..cde20cf 100644
--- a/fxjs/xfa/cfxjse_formcalc_context.cpp
+++ b/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -1401,19 +1401,19 @@
continue;
}
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectProperty(pIsolate, "length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger(pIsolate);
if (iLength > 2) {
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
if (propertyValue->IsNull(pIsolate)) {
for (int32_t j = 2; j < iLength; j++) {
argValue->GetObjectPropertyByIdx(pIsolate, j, jsObjectValue.get());
- auto defaultPropValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto defaultPropValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, jsObjectValue.get(),
defaultPropValue.get());
if (defaultPropValue->IsNull(pIsolate))
@@ -1425,7 +1425,7 @@
} else {
for (int32_t j = 2; j < iLength; j++) {
argValue->GetObjectPropertyByIdx(pIsolate, j, jsObjectValue.get());
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
jsObjectValue->GetObjectProperty(
pIsolate, propertyValue->ToString(pIsolate).AsStringView(),
newPropertyValue.get());
@@ -1477,7 +1477,7 @@
continue;
if (argValue->IsArray(pIsolate)) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectProperty(pIsolate, "length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger(pIsolate);
@@ -1486,9 +1486,9 @@
return;
}
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
argValue->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
@@ -1509,7 +1509,7 @@
}
}
} else if (argValue->IsObject(pIsolate)) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, argValue.get(), newPropertyValue.get());
if (!newPropertyValue->IsNull(pIsolate))
iCount++;
@@ -1552,7 +1552,7 @@
continue;
if (argValue->IsArray(info.GetIsolate())) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectProperty(info.GetIsolate(), "length",
lengthValue.get());
int32_t iLength = lengthValue->ToInteger(info.GetIsolate());
@@ -1561,9 +1561,9 @@
return;
}
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
argValue->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
@@ -1593,7 +1593,7 @@
}
}
} else if (argValue->IsObject(pIsolate)) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, argValue.get(), newPropertyValue.get());
if (newPropertyValue->IsNull(pIsolate))
continue;
@@ -1628,7 +1628,7 @@
continue;
if (argValue->IsArray(pIsolate)) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectProperty(pIsolate, "length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger(pIsolate);
if (iLength <= 2) {
@@ -1636,9 +1636,9 @@
return;
}
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
argValue->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
@@ -1668,7 +1668,7 @@
}
}
} else if (argValue->IsObject(pIsolate)) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, argValue.get(), newPropertyValue.get());
if (newPropertyValue->IsNull(pIsolate))
continue;
@@ -1790,7 +1790,7 @@
continue;
if (argValue->IsArray(info.GetIsolate())) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectProperty(info.GetIsolate(), "length",
lengthValue.get());
int32_t iLength = lengthValue->ToInteger(info.GetIsolate());
@@ -1799,11 +1799,11 @@
return;
}
- auto propertyValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectPropertyByIdx(info.GetIsolate(), 1,
propertyValue.get());
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
if (propertyValue->IsNull(info.GetIsolate())) {
for (int32_t j = 2; j < iLength; j++) {
argValue->GetObjectPropertyByIdx(info.GetIsolate(), j,
@@ -1832,7 +1832,7 @@
}
}
} else if (argValue->IsObject(info.GetIsolate())) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(info.GetIsolate(), argValue.get(),
newPropertyValue.get());
if (newPropertyValue->IsNull(info.GetIsolate()))
@@ -3067,12 +3067,11 @@
bool bStopCounterFlags = false;
int32_t iArgIndex = 1;
int32_t iValueIndex = 0;
- v8::Isolate* pIsolate = pContext->GetIsolate();
while (!bFound && !bStopCounterFlags && (iArgIndex < argc)) {
auto argIndexValue =
std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[iArgIndex]);
if (argIndexValue->IsArray(info.GetIsolate())) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argIndexValue->GetObjectProperty(info.GetIsolate(), "length",
lengthValue.get());
int32_t iLength = lengthValue->ToInteger(info.GetIsolate());
@@ -3081,9 +3080,9 @@
iValueIndex += (iLength - 2);
if (iValueIndex >= iIndex) {
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
argIndexValue->GetObjectPropertyByIdx(info.GetIsolate(), 1,
propertyValue.get());
argIndexValue->GetObjectPropertyByIdx(
@@ -3252,7 +3251,7 @@
std::unique_ptr<CFXJSE_Context> pNewContext(
CFXJSE_Context::Create(pIsolate, nullptr, nullptr, nullptr));
- auto returnValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto returnValue = std::make_unique<CFXJSE_Value>();
pNewContext->ExecuteScript(
FX_UTF8Encode(wsJavaScriptBuf.value().AsStringView()).c_str(),
returnValue.get(), nullptr);
@@ -3265,7 +3264,6 @@
CFXJSE_HostObject* pThis,
const v8::FunctionCallbackInfo<v8::Value>& info) {
CFXJSE_FormCalcContext* pContext = ToFormCalcContext(pThis);
- v8::Isolate* pIsolate = pContext->GetIsolate();
if (info.Length() != 1) {
pContext->ThrowParamCountMismatchException(L"Ref");
return;
@@ -3291,7 +3289,7 @@
std::vector<std::unique_ptr<CFXJSE_Value>> values;
for (int32_t i = 0; i < 3; i++)
- values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>());
int intVal = 3;
if (argOne->IsNull(info.GetIsolate())) {
@@ -3299,14 +3297,8 @@
intVal = 4;
values[2]->SetNull(info.GetIsolate());
} else if (argOne->IsArray(info.GetIsolate())) {
-#ifndef NDEBUG
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
- argOne->GetObjectProperty(info.GetIsolate(), "length", lengthValue.get());
- ASSERT(lengthValue->ToInteger(info.GetIsolate()) >= 3);
-#endif
-
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 1, propertyValue.get());
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 2, jsObjectValue.get());
if (!propertyValue->IsNull(info.GetIsolate()) ||
@@ -3323,7 +3315,7 @@
values[0]->SetInteger(info.GetIsolate(), intVal);
values[1]->SetNull(info.GetIsolate());
- auto temp = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto temp = std::make_unique<CFXJSE_Value>();
temp->SetArray(info.GetIsolate(), values);
info.GetReturnValue().Set(temp->DirectGetValue());
}
@@ -4609,12 +4601,12 @@
std::unique_ptr<CFXJSE_Value> rValue = GetSimpleValue(pThis, info, 1);
if (lValue->IsArray(info.GetIsolate())) {
v8::Isolate* pIsolate = pContext->GetIsolate();
- auto leftLengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto leftLengthValue = std::make_unique<CFXJSE_Value>();
lValue->GetObjectProperty(info.GetIsolate(), "length",
leftLengthValue.get());
int32_t iLeftLength = leftLengthValue->ToInteger(info.GetIsolate());
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
lValue->GetObjectPropertyByIdx(info.GetIsolate(), 1, propertyValue.get());
if (propertyValue->IsNull(info.GetIsolate())) {
for (int32_t i = 2; i < iLeftLength; i++) {
@@ -4771,8 +4763,8 @@
!argSecond->IsArray(info.GetIsolate()))
return false;
- auto firstFlagValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
- auto secondFlagValue = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto firstFlagValue = std::make_unique<CFXJSE_Value>();
+ auto secondFlagValue = std::make_unique<CFXJSE_Value>();
argFirst->GetObjectPropertyByIdx(info.GetIsolate(), 0, firstFlagValue.get());
argSecond->GetObjectPropertyByIdx(info.GetIsolate(), 0,
secondFlagValue.get());
@@ -4780,8 +4772,8 @@
secondFlagValue->ToInteger(info.GetIsolate()) != 3)
return false;
- auto firstJSObject = std::make_unique<CFXJSE_Value>(info.GetIsolate());
- auto secondJSObject = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto firstJSObject = std::make_unique<CFXJSE_Value>();
+ auto secondJSObject = std::make_unique<CFXJSE_Value>();
argFirst->GetObjectPropertyByIdx(info.GetIsolate(), 2, firstJSObject.get());
argSecond->GetObjectPropertyByIdx(info.GetIsolate(), 2, secondJSObject.get());
if (firstJSObject->IsNull(info.GetIsolate()) ||
@@ -5150,20 +5142,19 @@
auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (argOne->IsArray(info.GetIsolate())) {
- v8::Isolate* pIsolate = pContext->GetIsolate();
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 1, propertyValue.get());
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 2, jsObjectValue.get());
if (propertyValue->IsNull(info.GetIsolate())) {
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(info.GetIsolate(), jsObjectValue.get(),
pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
return;
}
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
jsObjectValue->GetObjectProperty(
info.GetIsolate(),
propertyValue->ToString(info.GetIsolate()).AsStringView(),
@@ -5173,7 +5164,7 @@
}
if (argOne->IsObject(info.GetIsolate())) {
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(info.GetIsolate(), argOne.get(), pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
return;
@@ -5197,15 +5188,7 @@
return;
}
-#ifndef NDEBUG
- CFXJSE_FormCalcContext* pContext = ToFormCalcContext(pThis);
- v8::Isolate* pIsolate = pContext->GetIsolate();
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
- argOne->GetObjectProperty(info.GetIsolate(), "length", lengthValue.get());
- ASSERT(lengthValue->ToInteger(info.GetIsolate()) >= 3);
-#endif
-
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 2, pReturn.get());
info.GetReturnValue().Set(pReturn->DirectGetValue());
}
@@ -5220,7 +5203,6 @@
return;
}
- v8::Isolate* pIsolate = pContext->GetIsolate();
auto argOne = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (!argOne->IsArray(info.GetIsolate())) {
std::unique_ptr<CFXJSE_Value> simpleValue = GetSimpleValue(pThis, info, 0);
@@ -5228,13 +5210,7 @@
return;
}
-#ifndef NDEBUG
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
- argOne->GetObjectProperty(info.GetIsolate(), "length", lengthValue.get());
- ASSERT(lengthValue->ToInteger(info.GetIsolate()) >= 3);
-#endif
-
- auto flagsValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto flagsValue = std::make_unique<CFXJSE_Value>();
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 0, flagsValue.get());
int32_t iFlags = flagsValue->ToInteger(info.GetIsolate());
if (iFlags != 3 && iFlags != 4) {
@@ -5246,18 +5222,18 @@
if (iFlags == 4) {
std::vector<std::unique_ptr<CFXJSE_Value>> values;
for (int32_t i = 0; i < 3; i++)
- values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>());
values[0]->SetInteger(info.GetIsolate(), 3);
values[1]->SetNull(info.GetIsolate());
values[2]->SetNull(info.GetIsolate());
- auto pResult = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pResult = std::make_unique<CFXJSE_Value>();
pResult->SetArray(info.GetIsolate(), values);
info.GetReturnValue().Set(pResult->DirectGetValue());
return;
}
- auto objectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto objectValue = std::make_unique<CFXJSE_Value>();
argOne->GetObjectPropertyByIdx(info.GetIsolate(), 2, objectValue.get());
if (objectValue->IsNull(info.GetIsolate())) {
pContext->ThrowCompilerErrorException();
@@ -5275,20 +5251,20 @@
for (int32_t i = 0; i < info.Length(); ++i) {
auto argValue = std::make_unique<CFXJSE_Value>(pIsolate, info[i]);
if (argValue->IsArray(info.GetIsolate())) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argValue->GetObjectProperty(info.GetIsolate(), "length",
lengthValue.get());
int32_t length = lengthValue->ToInteger(info.GetIsolate());
for (int32_t j = 2; j < length; j++) {
- returnValues.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ returnValues.push_back(std::make_unique<CFXJSE_Value>());
argValue->GetObjectPropertyByIdx(info.GetIsolate(), j,
returnValues.back().get());
}
}
- returnValues.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ returnValues.push_back(std::make_unique<CFXJSE_Value>());
returnValues.back()->Assign(info.GetIsolate(), argValue.get());
}
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
pReturn->SetArray(info.GetIsolate(), returnValues);
info.GetReturnValue().Set(pReturn->DirectGetValue());
}
@@ -5298,7 +5274,6 @@
CFXJSE_HostObject* pThis,
const v8::FunctionCallbackInfo<v8::Value>& info,
uint32_t index) {
- v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetIsolate();
ASSERT(index < (uint32_t)info.Length());
auto argIndex =
@@ -5308,17 +5283,17 @@
return argIndex;
if (argIndex->IsArray(info.GetIsolate())) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
argIndex->GetObjectProperty(info.GetIsolate(), "length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger(info.GetIsolate());
- auto simpleValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto simpleValue = std::make_unique<CFXJSE_Value>();
if (iLength < 3) {
simpleValue.get()->SetUndefined(info.GetIsolate());
return simpleValue;
}
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
argIndex->GetObjectPropertyByIdx(info.GetIsolate(), 1, propertyValue.get());
argIndex->GetObjectPropertyByIdx(info.GetIsolate(), 2, jsObjectValue.get());
if (propertyValue->IsNull(info.GetIsolate())) {
@@ -5334,7 +5309,7 @@
return simpleValue;
}
- auto defaultValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto defaultValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(info.GetIsolate(), argIndex.get(), defaultValue.get());
return defaultValue;
}
@@ -5354,24 +5329,24 @@
if (iLength < 3)
return true;
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
arg->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
- auto defaultValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto defaultValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, jsObjectValue.get(), defaultValue.get());
return defaultValue->IsNull(pIsolate);
}
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
jsObjectValue->GetObjectProperty(
pIsolate, propertyValue->ToString(pIsolate).AsStringView(),
newPropertyValue.get());
return newPropertyValue->IsNull(pIsolate);
}
- auto defaultValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto defaultValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, arg, defaultValue.get());
return defaultValue->IsNull(pIsolate);
}
@@ -5384,7 +5359,7 @@
if (!arg || !arg->IsArray(pIsolate))
return 0;
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectProperty(pIsolate, "length", lengthValue.get());
return lengthValue->ToInteger(pIsolate);
}
@@ -5423,19 +5398,19 @@
for (int32_t i = 1; i < info.Length(); ++i) {
auto arg = std::make_unique<CFXJSE_Value>(pIsolate, info[i]);
if (arg->IsArray(pIsolate)) {
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectProperty(pIsolate, "length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger(pIsolate);
if (iLength < 3)
continue;
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
for (int32_t j = 2; j < iLength; j++) {
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectPropertyByIdx(pIsolate, j, jsObjectValue.get());
- results.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ results.push_back(std::make_unique<CFXJSE_Value>());
if (propertyValue->IsNull(pIsolate)) {
GetObjectDefaultValue(pIsolate, jsObjectValue.get(),
results.back().get());
@@ -5446,10 +5421,10 @@
}
}
} else if (arg->IsObject(pIsolate)) {
- results.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ results.push_back(std::make_unique<CFXJSE_Value>());
GetObjectDefaultValue(pIsolate, arg.get(), results.back().get());
} else {
- results.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ results.push_back(std::make_unique<CFXJSE_Value>());
results.back()->Assign(pIsolate, arg.get());
}
}
@@ -5582,7 +5557,7 @@
*bAttribute = false;
CFXJSE_Engine* pScriptContext = pContext->GetDocument()->GetScriptContext();
for (auto& pObject : resolveNodeRS.objects) {
- resultValues->push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ resultValues->push_back(std::make_unique<CFXJSE_Value>());
resultValues->back()->Assign(
pIsolate, pScriptContext->GetOrCreateJSBindingFromMap(pObject.Get()));
}
@@ -5593,7 +5568,7 @@
if (resolveNodeRS.script_attribute.callback &&
resolveNodeRS.script_attribute.eValueType == XFA_ScriptType::Object) {
for (auto& pObject : resolveNodeRS.objects) {
- auto pValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto pValue = std::make_unique<CFXJSE_Value>();
CJX_Object* jsObject = pObject->JSObject();
(*resolveNodeRS.script_attribute.callback)(
pIsolate, jsObject, pValue.get(), false,
@@ -5607,7 +5582,7 @@
if (!pParentValue || !pParentValue->IsObject(pIsolate))
return;
- resultValues->push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ resultValues->push_back(std::make_unique<CFXJSE_Value>());
resultValues->back()->Assign(pIsolate, pParentValue);
}
@@ -5619,9 +5594,9 @@
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetIsolate();
if (pValue->IsArray(pIsolate)) {
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
pValue->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
pValue->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
@@ -5636,7 +5611,7 @@
return ValueToInteger(pThis, newPropertyValue.get());
}
if (pValue->IsObject(pIsolate)) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, pValue, newPropertyValue.get());
return ValueToInteger(pThis, newPropertyValue.get());
}
@@ -5653,9 +5628,9 @@
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetIsolate();
if (arg->IsArray(pIsolate)) {
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
arg->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
@@ -5669,7 +5644,7 @@
return ValueToFloat(pThis, newPropertyValue.get());
}
if (arg->IsObject(pIsolate)) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, arg, newPropertyValue.get());
return ValueToFloat(pThis, newPropertyValue.get());
}
@@ -5688,9 +5663,9 @@
v8::Isolate* pIsolate = ToFormCalcContext(pThis)->GetIsolate();
if (arg->IsArray(pIsolate)) {
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
arg->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
arg->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate)) {
@@ -5704,7 +5679,7 @@
return ValueToDouble(pThis, newPropertyValue.get());
}
if (arg->IsObject(pIsolate)) {
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
GetObjectDefaultValue(pIsolate, arg, newPropertyValue.get());
return ValueToDouble(pThis, newPropertyValue.get());
}
@@ -5729,7 +5704,7 @@
if (!src->IsArray(pIsolate))
return ValueToDouble(pThis, src);
- auto lengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto lengthValue = std::make_unique<CFXJSE_Value>();
src->GetObjectProperty(pIsolate, "length", lengthValue.get());
int32_t iLength = lengthValue->ToInteger(pIsolate);
if (iLength <= 2) {
@@ -5737,14 +5712,14 @@
return 0.0;
}
- auto propertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
- auto jsObjectValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto propertyValue = std::make_unique<CFXJSE_Value>();
+ auto jsObjectValue = std::make_unique<CFXJSE_Value>();
src->GetObjectPropertyByIdx(pIsolate, 1, propertyValue.get());
src->GetObjectPropertyByIdx(pIsolate, 2, jsObjectValue.get());
if (propertyValue->IsNull(pIsolate))
return ValueToDouble(pThis, jsObjectValue.get());
- auto newPropertyValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto newPropertyValue = std::make_unique<CFXJSE_Value>();
jsObjectValue->GetObjectProperty(
pIsolate, propertyValue->ToString(pIsolate).AsStringView(),
newPropertyValue.get());
@@ -5790,7 +5765,7 @@
CFXJSE_Context* pScriptContext,
CXFA_Document* pDoc)
: m_pIsolate(pIsolate),
- m_pValue(std::make_unique<CFXJSE_Value>(pIsolate)),
+ m_pValue(std::make_unique<CFXJSE_Value>()),
m_pDocument(pDoc) {
m_pValue->SetHostObject(
pIsolate, this,
@@ -5838,7 +5813,7 @@
auto argAccessor = std::make_unique<CFXJSE_Value>(info.GetIsolate(), info[0]);
if (argAccessor->IsArray(info.GetIsolate())) {
- auto pLengthValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto pLengthValue = std::make_unique<CFXJSE_Value>();
argAccessor->GetObjectProperty(info.GetIsolate(), "length",
pLengthValue.get());
int32_t iLength = pLengthValue->ToInteger(info.GetIsolate());
@@ -5847,7 +5822,7 @@
return;
}
- auto hJSObjValue = std::make_unique<CFXJSE_Value>(pIsolate);
+ auto hJSObjValue = std::make_unique<CFXJSE_Value>();
std::vector<std::vector<std::unique_ptr<CFXJSE_Value>>> resolveValues(
iLength - 2);
bool bAttribute = false;
@@ -5871,9 +5846,9 @@
}
std::vector<std::unique_ptr<CFXJSE_Value>> values;
- values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>());
values.back()->SetInteger(pIsolate, 1);
- values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>());
if (bAttribute)
values.back()->SetString(pIsolate, bsName.AsStringView());
else
@@ -5881,11 +5856,11 @@
for (int32_t i = 0; i < iLength - 2; i++) {
for (size_t j = 0; j < resolveValues[i].size(); j++) {
- values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>());
values.back()->Assign(pIsolate, resolveValues[i][j].get());
}
}
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
pReturn->SetArray(pIsolate, values);
info.GetReturnValue().Set(pReturn->DirectGetValue());
return;
@@ -5919,7 +5894,7 @@
std::vector<std::unique_ptr<CFXJSE_Value>> values;
for (size_t i = 0; i < resolveValues.size() + 2; i++)
- values.push_back(std::make_unique<CFXJSE_Value>(pIsolate));
+ values.push_back(std::make_unique<CFXJSE_Value>());
values[0]->SetInteger(pIsolate, 1);
if (bAttribute)
@@ -5930,7 +5905,7 @@
for (size_t i = 0; i < resolveValues.size(); i++)
values[i + 2]->Assign(pIsolate, resolveValues[i].get());
- auto pReturn = std::make_unique<CFXJSE_Value>(info.GetIsolate());
+ auto pReturn = std::make_unique<CFXJSE_Value>();
pReturn->SetArray(pIsolate, values);
info.GetReturnValue().Set(pReturn->DirectGetValue());
}
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.cpp b/fxjs/xfa/cfxjse_resolveprocessor.cpp
index 968bca4..a187f1d 100644
--- a/fxjs/xfa/cfxjse_resolveprocessor.cpp
+++ b/fxjs/xfa/cfxjse_resolveprocessor.cpp
@@ -42,7 +42,7 @@
wsExpression = wsCondition.Substr(2, wsCondition.GetLength() - 3);
for (size_t i = iFoundCount; i > 0; --i) {
- auto pRetValue = std::make_unique<CFXJSE_Value>(pRnd->m_pSC->GetIsolate());
+ auto pRetValue = std::make_unique<CFXJSE_Value>();
bool bRet =
pRnd->m_pSC->RunScript(eLangType, wsExpression.AsStringView(),
pRetValue.get(), pRnd->m_Objects[i - 1].Get());
diff --git a/fxjs/xfa/cfxjse_value.cpp b/fxjs/xfa/cfxjse_value.cpp
index 993f964..c3e05da 100644
--- a/fxjs/xfa/cfxjse_value.cpp
+++ b/fxjs/xfa/cfxjse_value.cpp
@@ -65,7 +65,7 @@
pIsolate->ThrowException(hError);
}
-CFXJSE_Value::CFXJSE_Value(v8::Isolate* pIsolate) {}
+CFXJSE_Value::CFXJSE_Value() = default;
CFXJSE_Value::CFXJSE_Value(v8::Isolate* pIsolate, v8::Local<v8::Value> value) {
ForceSetValue(pIsolate, value);
diff --git a/fxjs/xfa/cfxjse_value.h b/fxjs/xfa/cfxjse_value.h
index 9d07ad0..909145f 100644
--- a/fxjs/xfa/cfxjse_value.h
+++ b/fxjs/xfa/cfxjse_value.h
@@ -20,7 +20,7 @@
class CFXJSE_Value {
public:
- explicit CFXJSE_Value(v8::Isolate* pIsolate);
+ CFXJSE_Value();
CFXJSE_Value(v8::Isolate* pIsolate, v8::Local<v8::Value> value);
~CFXJSE_Value();
@@ -95,7 +95,6 @@
}
private:
- CFXJSE_Value() = delete;
CFXJSE_Value(const CFXJSE_Value&) = delete;
CFXJSE_Value& operator=(const CFXJSE_Value&) = delete;
diff --git a/fxjs/xfa/cfxjse_value_embeddertest.cpp b/fxjs/xfa/cfxjse_value_embeddertest.cpp
index 42617d5..b0e41e0 100644
--- a/fxjs/xfa/cfxjse_value_embeddertest.cpp
+++ b/fxjs/xfa/cfxjse_value_embeddertest.cpp
@@ -17,7 +17,7 @@
TEST_F(CFXJSE_ValueEmbedderTest, Empty) {
ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
- auto pValue = std::make_unique<CFXJSE_Value>(isolate());
+ auto pValue = std::make_unique<CFXJSE_Value>();
EXPECT_TRUE(pValue->IsEmpty());
EXPECT_FALSE(pValue->IsUndefined(isolate()));
EXPECT_FALSE(pValue->IsNull(isolate()));
@@ -33,11 +33,11 @@
ASSERT_TRUE(OpenDocument("simple_xfa.pdf"));
// Test inserting empty values into arrays.
- auto pValue = std::make_unique<CFXJSE_Value>(isolate());
+ auto pValue = std::make_unique<CFXJSE_Value>();
std::vector<std::unique_ptr<CFXJSE_Value>> vec;
vec.push_back(std::move(pValue));
- CFXJSE_Value array(isolate());
+ CFXJSE_Value array;
array.SetArray(isolate(), vec);
EXPECT_TRUE(array.IsArray(isolate()));
}
diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp
index 3e7c556..d32c100 100644
--- a/fxjs/xfa/cjx_tree.cpp
+++ b/fxjs/xfa/cjx_tree.cpp
@@ -71,7 +71,7 @@
return CJS_Result::Success(runtime->NewNull());
}
- auto pValue = std::make_unique<CFXJSE_Value>(pScriptContext->GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>();
CJX_Object* jsObject = resolveNodeRS.objects.front()->JSObject();
(*resolveNodeRS.script_attribute.callback)(
runtime->GetIsolate(), jsObject, pValue.get(), false,
@@ -91,7 +91,7 @@
refNode = GetDocument()->GetScriptContext()->GetThisObject();
CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
- auto pValue = std::make_unique<CFXJSE_Value>(pScriptContext->GetIsolate());
+ auto pValue = std::make_unique<CFXJSE_Value>();
ResolveNodeList(pScriptContext->GetIsolate(), pValue.get(),
runtime->ToWideString(params[0]),
XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes |
@@ -239,8 +239,7 @@
if (resolveNodeRS.script_attribute.callback &&
resolveNodeRS.script_attribute.eValueType == XFA_ScriptType::Object) {
for (auto& pObject : resolveNodeRS.objects) {
- auto innerValue =
- std::make_unique<CFXJSE_Value>(pScriptContext->GetIsolate());
+ auto innerValue = std::make_unique<CFXJSE_Value>();
CJX_Object* jsObject = pObject->JSObject();
(*resolveNodeRS.script_attribute.callback)(
pIsolate, jsObject, innerValue.get(), false,
diff --git a/testing/fuzzers/pdf_formcalc_context_fuzzer.cc b/testing/fuzzers/pdf_formcalc_context_fuzzer.cc
index eeff9cd..edcc75d 100644
--- a/testing/fuzzers/pdf_formcalc_context_fuzzer.cc
+++ b/testing/fuzzers/pdf_formcalc_context_fuzzer.cc
@@ -527,7 +527,7 @@
script_context->SetEventParam(¶ms);
ByteStringView data_view(data_, size_);
- auto value = std::make_unique<CFXJSE_Value>(script_context->GetIsolate());
+ auto value = std::make_unique<CFXJSE_Value>();
script_context->RunScript(CXFA_Script::Type::Formcalc,
WideString::FromUTF8(data_view).AsStringView(),
value.get(), xfa_document->GetRoot());
diff --git a/testing/xfa_js_embedder_test.cpp b/testing/xfa_js_embedder_test.cpp
index 4df2d05..c1a9b13 100644
--- a/testing/xfa_js_embedder_test.cpp
+++ b/testing/xfa_js_embedder_test.cpp
@@ -58,7 +58,7 @@
if (ExecuteHelper(input))
return true;
- CFXJSE_Value msg(isolate());
+ CFXJSE_Value msg;
value_->GetObjectPropertyByIdx(isolate(), 1, &msg);
fprintf(stderr, "FormCalc: %.*s\n", static_cast<int>(input.GetLength()),
input.unterminated_c_str());
@@ -74,7 +74,7 @@
}
bool XFAJSEmbedderTest::ExecuteHelper(ByteStringView input) {
- value_ = std::make_unique<CFXJSE_Value>(isolate());
+ value_ = std::make_unique<CFXJSE_Value>();
return script_context_->RunScript(CXFA_Script::Type::Formcalc,
WideString::FromUTF8(input).AsStringView(),
value_.get(), GetXFADocument()->GetRoot());
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 51a34d1..af3473c 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -2757,7 +2757,7 @@
pContext->SetNodesOfRunScript(&refNodes);
}
- auto pTmpRetValue = std::make_unique<CFXJSE_Value>(pContext->GetIsolate());
+ auto pTmpRetValue = std::make_unique<CFXJSE_Value>();
bool bRet = false;
{
AutoRestorer<uint8_t> restorer(&m_ExecuteRecursionDepth);