Index: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp |
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp |
index 23ce526dff2d0aea892276f6cad6710290be7f49..89c1ec779cea25a7c70a882b52a652be3d8dc9c7 100644 |
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp |
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp |
@@ -18,6 +18,7 @@ |
#include "xfa/fxfa/parser/xfa_parser_imp.h" |
#include "xfa/fxfa/parser/xfa_script_imp.h" |
#include "xfa/fxjse/cfxjse_arguments.h" |
+#include "xfa/fxjse/class.h" |
#include "xfa/fxjse/value.h" |
namespace { |
@@ -543,10 +544,10 @@ void CXFA_FM2JSContext::Avg(CFXJSE_Value* pThis, |
FX_DOUBLE dSum = 0.0; |
for (int32_t i = 0; i < argc; i++) { |
std::unique_ptr<CFXJSE_Value> argValue = args.GetValue(i); |
- if (FXJSE_Value_IsNull(argValue.get())) |
+ if (CFXJSE_Value::IsNull(argValue.get())) |
continue; |
- if (!FXJSE_Value_IsArray(argValue.get())) { |
+ if (!CFXJSE_Value::IsArray(argValue.get())) { |
dSum += ValueToDouble(pThis, argValue.get()); |
uCount++; |
continue; |
@@ -561,13 +562,13 @@ void CXFA_FM2JSContext::Avg(CFXJSE_Value* pThis, |
argValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t j = 2; j < iLength; j++) { |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
std::unique_ptr<CFXJSE_Value> defaultPropValue( |
new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(jsObjectValue.get(), defaultPropValue.get()); |
- if (FXJSE_Value_IsNull(defaultPropValue.get())) |
+ if (CFXJSE_Value::IsNull(defaultPropValue.get())) |
continue; |
dSum += ValueToDouble(pThis, defaultPropValue.get()); |
@@ -582,7 +583,7 @@ void CXFA_FM2JSContext::Avg(CFXJSE_Value* pThis, |
new CFXJSE_Value(pIsolate)); |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
dSum += ValueToDouble(pThis, newPropertyValue.get()); |
@@ -628,10 +629,10 @@ void CXFA_FM2JSContext::Count(CFXJSE_Value* pThis, |
int32_t iCount = 0; |
for (int32_t i = 0; i < args.GetLength(); i++) { |
std::unique_ptr<CFXJSE_Value> argValue = args.GetValue(i); |
- if (FXJSE_Value_IsNull(argValue.get())) |
+ if (CFXJSE_Value::IsNull(argValue.get())) |
continue; |
- if (FXJSE_Value_IsArray(argValue.get())) { |
+ if (CFXJSE_Value::IsArray(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argValue->GetObjectProperty("length", lengthValue.get()); |
@@ -647,11 +648,11 @@ void CXFA_FM2JSContext::Count(CFXJSE_Value* pThis, |
new CFXJSE_Value(pIsolate)); |
argValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
argValue->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t j = 2; j < iLength; j++) { |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
- if (!FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (!CFXJSE_Value::IsNull(newPropertyValue.get())) |
iCount++; |
} |
} else { |
@@ -661,14 +662,14 @@ void CXFA_FM2JSContext::Count(CFXJSE_Value* pThis, |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
newPropertyValue.get()); |
- iCount += (FXJSE_Value_IsNull(newPropertyValue.get()) ? 0 : 1); |
+ iCount += (CFXJSE_Value::IsNull(newPropertyValue.get()) ? 0 : 1); |
} |
} |
- } else if (FXJSE_Value_IsObject(argValue.get())) { |
+ } else if (CFXJSE_Value::IsObject(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue( |
new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(argValue.get(), newPropertyValue.get()); |
- if (!FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (!CFXJSE_Value::IsNull(newPropertyValue.get())) |
iCount++; |
} else { |
iCount++; |
@@ -707,10 +708,10 @@ void CXFA_FM2JSContext::Max(CFXJSE_Value* pThis, |
FX_DOUBLE dMaxValue = 0.0; |
for (int32_t i = 0; i < args.GetLength(); i++) { |
std::unique_ptr<CFXJSE_Value> argValue = args.GetValue(i); |
- if (FXJSE_Value_IsNull(argValue.get())) |
+ if (CFXJSE_Value::IsNull(argValue.get())) |
continue; |
- if (FXJSE_Value_IsArray(argValue.get())) { |
+ if (CFXJSE_Value::IsArray(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argValue->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -725,11 +726,11 @@ void CXFA_FM2JSContext::Max(CFXJSE_Value* pThis, |
new CFXJSE_Value(pIsolate)); |
argValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
argValue->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t j = 2; j < iLength; j++) { |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
uCount++; |
@@ -743,7 +744,7 @@ void CXFA_FM2JSContext::Max(CFXJSE_Value* pThis, |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
uCount++; |
@@ -751,11 +752,11 @@ void CXFA_FM2JSContext::Max(CFXJSE_Value* pThis, |
dMaxValue = (uCount == 1) ? dValue : std::max(dMaxValue, dValue); |
} |
} |
- } else if (FXJSE_Value_IsObject(argValue.get())) { |
+ } else if (CFXJSE_Value::IsObject(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue( |
new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(argValue.get(), newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
uCount++; |
@@ -785,10 +786,10 @@ void CXFA_FM2JSContext::Min(CFXJSE_Value* pThis, |
FX_DOUBLE dMinValue = 0.0; |
for (int32_t i = 0; i < args.GetLength(); i++) { |
std::unique_ptr<CFXJSE_Value> argValue = args.GetValue(i); |
- if (FXJSE_Value_IsNull(argValue.get())) |
+ if (CFXJSE_Value::IsNull(argValue.get())) |
continue; |
- if (FXJSE_Value_IsArray(argValue.get())) { |
+ if (CFXJSE_Value::IsArray(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argValue->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -803,11 +804,11 @@ void CXFA_FM2JSContext::Min(CFXJSE_Value* pThis, |
new CFXJSE_Value(pIsolate)); |
argValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
argValue->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t j = 2; j < iLength; j++) { |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
uCount++; |
@@ -821,7 +822,7 @@ void CXFA_FM2JSContext::Min(CFXJSE_Value* pThis, |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
uCount++; |
@@ -829,11 +830,11 @@ void CXFA_FM2JSContext::Min(CFXJSE_Value* pThis, |
dMinValue = uCount == 1 ? dValue : std::min(dMinValue, dValue); |
} |
} |
- } else if (FXJSE_Value_IsObject(argValue.get())) { |
+ } else if (CFXJSE_Value::IsObject(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue( |
new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(argValue.get(), newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
uCount++; |
@@ -865,7 +866,8 @@ void CXFA_FM2JSContext::Mod(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
std::unique_ptr<CFXJSE_Value> argTwo = args.GetValue(1); |
- if (FXJSE_Value_IsNull(argOne.get()) || FXJSE_Value_IsNull(argTwo.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get()) || |
+ CFXJSE_Value::IsNull(argTwo.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -900,7 +902,7 @@ void CXFA_FM2JSContext::Round(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -915,7 +917,7 @@ void CXFA_FM2JSContext::Round(CFXJSE_Value* pThis, |
uint8_t uPrecision = 0; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> argTwo = args.GetValue(1); |
- if (FXJSE_Value_IsNull(argTwo.get())) { |
+ if (CFXJSE_Value::IsNull(argTwo.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -952,10 +954,10 @@ void CXFA_FM2JSContext::Sum(CFXJSE_Value* pThis, |
FX_DOUBLE dSum = 0.0; |
for (int32_t i = 0; i < argc; i++) { |
std::unique_ptr<CFXJSE_Value> argValue = args.GetValue(i); |
- if (FXJSE_Value_IsNull(argValue.get())) |
+ if (CFXJSE_Value::IsNull(argValue.get())) |
continue; |
- if (FXJSE_Value_IsArray(argValue.get())) { |
+ if (CFXJSE_Value::IsArray(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argValue->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -969,11 +971,11 @@ void CXFA_FM2JSContext::Sum(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> newPropertyValue( |
new CFXJSE_Value(pIsolate)); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t j = 2; j < iLength; j++) { |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
dSum += ValueToDouble(pThis, jsObjectValue.get()); |
@@ -986,18 +988,18 @@ void CXFA_FM2JSContext::Sum(CFXJSE_Value* pThis, |
argValue->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
dSum += ValueToDouble(pThis, newPropertyValue.get()); |
uCount++; |
} |
} |
- } else if (FXJSE_Value_IsObject(argValue.get())) { |
+ } else if (CFXJSE_Value::IsObject(argValue.get())) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue( |
new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(argValue.get(), newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) |
continue; |
dSum += ValueToDouble(pThis, argValue.get()); |
@@ -1105,7 +1107,7 @@ void CXFA_FM2JSContext::DateFmt(CFXJSE_Value* pThis, |
int32_t iStyle = 0; |
if (argc > 0) { |
std::unique_ptr<CFXJSE_Value> argStyle = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argStyle.get())) { |
+ if (CFXJSE_Value::IsNull(argStyle.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1118,7 +1120,7 @@ void CXFA_FM2JSContext::DateFmt(CFXJSE_Value* pThis, |
CFX_ByteString szLocal; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> argLocal = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argLocal.get())) { |
+ if (CFXJSE_Value::IsNull(argLocal.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1141,7 +1143,7 @@ void CXFA_FM2JSContext::IsoDate2Num(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1224,7 +1226,7 @@ void CXFA_FM2JSContext::LocalDateFmt(CFXJSE_Value* pThis, |
int32_t iStyle = 0; |
if (argc > 0) { |
std::unique_ptr<CFXJSE_Value> argStyle = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argStyle.get())) { |
+ if (CFXJSE_Value::IsNull(argStyle.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1236,7 +1238,7 @@ void CXFA_FM2JSContext::LocalDateFmt(CFXJSE_Value* pThis, |
CFX_ByteString szLocal; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> argLocal = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argLocal.get())) { |
+ if (CFXJSE_Value::IsNull(argLocal.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1262,7 +1264,7 @@ void CXFA_FM2JSContext::LocalTimeFmt(CFXJSE_Value* pThis, |
int32_t iStyle = 0; |
if (argc > 0) { |
std::unique_ptr<CFXJSE_Value> argStyle = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argStyle.get())) { |
+ if (CFXJSE_Value::IsNull(argStyle.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1274,7 +1276,7 @@ void CXFA_FM2JSContext::LocalTimeFmt(CFXJSE_Value* pThis, |
CFX_ByteString szLocal; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> argLocal = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argLocal.get())) { |
+ if (CFXJSE_Value::IsNull(argLocal.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1440,7 +1442,7 @@ void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> timeValue = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(timeValue.get())) { |
+ if (CFXJSE_Value::IsNull(timeValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1453,7 +1455,7 @@ void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis, |
CFX_ByteString formatString; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> formatValue = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(formatValue.get())) { |
+ if (CFXJSE_Value::IsNull(formatValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1463,7 +1465,7 @@ void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis, |
CFX_ByteString localString; |
if (argc > 2) { |
std::unique_ptr<CFXJSE_Value> localValue = GetSimpleValue(pThis, args, 2); |
- if (FXJSE_Value_IsNull(localValue.get())) { |
+ if (CFXJSE_Value::IsNull(localValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1488,7 +1490,7 @@ void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> timeValue = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(timeValue.get())) { |
+ if (CFXJSE_Value::IsNull(timeValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1501,7 +1503,7 @@ void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis, |
CFX_ByteString formatString; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> formatValue = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(formatValue.get())) { |
+ if (CFXJSE_Value::IsNull(formatValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1511,7 +1513,7 @@ void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis, |
CFX_ByteString localString; |
if (argc > 2) { |
std::unique_ptr<CFXJSE_Value> localValue = GetSimpleValue(pThis, args, 2); |
- if (FXJSE_Value_IsNull(localValue.get())) { |
+ if (CFXJSE_Value::IsNull(localValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1648,7 +1650,7 @@ void CXFA_FM2JSContext::TimeFmt(CFXJSE_Value* pThis, |
int32_t iStyle = 0; |
if (argc > 0) { |
std::unique_ptr<CFXJSE_Value> argStyle = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argStyle.get())) { |
+ if (CFXJSE_Value::IsNull(argStyle.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -1660,7 +1662,7 @@ void CXFA_FM2JSContext::TimeFmt(CFXJSE_Value* pThis, |
CFX_ByteString szLocal; |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> argLocal = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argLocal.get())) { |
+ if (CFXJSE_Value::IsNull(argLocal.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -2818,7 +2820,7 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis, |
v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
while (!bFound && !bStopCounterFlags && (iArgIndex < argc)) { |
std::unique_ptr<CFXJSE_Value> argIndexValue = args.GetValue(iArgIndex); |
- if (FXJSE_Value_IsArray(argIndexValue.get())) { |
+ if (CFXJSE_Value::IsArray(argIndexValue.get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argIndexValue->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -2834,7 +2836,7 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis, |
argIndexValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
argIndexValue->GetObjectPropertyByIdx( |
(iLength - 1) - (iValueIndex - iIndex), jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
} else { |
CFX_ByteString propStr; |
@@ -2873,7 +2875,7 @@ void CXFA_FM2JSContext::Exists(CFXJSE_Value* pThis, |
} |
args.GetReturnValue()->SetInteger( |
- FXJSE_Value_IsObject(args.GetValue(0).get())); |
+ CFXJSE_Value::IsObject(args.GetValue(0).get())); |
} |
// static |
@@ -2887,9 +2889,9 @@ void CXFA_FM2JSContext::HasValue(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (!FXJSE_Value_IsUTF8String(argOne.get())) { |
- args.GetReturnValue()->SetInteger(FXJSE_Value_IsNumber(argOne.get()) || |
- FXJSE_Value_IsBoolean(argOne.get())); |
+ if (!CFXJSE_Value::IsUTF8String(argOne.get())) { |
+ args.GetReturnValue()->SetInteger(CFXJSE_Value::IsNumber(argOne.get()) || |
+ CFXJSE_Value::IsBoolean(argOne.get())); |
return; |
} |
@@ -2938,14 +2940,14 @@ void CXFA_FM2JSContext::Within(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetUndefined(); |
return; |
} |
std::unique_ptr<CFXJSE_Value> argLow = GetSimpleValue(pThis, args, 1); |
std::unique_ptr<CFXJSE_Value> argHigh = GetSimpleValue(pThis, args, 2); |
- if (FXJSE_Value_IsNumber(argOne.get())) { |
+ if (CFXJSE_Value::IsNumber(argOne.get())) { |
FX_FLOAT oneNumber = ValueToFloat(pThis, argOne.get()); |
FX_FLOAT lowNumber = ValueToFloat(pThis, argLow.get()); |
FX_FLOAT heightNumber = ValueToFloat(pThis, argHigh.get()); |
@@ -3004,18 +3006,16 @@ void CXFA_FM2JSContext::Eval(CFXJSE_Value* pThis, |
CXFA_FM2JSContext::Translate( |
CFX_WideString::FromUTF8(utf8ScriptString.AsStringC()).AsStringC(), |
wsJavaScriptBuf, wsError); |
- CFXJSE_Context* pNewContext = |
- FXJSE_Context_Create(pIsolate, nullptr, nullptr); |
+ std::unique_ptr<CFXJSE_Context> pNewContext( |
+ CFXJSE_Context::Create(pIsolate, nullptr, nullptr)); |
std::unique_ptr<CFXJSE_Value> returnValue(new CFXJSE_Value(pIsolate)); |
CFX_WideString javaScript(wsJavaScriptBuf.AsStringC()); |
- FXJSE_ExecuteScript( |
- pNewContext, |
+ pNewContext->ExecuteScript( |
FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength()).c_str(), |
returnValue.get()); |
args.GetReturnValue()->Assign(returnValue.get()); |
- FXJSE_Context_Release(pNewContext); |
} |
// static |
@@ -3030,19 +3030,19 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- if (!FXJSE_Value_IsArray(argOne.get()) && |
- !FXJSE_Value_IsObject(argOne.get()) && |
- !FXJSE_Value_IsBoolean(argOne.get()) && |
- !FXJSE_Value_IsUTF8String(argOne.get()) && |
- !FXJSE_Value_IsNull(argOne.get()) && |
- !FXJSE_Value_IsNumber(argOne.get())) { |
+ if (!CFXJSE_Value::IsArray(argOne.get()) && |
+ !CFXJSE_Value::IsObject(argOne.get()) && |
+ !CFXJSE_Value::IsBoolean(argOne.get()) && |
+ !CFXJSE_Value::IsUTF8String(argOne.get()) && |
+ !CFXJSE_Value::IsNull(argOne.get()) && |
+ !CFXJSE_Value::IsNumber(argOne.get())) { |
pContext->ThrowException(XFA_IDS_ARGUMENT_MISMATCH); |
return; |
} |
- if (FXJSE_Value_IsBoolean(argOne.get()) || |
- FXJSE_Value_IsUTF8String(argOne.get()) || |
- FXJSE_Value_IsNumber(argOne.get())) { |
+ if (CFXJSE_Value::IsBoolean(argOne.get()) || |
+ CFXJSE_Value::IsUTF8String(argOne.get()) || |
+ CFXJSE_Value::IsNumber(argOne.get())) { |
args.GetReturnValue()->Assign(argOne.get()); |
return; |
} |
@@ -3052,10 +3052,10 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis, |
rgValues[i] = new CFXJSE_Value(pIsolate); |
int intVal = 3; |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
intVal = 4; |
rgValues[2]->SetNull(); |
- } else if (FXJSE_Value_IsArray(argOne.get())) { |
+ } else if (CFXJSE_Value::IsArray(argOne.get())) { |
#ifndef NDEBUG |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argOne->GetObjectProperty("length", lengthValue.get()); |
@@ -3066,8 +3066,8 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
argOne->GetObjectPropertyByIdx(1, propertyValue.get()); |
argOne->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (!FXJSE_Value_IsNull(propertyValue.get()) || |
- FXJSE_Value_IsNull(jsObjectValue.get())) { |
+ if (!CFXJSE_Value::IsNull(propertyValue.get()) || |
+ CFXJSE_Value::IsNull(jsObjectValue.get())) { |
for (int32_t i = 0; i < 3; i++) |
delete rgValues[i]; |
@@ -3076,7 +3076,7 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis, |
} |
rgValues[2]->Assign(jsObjectValue.get()); |
- } else if (FXJSE_Value_IsObject(argOne.get())) { |
+ } else if (CFXJSE_Value::IsObject(argOne.get())) { |
rgValues[2]->Assign(argOne.get()); |
} |
@@ -3099,7 +3099,7 @@ void CXFA_FM2JSContext::UnitType(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> unitspanValue = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(unitspanValue.get())) { |
+ if (CFXJSE_Value::IsNull(unitspanValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -3213,7 +3213,7 @@ void CXFA_FM2JSContext::UnitValue(CFXJSE_Value* pThis, |
} |
std::unique_ptr<CFXJSE_Value> unitspanValue = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(unitspanValue.get())) { |
+ if (CFXJSE_Value::IsNull(unitspanValue.get())) { |
args.GetReturnValue()->SetNull(); |
return; |
} |
@@ -4456,7 +4456,7 @@ void CXFA_FM2JSContext::Space(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
int32_t count = 0; |
@@ -4488,7 +4488,7 @@ void CXFA_FM2JSContext::Str(CFXJSE_Value* pThis, |
int32_t iWidth = 10; |
int32_t iPrecision = 0; |
std::unique_ptr<CFXJSE_Value> numberValue = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(numberValue.get())) { |
+ if (CFXJSE_Value::IsNull(numberValue.get())) { |
bFlags = TRUE; |
} else { |
fNumber = ValueToFloat(pThis, numberValue.get()); |
@@ -4609,9 +4609,9 @@ void CXFA_FM2JSContext::Stuff(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> sourceValue = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> startValue = GetSimpleValue(pThis, args, 1); |
std::unique_ptr<CFXJSE_Value> deleteValue = GetSimpleValue(pThis, args, 2); |
- if (!FXJSE_Value_IsNull(sourceValue.get()) && |
- !FXJSE_Value_IsNull(startValue.get()) && |
- !FXJSE_Value_IsNull(deleteValue.get())) { |
+ if (!CFXJSE_Value::IsNull(sourceValue.get()) && |
+ !CFXJSE_Value::IsNull(startValue.get()) && |
+ !CFXJSE_Value::IsNull(deleteValue.get())) { |
ValueToUTF8String(sourceValue.get(), sourceString); |
iLength = sourceString.GetLength(); |
iStart = (int32_t)ValueToFloat(pThis, startValue.get()); |
@@ -4770,7 +4770,7 @@ void CXFA_FM2JSContext::WordNum(CFXJSE_Value* pThis, |
int32_t iIdentifier = 0; |
CFX_ByteString localeString; |
std::unique_ptr<CFXJSE_Value> numberValue = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(numberValue.get())) { |
+ if (CFXJSE_Value::IsNull(numberValue.get())) { |
bFlags = TRUE; |
} else { |
fNumber = ValueToFloat(pThis, numberValue.get()); |
@@ -4778,7 +4778,7 @@ void CXFA_FM2JSContext::WordNum(CFXJSE_Value* pThis, |
if (argc > 1) { |
std::unique_ptr<CFXJSE_Value> identifierValue = |
GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(identifierValue.get())) { |
+ if (CFXJSE_Value::IsNull(identifierValue.get())) { |
bFlags = TRUE; |
} else { |
iIdentifier = (int32_t)ValueToFloat(pThis, identifierValue.get()); |
@@ -4787,7 +4787,7 @@ void CXFA_FM2JSContext::WordNum(CFXJSE_Value* pThis, |
if (argc > 2) { |
std::unique_ptr<CFXJSE_Value> localeValue = |
GetSimpleValue(pThis, args, 2); |
- if (FXJSE_Value_IsNull(localeValue.get())) { |
+ if (CFXJSE_Value::IsNull(localeValue.get())) { |
bFlags = TRUE; |
} else { |
ValueToUTF8String(localeValue.get(), localeString); |
@@ -5149,14 +5149,14 @@ void CXFA_FM2JSContext::assign_value_operator(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> lValue = args.GetValue(0); |
std::unique_ptr<CFXJSE_Value> rValue = GetSimpleValue(pThis, args, 1); |
FX_BOOL bSetStatus = TRUE; |
- if (FXJSE_Value_IsArray(lValue.get())) { |
+ if (CFXJSE_Value::IsArray(lValue.get())) { |
std::unique_ptr<CFXJSE_Value> leftLengthValue(new CFXJSE_Value(pIsolate)); |
lValue->GetObjectProperty("length", leftLengthValue.get()); |
int32_t iLeftLength = leftLengthValue->ToInteger(); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
lValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t i = 2; i < iLeftLength; i++) { |
lValue->GetObjectPropertyByIdx(i, jsObjectValue.get()); |
bSetStatus = SetObjectDefaultValue(jsObjectValue.get(), rValue.get()); |
@@ -5174,7 +5174,7 @@ void CXFA_FM2JSContext::assign_value_operator(CFXJSE_Value* pThis, |
rValue.get()); |
} |
} |
- } else if (FXJSE_Value_IsObject(lValue.get())) { |
+ } else if (CFXJSE_Value::IsObject(lValue.get())) { |
bSetStatus = SetObjectDefaultValue(lValue.get(), rValue.get()); |
if (!bSetStatus) { |
pContext->ThrowException(XFA_IDS_NOT_DEFAUL_VALUE); |
@@ -5193,8 +5193,8 @@ void CXFA_FM2JSContext::logical_or_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
FX_FLOAT first = ValueToFloat(pThis, argFirst.get()); |
@@ -5213,8 +5213,8 @@ void CXFA_FM2JSContext::logical_and_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
FX_FLOAT first = ValueToFloat(pThis, argFirst.get()); |
@@ -5236,14 +5236,15 @@ void CXFA_FM2JSContext::equality_operator(CFXJSE_Value* pThis, |
} else { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) || |
- FXJSE_Value_IsNull(argSecond.get())) { |
- args.GetReturnValue()->SetInteger((FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) |
- ? 1 |
- : 0); |
- } else if (FXJSE_Value_IsUTF8String(argFirst.get()) && |
- FXJSE_Value_IsUTF8String(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) || |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
+ args.GetReturnValue()->SetInteger( |
+ (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) |
+ ? 1 |
+ : 0); |
+ } else if (CFXJSE_Value::IsUTF8String(argFirst.get()) && |
+ CFXJSE_Value::IsUTF8String(argSecond.get())) { |
CFX_ByteString firstOutput; |
CFX_ByteString secondOutput; |
argFirst->ToString(firstOutput); |
@@ -5270,14 +5271,15 @@ void CXFA_FM2JSContext::notequality_operator(CFXJSE_Value* pThis, |
} else { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) || |
- FXJSE_Value_IsNull(argSecond.get())) { |
- args.GetReturnValue()->SetInteger((FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) |
- ? 0 |
- : 1); |
- } else if (FXJSE_Value_IsUTF8String(argFirst.get()) && |
- FXJSE_Value_IsUTF8String(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) || |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
+ args.GetReturnValue()->SetInteger( |
+ (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) |
+ ? 0 |
+ : 1); |
+ } else if (CFXJSE_Value::IsUTF8String(argFirst.get()) && |
+ CFXJSE_Value::IsUTF8String(argSecond.get())) { |
CFX_ByteString firstOutput; |
CFX_ByteString secondOutput; |
argFirst->ToString(firstOutput); |
@@ -5301,8 +5303,8 @@ FX_BOOL CXFA_FM2JSContext::fm_ref_equal(CFXJSE_Value* pThis, |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
std::unique_ptr<CFXJSE_Value> argFirst = args.GetValue(0); |
std::unique_ptr<CFXJSE_Value> argSecond = args.GetValue(1); |
- if (FXJSE_Value_IsArray(argFirst.get()) && |
- FXJSE_Value_IsArray(argSecond.get())) { |
+ if (CFXJSE_Value::IsArray(argFirst.get()) && |
+ CFXJSE_Value::IsArray(argSecond.get())) { |
std::unique_ptr<CFXJSE_Value> firstFlagValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> secondFlagValue(new CFXJSE_Value(pIsolate)); |
argFirst->GetObjectPropertyByIdx(0, firstFlagValue.get()); |
@@ -5312,8 +5314,8 @@ FX_BOOL CXFA_FM2JSContext::fm_ref_equal(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> secondJSObject(new CFXJSE_Value(pIsolate)); |
argFirst->GetObjectPropertyByIdx(2, firstJSObject.get()); |
argSecond->GetObjectPropertyByIdx(2, secondJSObject.get()); |
- if (!FXJSE_Value_IsNull(firstJSObject.get()) && |
- !FXJSE_Value_IsNull(secondJSObject.get())) { |
+ if (!CFXJSE_Value::IsNull(firstJSObject.get()) && |
+ !CFXJSE_Value::IsNull(secondJSObject.get())) { |
bRet = (firstJSObject->ToHostObject(nullptr) == |
secondJSObject->ToHostObject(nullptr)); |
} |
@@ -5329,11 +5331,11 @@ void CXFA_FM2JSContext::less_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) || |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) || |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetInteger(0); |
- } else if (FXJSE_Value_IsUTF8String(argFirst.get()) && |
- FXJSE_Value_IsUTF8String(argSecond.get())) { |
+ } else if (CFXJSE_Value::IsUTF8String(argFirst.get()) && |
+ CFXJSE_Value::IsUTF8String(argSecond.get())) { |
CFX_ByteString firstOutput; |
CFX_ByteString secondOutput; |
argFirst->ToString(firstOutput); |
@@ -5357,14 +5359,14 @@ void CXFA_FM2JSContext::lessequal_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) || |
- FXJSE_Value_IsNull(argSecond.get())) { |
- args.GetReturnValue()->SetInteger((FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) |
+ if (CFXJSE_Value::IsNull(argFirst.get()) || |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
+ args.GetReturnValue()->SetInteger((CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) |
? 1 |
: 0); |
- } else if (FXJSE_Value_IsUTF8String(argFirst.get()) && |
- FXJSE_Value_IsUTF8String(argSecond.get())) { |
+ } else if (CFXJSE_Value::IsUTF8String(argFirst.get()) && |
+ CFXJSE_Value::IsUTF8String(argSecond.get())) { |
CFX_ByteString firstOutput; |
CFX_ByteString secondOutput; |
argFirst->ToString(firstOutput); |
@@ -5388,11 +5390,11 @@ void CXFA_FM2JSContext::greater_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) || |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) || |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetInteger(0); |
- } else if (FXJSE_Value_IsUTF8String(argFirst.get()) && |
- FXJSE_Value_IsUTF8String(argSecond.get())) { |
+ } else if (CFXJSE_Value::IsUTF8String(argFirst.get()) && |
+ CFXJSE_Value::IsUTF8String(argSecond.get())) { |
CFX_ByteString firstOutput; |
CFX_ByteString secondOutput; |
argFirst->ToString(firstOutput); |
@@ -5416,14 +5418,14 @@ void CXFA_FM2JSContext::greaterequal_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) || |
- FXJSE_Value_IsNull(argSecond.get())) { |
- args.GetReturnValue()->SetInteger((FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) |
+ if (CFXJSE_Value::IsNull(argFirst.get()) || |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
+ args.GetReturnValue()->SetInteger((CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) |
? 1 |
: 0); |
- } else if (FXJSE_Value_IsUTF8String(argFirst.get()) && |
- FXJSE_Value_IsUTF8String(argSecond.get())) { |
+ } else if (CFXJSE_Value::IsUTF8String(argFirst.get()) && |
+ CFXJSE_Value::IsUTF8String(argSecond.get())) { |
CFX_ByteString firstOutput; |
CFX_ByteString secondOutput; |
argFirst->ToString(firstOutput); |
@@ -5467,8 +5469,8 @@ void CXFA_FM2JSContext::minus_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
FX_DOUBLE first = ValueToDouble(pThis, argFirst.get()); |
@@ -5487,8 +5489,8 @@ void CXFA_FM2JSContext::multiple_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
FX_DOUBLE first = ValueToDouble(pThis, argFirst.get()); |
@@ -5508,8 +5510,8 @@ void CXFA_FM2JSContext::divide_operator(CFXJSE_Value* pThis, |
if (args.GetLength() == 2) { |
std::unique_ptr<CFXJSE_Value> argFirst = GetSimpleValue(pThis, args, 0); |
std::unique_ptr<CFXJSE_Value> argSecond = GetSimpleValue(pThis, args, 1); |
- if (FXJSE_Value_IsNull(argFirst.get()) && |
- FXJSE_Value_IsNull(argSecond.get())) { |
+ if (CFXJSE_Value::IsNull(argFirst.get()) && |
+ CFXJSE_Value::IsNull(argSecond.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
FX_DOUBLE first = ValueToDouble(pThis, argFirst.get()); |
@@ -5531,7 +5533,7 @@ void CXFA_FM2JSContext::positive_operator(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
args.GetReturnValue()->SetDouble(0.0 + |
@@ -5548,7 +5550,7 @@ void CXFA_FM2JSContext::negative_operator(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
args.GetReturnValue()->SetDouble(0.0 - |
@@ -5565,7 +5567,7 @@ void CXFA_FM2JSContext::logical_not_operator(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = GetSimpleValue(pThis, args, 0); |
- if (FXJSE_Value_IsNull(argOne.get())) { |
+ if (CFXJSE_Value::IsNull(argOne.get())) { |
args.GetReturnValue()->SetNull(); |
} else { |
FX_DOUBLE first = ValueToDouble(pThis, argOne.get()); |
@@ -5598,7 +5600,7 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis, |
CFX_ByteString szSomExp; |
GenerateSomExpression(szName.AsStringC(), iIndexFlags, iIndexValue, bIsStar, |
szSomExp); |
- if (FXJSE_Value_IsArray(argAccessor.get())) { |
+ if (CFXJSE_Value::IsArray(argAccessor.get())) { |
std::unique_ptr<CFXJSE_Value> pLengthValue(new CFXJSE_Value(pIsolate)); |
argAccessor->GetObjectProperty("length", pLengthValue.get()); |
int32_t iLength = pLengthValue->ToInteger(); |
@@ -5667,11 +5669,12 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis, |
} else { |
XFA_RESOLVENODE_RS resoveNodeRS; |
int32_t iRet = 0; |
- if (FXJSE_Value_IsObject(argAccessor.get()) || |
- (FXJSE_Value_IsNull(argAccessor.get()) && bsAccessorName.IsEmpty())) { |
+ if (CFXJSE_Value::IsObject(argAccessor.get()) || |
+ (CFXJSE_Value::IsNull(argAccessor.get()) && |
+ bsAccessorName.IsEmpty())) { |
iRet = ResolveObjects(pThis, argAccessor.get(), szSomExp.AsStringC(), |
resoveNodeRS, TRUE, szName.IsEmpty()); |
- } else if (!FXJSE_Value_IsObject(argAccessor.get()) && |
+ } else if (!CFXJSE_Value::IsObject(argAccessor.get()) && |
!bsAccessorName.IsEmpty()) { |
FX_BOOL bGetObject = GetObjectByName(pThis, argAccessor.get(), |
bsAccessorName.AsStringC()); |
@@ -5745,7 +5748,7 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis, |
CFX_ByteString szSomExp; |
GenerateSomExpression(szName.AsStringC(), iIndexFlags, iIndexValue, bIsStar, |
szSomExp); |
- if (FXJSE_Value_IsArray(argAccessor.get())) { |
+ if (CFXJSE_Value::IsArray(argAccessor.get())) { |
std::unique_ptr<CFXJSE_Value> pLengthValue(new CFXJSE_Value(pIsolate)); |
argAccessor->GetObjectProperty("length", pLengthValue.get()); |
int32_t iLength = pLengthValue->ToInteger(); |
@@ -5809,11 +5812,12 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis, |
} else { |
XFA_RESOLVENODE_RS resoveNodeRS; |
int32_t iRet = 0; |
- if (FXJSE_Value_IsObject(argAccessor.get()) || |
- (FXJSE_Value_IsNull(argAccessor.get()) && bsAccessorName.IsEmpty())) { |
+ if (CFXJSE_Value::IsObject(argAccessor.get()) || |
+ (CFXJSE_Value::IsNull(argAccessor.get()) && |
+ bsAccessorName.IsEmpty())) { |
iRet = ResolveObjects(pThis, argAccessor.get(), szSomExp.AsStringC(), |
resoveNodeRS, FALSE); |
- } else if (!FXJSE_Value_IsObject(argAccessor.get()) && |
+ } else if (!CFXJSE_Value::IsObject(argAccessor.get()) && |
!bsAccessorName.IsEmpty()) { |
FX_BOOL bGetObject = GetObjectByName(pThis, argAccessor.get(), |
bsAccessorName.AsStringC()); |
@@ -5903,7 +5907,7 @@ void CXFA_FM2JSContext::is_fm_object(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- args.GetReturnValue()->SetBoolean(FXJSE_Value_IsObject(argOne.get())); |
+ args.GetReturnValue()->SetBoolean(CFXJSE_Value::IsObject(argOne.get())); |
} else { |
args.GetReturnValue()->SetBoolean(FALSE); |
} |
@@ -5915,7 +5919,7 @@ void CXFA_FM2JSContext::is_fm_array(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- FX_BOOL bIsArray = FXJSE_Value_IsArray(argOne.get()); |
+ FX_BOOL bIsArray = CFXJSE_Value::IsArray(argOne.get()); |
args.GetReturnValue()->SetBoolean(bIsArray); |
} else { |
args.GetReturnValue()->SetBoolean(FALSE); |
@@ -5930,12 +5934,12 @@ void CXFA_FM2JSContext::get_fm_value(CFXJSE_Value* pThis, |
v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- if (FXJSE_Value_IsArray(argOne.get())) { |
+ if (CFXJSE_Value::IsArray(argOne.get())) { |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
argOne->GetObjectPropertyByIdx(1, propertyValue.get()); |
argOne->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
GetObjectDefaultValue(jsObjectValue.get(), args.GetReturnValue()); |
} else { |
CFX_ByteString propertyStr; |
@@ -5943,7 +5947,7 @@ void CXFA_FM2JSContext::get_fm_value(CFXJSE_Value* pThis, |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
args.GetReturnValue()); |
} |
- } else if (FXJSE_Value_IsObject(argOne.get())) { |
+ } else if (CFXJSE_Value::IsObject(argOne.get())) { |
GetObjectDefaultValue(argOne.get(), args.GetReturnValue()); |
} else { |
args.GetReturnValue()->Assign(argOne.get()); |
@@ -5959,7 +5963,7 @@ void CXFA_FM2JSContext::get_fm_jsobj(CFXJSE_Value* pThis, |
CFXJSE_Arguments& args) { |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- if (FXJSE_Value_IsArray(argOne.get())) { |
+ if (CFXJSE_Value::IsArray(argOne.get())) { |
#ifndef NDEBUG |
CXFA_FM2JSContext* pContext = ToJSContext(pThis, nullptr); |
v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
@@ -5985,7 +5989,7 @@ void CXFA_FM2JSContext::fm_var_filter(CFXJSE_Value* pThis, |
v8::Isolate* pIsolate = pContext->GetScriptRuntime(); |
if (args.GetLength() == 1) { |
std::unique_ptr<CFXJSE_Value> argOne = args.GetValue(0); |
- if (FXJSE_Value_IsArray(argOne.get())) { |
+ if (CFXJSE_Value::IsArray(argOne.get())) { |
#ifndef NDEBUG |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argOne->GetObjectProperty("length", lengthValue.get()); |
@@ -6008,7 +6012,7 @@ void CXFA_FM2JSContext::fm_var_filter(CFXJSE_Value* pThis, |
} else if (iFlags == 3) { |
std::unique_ptr<CFXJSE_Value> objectValue(new CFXJSE_Value(pIsolate)); |
argOne->GetObjectPropertyByIdx(2, objectValue.get()); |
- if (!FXJSE_Value_IsNull(objectValue.get())) { |
+ if (!CFXJSE_Value::IsNull(objectValue.get())) { |
args.GetReturnValue()->Assign(argOne.get()); |
} else { |
pContext->ThrowException(XFA_IDS_COMPILER_ERROR); |
@@ -6038,7 +6042,7 @@ void CXFA_FM2JSContext::concat_fm_object(CFXJSE_Value* pThis, |
std::vector<std::unique_ptr<CFXJSE_Value>> argValues; |
for (int32_t i = 0; i < argc; i++) { |
argValues.push_back(args.GetValue(i)); |
- if (FXJSE_Value_IsArray(argValues[i].get())) { |
+ if (CFXJSE_Value::IsArray(argValues[i].get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argValues[i]->GetObjectProperty("length", lengthValue.get()); |
int32_t length = lengthValue->ToInteger(); |
@@ -6052,7 +6056,7 @@ void CXFA_FM2JSContext::concat_fm_object(CFXJSE_Value* pThis, |
int32_t index = 0; |
for (int32_t i = 0; i < argc; i++) { |
- if (FXJSE_Value_IsArray(argValues[i].get())) { |
+ if (CFXJSE_Value::IsArray(argValues[i].get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argValues[i]->GetObjectProperty("length", lengthValue.get()); |
int32_t length = lengthValue->ToInteger(); |
@@ -6079,7 +6083,7 @@ std::unique_ptr<CFXJSE_Value> CXFA_FM2JSContext::GetSimpleValue( |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
ASSERT(index < (uint32_t)args.GetLength()); |
std::unique_ptr<CFXJSE_Value> argIndex = args.GetValue(index); |
- if (FXJSE_Value_IsArray(argIndex.get())) { |
+ if (CFXJSE_Value::IsArray(argIndex.get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argIndex->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -6089,7 +6093,7 @@ std::unique_ptr<CFXJSE_Value> CXFA_FM2JSContext::GetSimpleValue( |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
argIndex->GetObjectPropertyByIdx(1, propertyValue.get()); |
argIndex->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
GetObjectDefaultValue(jsObjectValue.get(), simpleValue.get()); |
} else { |
CFX_ByteString propertyStr; |
@@ -6101,7 +6105,7 @@ std::unique_ptr<CFXJSE_Value> CXFA_FM2JSContext::GetSimpleValue( |
simpleValue.get()->SetUndefined(); |
} |
return simpleValue; |
- } else if (FXJSE_Value_IsObject(argIndex.get())) { |
+ } else if (CFXJSE_Value::IsObject(argIndex.get())) { |
std::unique_ptr<CFXJSE_Value> defaultValue(new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(argIndex.get(), defaultValue.get()); |
return defaultValue; |
@@ -6114,19 +6118,19 @@ std::unique_ptr<CFXJSE_Value> CXFA_FM2JSContext::GetSimpleValue( |
FX_BOOL CXFA_FM2JSContext::ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* arg) { |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
FX_BOOL isNull = FALSE; |
- if (FXJSE_Value_IsNull(arg)) { |
+ if (CFXJSE_Value::IsNull(arg)) { |
isNull = TRUE; |
- } else if (FXJSE_Value_IsArray(arg)) { |
+ } else if (CFXJSE_Value::IsArray(arg)) { |
int32_t iLength = hvalue_get_array_length(pThis, arg); |
if (iLength > 2) { |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
arg->GetObjectPropertyByIdx(1, propertyValue.get()); |
arg->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
std::unique_ptr<CFXJSE_Value> defaultValue(new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(jsObjectValue.get(), defaultValue.get()); |
- if (FXJSE_Value_IsNull(defaultValue.get())) { |
+ if (CFXJSE_Value::IsNull(defaultValue.get())) { |
isNull = TRUE; |
} |
} else { |
@@ -6136,17 +6140,17 @@ FX_BOOL CXFA_FM2JSContext::ValueIsNull(CFXJSE_Value* pThis, CFXJSE_Value* arg) { |
new CFXJSE_Value(pIsolate)); |
jsObjectValue->GetObjectProperty(propertyStr.AsStringC(), |
newPropertyValue.get()); |
- if (FXJSE_Value_IsNull(newPropertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(newPropertyValue.get())) { |
isNull = TRUE; |
} |
} |
} else { |
isNull = TRUE; |
} |
- } else if (FXJSE_Value_IsObject(arg)) { |
+ } else if (CFXJSE_Value::IsObject(arg)) { |
std::unique_ptr<CFXJSE_Value> defaultValue(new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(arg, defaultValue.get()); |
- if (FXJSE_Value_IsNull(defaultValue.get())) { |
+ if (CFXJSE_Value::IsNull(defaultValue.get())) { |
isNull = TRUE; |
} |
} |
@@ -6158,7 +6162,7 @@ int32_t CXFA_FM2JSContext::hvalue_get_array_length(CFXJSE_Value* pThis, |
CFXJSE_Value* arg) { |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
int32_t iLength = 0; |
- if (FXJSE_Value_IsArray(arg)) { |
+ if (CFXJSE_Value::IsArray(arg)) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
arg->GetObjectProperty("length", lengthValue.get()); |
iLength = lengthValue->ToInteger(); |
@@ -6171,19 +6175,19 @@ FX_BOOL CXFA_FM2JSContext::simpleValueCompare(CFXJSE_Value* pThis, |
CFXJSE_Value* firstValue, |
CFXJSE_Value* secondValue) { |
FX_BOOL bReturn = FALSE; |
- if (FXJSE_Value_IsUTF8String(firstValue)) { |
+ if (CFXJSE_Value::IsUTF8String(firstValue)) { |
CFX_ByteString firstString, secondString; |
ValueToUTF8String(firstValue, firstString); |
ValueToUTF8String(secondValue, secondString); |
bReturn = firstString == secondString; |
- } else if (FXJSE_Value_IsNumber(firstValue)) { |
+ } else if (CFXJSE_Value::IsNumber(firstValue)) { |
FX_FLOAT first = ValueToFloat(pThis, firstValue); |
FX_FLOAT second = ValueToFloat(pThis, secondValue); |
bReturn = (first == second); |
- } else if (FXJSE_Value_IsBoolean(firstValue)) { |
+ } else if (CFXJSE_Value::IsBoolean(firstValue)) { |
bReturn = (firstValue->ToBoolean() == secondValue->ToBoolean()); |
- } else if (FXJSE_Value_IsNull(firstValue) && |
- FXJSE_Value_IsNull(secondValue)) { |
+ } else if (CFXJSE_Value::IsNull(firstValue) && |
+ CFXJSE_Value::IsNull(secondValue)) { |
bReturn = TRUE; |
} |
return bReturn; |
@@ -6201,7 +6205,7 @@ void CXFA_FM2JSContext::unfoldArgs(CFXJSE_Value* pThis, |
std::vector<std::unique_ptr<CFXJSE_Value>> argsValue; |
for (int32_t i = 0; i < argc - iStart; i++) { |
argsValue.push_back(args.GetValue(i + iStart)); |
- if (FXJSE_Value_IsArray(argsValue[i].get())) { |
+ if (CFXJSE_Value::IsArray(argsValue[i].get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argsValue[i]->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -6216,7 +6220,7 @@ void CXFA_FM2JSContext::unfoldArgs(CFXJSE_Value* pThis, |
int32_t index = 0; |
for (int32_t i = 0; i < argc - iStart; i++) { |
- if (FXJSE_Value_IsArray(argsValue[i].get())) { |
+ if (CFXJSE_Value::IsArray(argsValue[i].get())) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
argsValue[i]->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -6224,7 +6228,7 @@ void CXFA_FM2JSContext::unfoldArgs(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
argsValue[i]->GetObjectPropertyByIdx(1, propertyValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
for (int32_t j = 2; j < iLength; j++) { |
argsValue[i]->GetObjectPropertyByIdx(j, jsObjectValue.get()); |
GetObjectDefaultValue(jsObjectValue.get(), resultValues[index]); |
@@ -6241,7 +6245,7 @@ void CXFA_FM2JSContext::unfoldArgs(CFXJSE_Value* pThis, |
} |
} |
} |
- } else if (FXJSE_Value_IsObject(argsValue[i].get())) { |
+ } else if (CFXJSE_Value::IsObject(argsValue[i].get())) { |
GetObjectDefaultValue(argsValue[i].get(), resultValues[index]); |
index++; |
} else { |
@@ -6347,7 +6351,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(CFXJSE_Value* pThis, |
CXFA_Object* pNode = nullptr; |
uint32_t dFlags = 0UL; |
if (bdotAccessor) { |
- if (FXJSE_Value_IsNull(pRefValue)) { |
+ if (CFXJSE_Value::IsNull(pRefValue)) { |
pNode = pScriptContext->GetThisObject(); |
dFlags = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; |
} else { |
@@ -6408,7 +6412,7 @@ void CXFA_FM2JSContext::ParseResolveResult( |
int32_t iRet = resoveNodeRS.GetAttributeResult(objectProperties); |
bAttribute = (iRet == 0); |
if (bAttribute) { |
- if (FXJSE_Value_IsObject(pParentValue)) { |
+ if (CFXJSE_Value::IsObject(pParentValue)) { |
iSize = 1; |
resultValues = FX_Alloc(CFXJSE_Value*, 1); |
resultValues[0] = new CFXJSE_Value(pIsolate); |
@@ -6430,13 +6434,13 @@ int32_t CXFA_FM2JSContext::ValueToInteger(CFXJSE_Value* pThis, |
CFXJSE_Value* pValue) { |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
int32_t iValue = 0; |
- if (FXJSE_Value_IsArray(pValue)) { |
+ if (CFXJSE_Value::IsArray(pValue)) { |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> newPropertyValue(new CFXJSE_Value(pIsolate)); |
pValue->GetObjectPropertyByIdx(1, propertyValue.get()); |
pValue->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
} else { |
CFX_ByteString propertyStr; |
@@ -6446,12 +6450,12 @@ int32_t CXFA_FM2JSContext::ValueToInteger(CFXJSE_Value* pThis, |
} |
iValue = ValueToInteger(pThis, newPropertyValue.get()); |
return iValue; |
- } else if (FXJSE_Value_IsObject(pValue)) { |
+ } else if (CFXJSE_Value::IsObject(pValue)) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue(new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(pValue, newPropertyValue.get()); |
iValue = ValueToInteger(pThis, newPropertyValue.get()); |
return iValue; |
- } else if (FXJSE_Value_IsUTF8String(pValue)) { |
+ } else if (CFXJSE_Value::IsUTF8String(pValue)) { |
CFX_ByteString szValue; |
pValue->ToString(szValue); |
iValue = FXSYS_atoi(szValue.c_str()); |
@@ -6466,13 +6470,13 @@ FX_FLOAT CXFA_FM2JSContext::ValueToFloat(CFXJSE_Value* pThis, |
CFXJSE_Value* arg) { |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
FX_FLOAT fRet = 0.0f; |
- if (FXJSE_Value_IsArray(arg)) { |
+ if (CFXJSE_Value::IsArray(arg)) { |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> newPropertyValue(new CFXJSE_Value(pIsolate)); |
arg->GetObjectPropertyByIdx(1, propertyValue.get()); |
arg->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
} else { |
CFX_ByteString propertyStr; |
@@ -6481,15 +6485,15 @@ FX_FLOAT CXFA_FM2JSContext::ValueToFloat(CFXJSE_Value* pThis, |
newPropertyValue.get()); |
} |
fRet = ValueToFloat(pThis, newPropertyValue.get()); |
- } else if (FXJSE_Value_IsObject(arg)) { |
+ } else if (CFXJSE_Value::IsObject(arg)) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue(new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(arg, newPropertyValue.get()); |
fRet = ValueToFloat(pThis, newPropertyValue.get()); |
- } else if (FXJSE_Value_IsUTF8String(arg)) { |
+ } else if (CFXJSE_Value::IsUTF8String(arg)) { |
CFX_ByteString bsOutput; |
arg->ToString(bsOutput); |
fRet = (FX_FLOAT)XFA_ByteStringToDouble(bsOutput.AsStringC()); |
- } else if (FXJSE_Value_IsUndefined(arg)) { |
+ } else if (CFXJSE_Value::IsUndefined(arg)) { |
fRet = 0; |
} else { |
fRet = arg->ToFloat(); |
@@ -6502,13 +6506,13 @@ FX_DOUBLE CXFA_FM2JSContext::ValueToDouble(CFXJSE_Value* pThis, |
CFXJSE_Value* arg) { |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
FX_DOUBLE dRet = 0; |
- if (FXJSE_Value_IsArray(arg)) { |
+ if (CFXJSE_Value::IsArray(arg)) { |
std::unique_ptr<CFXJSE_Value> propertyValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
std::unique_ptr<CFXJSE_Value> newPropertyValue(new CFXJSE_Value(pIsolate)); |
arg->GetObjectPropertyByIdx(1, propertyValue.get()); |
arg->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) { |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) { |
GetObjectDefaultValue(jsObjectValue.get(), newPropertyValue.get()); |
} else { |
CFX_ByteString propertyStr; |
@@ -6517,15 +6521,15 @@ FX_DOUBLE CXFA_FM2JSContext::ValueToDouble(CFXJSE_Value* pThis, |
newPropertyValue.get()); |
} |
dRet = ValueToDouble(pThis, newPropertyValue.get()); |
- } else if (FXJSE_Value_IsObject(arg)) { |
+ } else if (CFXJSE_Value::IsObject(arg)) { |
std::unique_ptr<CFXJSE_Value> newPropertyValue(new CFXJSE_Value(pIsolate)); |
GetObjectDefaultValue(arg, newPropertyValue.get()); |
dRet = ValueToDouble(pThis, newPropertyValue.get()); |
- } else if (FXJSE_Value_IsUTF8String(arg)) { |
+ } else if (CFXJSE_Value::IsUTF8String(arg)) { |
CFX_ByteString bsOutput; |
arg->ToString(bsOutput); |
dRet = XFA_ByteStringToDouble(bsOutput.AsStringC()); |
- } else if (FXJSE_Value_IsUndefined(arg)) { |
+ } else if (CFXJSE_Value::IsUndefined(arg)) { |
dRet = 0; |
} else { |
dRet = arg->ToDouble(); |
@@ -6542,7 +6546,7 @@ double CXFA_FM2JSContext::ExtractDouble(CFXJSE_Value* pThis, |
v8::Isolate* pIsolate = ToJSContext(pThis, nullptr)->GetScriptRuntime(); |
*ret = true; |
- if (FXJSE_Value_IsArray(src)) { |
+ if (CFXJSE_Value::IsArray(src)) { |
std::unique_ptr<CFXJSE_Value> lengthValue(new CFXJSE_Value(pIsolate)); |
src->GetObjectProperty("length", lengthValue.get()); |
int32_t iLength = lengthValue->ToInteger(); |
@@ -6555,7 +6559,7 @@ double CXFA_FM2JSContext::ExtractDouble(CFXJSE_Value* pThis, |
std::unique_ptr<CFXJSE_Value> jsObjectValue(new CFXJSE_Value(pIsolate)); |
src->GetObjectPropertyByIdx(1, propertyValue.get()); |
src->GetObjectPropertyByIdx(2, jsObjectValue.get()); |
- if (FXJSE_Value_IsNull(propertyValue.get())) |
+ if (CFXJSE_Value::IsNull(propertyValue.get())) |
return ValueToDouble(pThis, jsObjectValue.get()); |
CFX_ByteString propertyStr; |
@@ -6571,9 +6575,9 @@ double CXFA_FM2JSContext::ExtractDouble(CFXJSE_Value* pThis, |
// static |
void CXFA_FM2JSContext::ValueToUTF8String(CFXJSE_Value* arg, |
CFX_ByteString& szOutputString) { |
- if (FXJSE_Value_IsNull(arg) || FXJSE_Value_IsUndefined(arg)) { |
+ if (CFXJSE_Value::IsNull(arg) || CFXJSE_Value::IsUndefined(arg)) { |
szOutputString = ""; |
- } else if (FXJSE_Value_IsBoolean(arg)) { |
+ } else if (CFXJSE_Value::IsBoolean(arg)) { |
szOutputString = arg->ToBoolean() ? "1" : "0"; |
} else { |
szOutputString = ""; |
@@ -6610,7 +6614,8 @@ CXFA_FM2JSContext::CXFA_FM2JSContext(v8::Isolate* pScriptIsolate, |
CFXJSE_Context* pScriptContext, |
CXFA_Document* pDoc) |
: m_pIsolate(pScriptIsolate), |
- m_pFMClass(FXJSE_DefineClass(pScriptContext, &formcalc_fm2js_descriptor)), |
+ m_pFMClass( |
+ CFXJSE_Class::Create(pScriptContext, &formcalc_fm2js_descriptor)), |
m_pValue(new CFXJSE_Value(pScriptIsolate)), |
m_pDocument(pDoc) { |
m_pValue.get()->SetNull(); |
@@ -6634,5 +6639,5 @@ void CXFA_FM2JSContext::ThrowException(int32_t iStringID, ...) { |
wsMessage.FormatV(wsFormat.c_str(), arg_ptr); |
va_end(arg_ptr); |
FXJSE_ThrowMessage( |
- "", FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); |
+ FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); |
} |