| Index: xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
|
| diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
|
| index ec9e25edddcbf8237293f9992dbaf25bbcd2a206..4733cc910616349a8543f480dc79d76fa021e936 100644
|
| --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
|
| +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
|
| @@ -501,8 +501,8 @@ void CXFA_FM2JSContext::Abs(CFXJSE_Value* pThis,
|
| const CFX_ByteStringC& szFuncName,
|
| CFXJSE_Arguments& args) {
|
| if (args.GetLength() != 1) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Abs");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Abs");
|
| return;
|
| }
|
|
|
| @@ -598,8 +598,8 @@ void CXFA_FM2JSContext::Ceil(CFXJSE_Value* pThis,
|
| const CFX_ByteStringC& szFuncName,
|
| CFXJSE_Arguments& args) {
|
| if (args.GetLength() != 1) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Ceil");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Ceil");
|
| return;
|
| }
|
|
|
| @@ -631,7 +631,7 @@ void CXFA_FM2JSContext::Count(CFXJSE_Value* pThis,
|
|
|
| int32_t iLength = FXJSE_Value_ToInteger(lengthValue.get());
|
| if (iLength <= 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| return;
|
| }
|
|
|
| @@ -679,8 +679,8 @@ void CXFA_FM2JSContext::Floor(CFXJSE_Value* pThis,
|
| const CFX_ByteStringC& szFuncName,
|
| CFXJSE_Arguments& args) {
|
| if (args.GetLength() != 1) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Floor");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Floor");
|
| return;
|
| }
|
|
|
| @@ -712,7 +712,7 @@ void CXFA_FM2JSContext::Max(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectProp(argValue.get(), "length", lengthValue.get());
|
| int32_t iLength = FXJSE_Value_ToInteger(lengthValue.get());
|
| if (iLength <= 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| return;
|
| }
|
|
|
| @@ -793,7 +793,7 @@ void CXFA_FM2JSContext::Min(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectProp(argValue.get(), "length", lengthValue.get());
|
| int32_t iLength = FXJSE_Value_ToInteger(lengthValue.get());
|
| if (iLength <= 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| return;
|
| }
|
|
|
| @@ -863,8 +863,7 @@ void CXFA_FM2JSContext::Mod(CFXJSE_Value* pThis,
|
| CXFA_FM2JSContext* pContext = pThis->ToJSContext(nullptr);
|
| v8::Isolate* pIsolate = pContext->GetScriptRuntime();
|
| if (args.GetLength() != 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Mod");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Mod");
|
| return;
|
| }
|
|
|
| @@ -882,7 +881,7 @@ void CXFA_FM2JSContext::Mod(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectProp(argOne.get(), "length", lengthValue.get());
|
| int32_t iLength = FXJSE_Value_ToInteger(lengthValue.get());
|
| if (iLength <= 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| return;
|
| }
|
|
|
| @@ -910,7 +909,7 @@ void CXFA_FM2JSContext::Mod(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectProp(argTwo.get(), "length", lengthValue.get());
|
| int32_t iLength = FXJSE_Value_ToInteger(lengthValue.get());
|
| if (iLength <= 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| return;
|
| }
|
|
|
| @@ -934,7 +933,7 @@ void CXFA_FM2JSContext::Mod(CFXJSE_Value* pThis,
|
| }
|
|
|
| if (dDividor == 0) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO);
|
| + pContext->Throw(XFA_IDS_DIVIDE_ZERO);
|
| return;
|
| }
|
|
|
| @@ -952,8 +951,7 @@ void CXFA_FM2JSContext::Round(CFXJSE_Value* pThis,
|
| uint8_t uPrecision = 0;
|
|
|
| if (argc != 1 && argc != 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Round");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Round");
|
| return;
|
| }
|
|
|
| @@ -1074,7 +1072,7 @@ void CXFA_FM2JSContext::Sum(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectProp(argValue.get(), "length", lengthValue.get());
|
| int32_t iLength = FXJSE_Value_ToInteger(lengthValue.get());
|
| if (iLength <= 2) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| return;
|
| }
|
|
|
| @@ -1137,8 +1135,8 @@ void CXFA_FM2JSContext::Date(CFXJSE_Value* pThis,
|
| const CFX_ByteStringC& szFuncName,
|
| CFXJSE_Arguments& args) {
|
| if (args.GetLength() != 0) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Date");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Date");
|
| return;
|
| }
|
|
|
| @@ -1164,8 +1162,8 @@ void CXFA_FM2JSContext::Date2Num(CFXJSE_Value* pThis,
|
| CFXJSE_Arguments& args) {
|
| int32_t argc = args.GetLength();
|
| if ((argc <= 0) || (argc >= 4)) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Date2Num");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Date2Num");
|
| return;
|
| }
|
|
|
| @@ -1215,8 +1213,8 @@ void CXFA_FM2JSContext::DateFmt(CFXJSE_Value* pThis,
|
| CFXJSE_Arguments& args) {
|
| int32_t argc = args.GetLength();
|
| if (argc >= 3) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Date2Num");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Date2Num");
|
| return;
|
| }
|
|
|
| @@ -1256,8 +1254,8 @@ void CXFA_FM2JSContext::IsoDate2Num(CFXJSE_Value* pThis,
|
| const CFX_ByteStringC& szFuncName,
|
| CFXJSE_Arguments& args) {
|
| if (args.GetLength() != 1) {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"IsoDate2Num");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"IsoDate2Num");
|
| return;
|
| }
|
|
|
| @@ -1279,8 +1277,7 @@ void CXFA_FM2JSContext::IsoTime2Num(CFXJSE_Value* pThis,
|
| CFXJSE_Arguments& args) {
|
| CXFA_FM2JSContext* pContext = pThis->ToJSContext(nullptr);
|
| if (args.GetLength() != 1) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"IsoTime2Num");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"IsoTime2Num");
|
| return;
|
| }
|
|
|
| @@ -1369,8 +1366,8 @@ void CXFA_FM2JSContext::LocalDateFmt(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"LocalDateFmt");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"LocalDateFmt");
|
| }
|
| }
|
|
|
| @@ -1412,8 +1409,8 @@ void CXFA_FM2JSContext::LocalTimeFmt(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"LocalTimeFmt");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"LocalTimeFmt");
|
| }
|
| }
|
|
|
| @@ -1559,8 +1556,8 @@ void CXFA_FM2JSContext::Num2Date(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Num2Date");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Num2Date");
|
| }
|
| }
|
|
|
| @@ -1613,8 +1610,8 @@ void CXFA_FM2JSContext::Num2GMTime(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Num2GMTime");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Num2GMTime");
|
| }
|
| }
|
|
|
| @@ -1667,8 +1664,8 @@ void CXFA_FM2JSContext::Num2Time(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Num2Time");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Num2Time");
|
| }
|
| }
|
|
|
| @@ -1686,8 +1683,8 @@ void CXFA_FM2JSContext::Time(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(),
|
| ((iGMHour * 3600 + iGMMin * 60 + iGMSec) * 1000));
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Time");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Time");
|
| }
|
| }
|
|
|
| @@ -1780,8 +1777,8 @@ void CXFA_FM2JSContext::Time2Num(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Time2Num");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Time2Num");
|
| }
|
| }
|
|
|
| @@ -1823,8 +1820,8 @@ void CXFA_FM2JSContext::TimeFmt(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"TimeFmt");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"TimeFmt");
|
| }
|
| }
|
|
|
| @@ -2626,7 +2623,7 @@ void CXFA_FM2JSContext::Apr(CFXJSE_Value* pThis,
|
| nPeriods = ValueToDouble(pThis, argThree.get());
|
| bFlags = ((nPrincipal <= 0) || (nPayment <= 0) || (nPeriods <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FX_DOUBLE r =
|
| 2 * (nPeriods * nPayment - nPrincipal) / (nPeriods * nPrincipal);
|
| @@ -2661,8 +2658,7 @@ void CXFA_FM2JSContext::Apr(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Apr");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Apr");
|
| }
|
| }
|
|
|
| @@ -2690,7 +2686,7 @@ void CXFA_FM2JSContext::CTerm(CFXJSE_Value* pThis,
|
| nInitAmount = ValueToFloat(pThis, argThree.get());
|
| bFlags = ((nRate <= 0) || (nFutureValue <= 0) || (nInitAmount <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FXJSE_Value_SetFloat(args.GetReturnValue(),
|
| FXSYS_log((FX_FLOAT)(nFutureValue / nInitAmount)) /
|
| @@ -2698,8 +2694,7 @@ void CXFA_FM2JSContext::CTerm(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"CTerm");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"CTerm");
|
| }
|
| }
|
|
|
| @@ -2727,7 +2722,7 @@ void CXFA_FM2JSContext::FV(CFXJSE_Value* pThis,
|
| nPeriod = ValueToDouble(pThis, argThree.get());
|
| bFlags = ((nRate < 0) || (nPeriod <= 0) || (nAmount <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FX_DOUBLE dResult = 0;
|
| if (!nRate) {
|
| @@ -2743,8 +2738,7 @@ void CXFA_FM2JSContext::FV(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"FV");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"FV");
|
| }
|
| }
|
|
|
| @@ -2781,7 +2775,7 @@ void CXFA_FM2JSContext::IPmt(CFXJSE_Value* pThis,
|
| bFlags = ((nPrincpalAmount <= 0) || (nRate <= 0) || (nPayment <= 0) ||
|
| (nFirstMonth < 0) || (nNumberOfMonths < 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FX_FLOAT fResult = 0;
|
| FX_FLOAT nRateOfMonth = nRate / 12;
|
| @@ -2814,8 +2808,7 @@ void CXFA_FM2JSContext::IPmt(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"IPmt");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"IPmt");
|
| }
|
| }
|
|
|
| @@ -2838,7 +2831,7 @@ void CXFA_FM2JSContext::NPV(CFXJSE_Value* pThis,
|
| FX_DOUBLE nRate = 0;
|
| nRate = ValueToDouble(pThis, argValues[0].get());
|
| if (nRate <= 0) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FX_DOUBLE* pData = FX_Alloc(FX_DOUBLE, argc - 1);
|
| for (int32_t i = 1; i < argc; i++) {
|
| @@ -2862,8 +2855,7 @@ void CXFA_FM2JSContext::NPV(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"NPV");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"NPV");
|
| }
|
| }
|
|
|
| @@ -2891,7 +2883,7 @@ void CXFA_FM2JSContext::Pmt(CFXJSE_Value* pThis,
|
| nPeriods = ValueToFloat(pThis, argThree.get());
|
| bFlags = ((nPrincipal <= 0) || (nRate <= 0) || (nPeriods <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FX_FLOAT nSum = 0;
|
| FX_FLOAT nTmp = 1 + nRate;
|
| @@ -2904,8 +2896,7 @@ void CXFA_FM2JSContext::Pmt(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Pmt");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Pmt");
|
| }
|
| }
|
|
|
| @@ -2942,7 +2933,7 @@ void CXFA_FM2JSContext::PPmt(CFXJSE_Value* pThis,
|
| bFlags = ((nPrincpalAmount <= 0) || (nRate <= 0) || (nPayment <= 0) ||
|
| (nFirstMonth < 0) || (nNumberOfMonths < 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| int32_t iEnd = (int32_t)(nFirstMonth + nNumberOfMonths - 1);
|
| FX_FLOAT nSum = 0;
|
| @@ -2971,13 +2962,12 @@ void CXFA_FM2JSContext::PPmt(CFXJSE_Value* pThis,
|
| }
|
| FXJSE_Value_SetFloat(args.GetReturnValue(), nSum);
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| }
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"PPmt");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"PPmt");
|
| }
|
| }
|
|
|
| @@ -3005,7 +2995,7 @@ void CXFA_FM2JSContext::PV(CFXJSE_Value* pThis,
|
| nPeriod = ValueToDouble(pThis, argThree.get());
|
| bFlags = ((nAmount <= 0) || (nRate < 0) || (nPeriod <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FX_DOUBLE nTemp = 1;
|
| for (int32_t i = 0; i < nPeriod; ++i) {
|
| @@ -3017,8 +3007,7 @@ void CXFA_FM2JSContext::PV(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"PV");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"PV");
|
| }
|
| }
|
|
|
| @@ -3046,7 +3035,7 @@ void CXFA_FM2JSContext::Rate(CFXJSE_Value* pThis,
|
| nTotalNumber = ValueToFloat(pThis, argThree.get());
|
| bFlags = ((nFuture <= 0) || (nPresent < 0) || (nTotalNumber <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FXJSE_Value_SetFloat(args.GetReturnValue(),
|
| (FXSYS_pow((FX_FLOAT)(nFuture / nPresent),
|
| @@ -3055,8 +3044,7 @@ void CXFA_FM2JSContext::Rate(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Rate");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Rate");
|
| }
|
| }
|
|
|
| @@ -3084,7 +3072,7 @@ void CXFA_FM2JSContext::Term(CFXJSE_Value* pThis,
|
| nFuture = ValueToFloat(pThis, argThree.get());
|
| bFlags = ((nMount <= 0) || (nRate <= 0) || (nFuture <= 0));
|
| if (bFlags) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| FXJSE_Value_SetFloat(
|
| args.GetReturnValue(),
|
| @@ -3093,8 +3081,7 @@ void CXFA_FM2JSContext::Term(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Term");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Term");
|
| }
|
| }
|
|
|
| @@ -3178,8 +3165,7 @@ void CXFA_FM2JSContext::Choose(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Choose");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Choose");
|
| }
|
| }
|
|
|
| @@ -3192,8 +3178,8 @@ void CXFA_FM2JSContext::Exists(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(),
|
| FXJSE_Value_IsObject(argOne.get()));
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Exists");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Exists");
|
| }
|
| }
|
|
|
| @@ -3215,8 +3201,8 @@ void CXFA_FM2JSContext::HasValue(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), FALSE);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"HasValue");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"HasValue");
|
| }
|
| }
|
|
|
| @@ -3242,8 +3228,8 @@ void CXFA_FM2JSContext::Oneof(CFXJSE_Value* pThis,
|
| }
|
| FX_Free(parametersValue);
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Oneof");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Oneof");
|
| }
|
| }
|
|
|
| @@ -3279,8 +3265,8 @@ void CXFA_FM2JSContext::Within(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Within");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Within");
|
| }
|
| }
|
|
|
| @@ -3298,8 +3284,8 @@ void CXFA_FM2JSContext::If(CFXJSE_Value* pThis,
|
| FXJSE_Value_Set(args.GetReturnValue(),
|
| bCondition ? argFirstValue.get() : argSecondValue.get());
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"If");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"If");
|
| }
|
| }
|
|
|
| @@ -3334,8 +3320,7 @@ void CXFA_FM2JSContext::Eval(CFXJSE_Value* pThis,
|
| FXJSE_Context_Release(pTempContext);
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Eval");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Eval");
|
| }
|
| }
|
|
|
| @@ -3370,7 +3355,7 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectPropByIdx(argOne.get(), 1, propertyValue.get());
|
| FXJSE_Value_GetObjectPropByIdx(argOne.get(), 2, jsObjectValue.get());
|
| if (FXJSE_Value_IsNull(jsObjectValue.get())) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else if (FXJSE_Value_IsNull(propertyValue.get()) &&
|
| (!FXJSE_Value_IsNull(jsObjectValue.get()))) {
|
| CFXJSE_Value* rgValues[3];
|
| @@ -3385,7 +3370,7 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis,
|
| delete rgValues[i];
|
|
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| }
|
| } else if (FXJSE_Value_IsObject(argOne.get())) {
|
| CFXJSE_Value* rgValues[3];
|
| @@ -3404,11 +3389,10 @@ void CXFA_FM2JSContext::Ref(CFXJSE_Value* pThis,
|
| FXJSE_Value_IsNumber(argOne.get())) {
|
| FXJSE_Value_Set(args.GetReturnValue(), argOne.get());
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Ref");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Ref");
|
| }
|
| }
|
|
|
| @@ -3523,8 +3507,8 @@ void CXFA_FM2JSContext::UnitType(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"UnitType");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"UnitType");
|
| }
|
| }
|
|
|
| @@ -3679,8 +3663,8 @@ void CXFA_FM2JSContext::UnitValue(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"UnitValue");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"UnitValue");
|
| }
|
| }
|
|
|
| @@ -3706,8 +3690,8 @@ void CXFA_FM2JSContext::At(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"At");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"At");
|
| }
|
| }
|
|
|
| @@ -3737,8 +3721,8 @@ void CXFA_FM2JSContext::Concat(CFXJSE_Value* pThis,
|
| resultString.AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Concat");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Concat");
|
| }
|
| }
|
|
|
| @@ -3779,8 +3763,8 @@ void CXFA_FM2JSContext::Decode(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Decode");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Decode");
|
| }
|
| }
|
|
|
| @@ -4053,8 +4037,8 @@ void CXFA_FM2JSContext::Encode(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultBuf.AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Encode");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Encode");
|
| }
|
| }
|
|
|
| @@ -4429,8 +4413,7 @@ void CXFA_FM2JSContext::Format(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Format");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Format");
|
| }
|
| }
|
|
|
| @@ -4459,8 +4442,8 @@ void CXFA_FM2JSContext::Left(CFXJSE_Value* pThis,
|
| sourceString.Left(count).AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Left");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Left");
|
| }
|
| }
|
|
|
| @@ -4478,8 +4461,8 @@ void CXFA_FM2JSContext::Len(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), sourceString.GetLength());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Len");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Len");
|
| }
|
| }
|
|
|
| @@ -4521,8 +4504,8 @@ void CXFA_FM2JSContext::Lower(CFXJSE_Value* pThis,
|
| .AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Lower");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Lower");
|
| }
|
| }
|
|
|
| @@ -4542,8 +4525,8 @@ void CXFA_FM2JSContext::Ltrim(CFXJSE_Value* pThis,
|
| sourceString.AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Ltrim");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Ltrim");
|
| }
|
| }
|
|
|
| @@ -4682,8 +4665,7 @@ void CXFA_FM2JSContext::Parse(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Parse");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Parse");
|
| }
|
| }
|
|
|
| @@ -4742,8 +4724,8 @@ void CXFA_FM2JSContext::Replace(CFXJSE_Value* pThis,
|
| resultString.AppendChar(0);
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC());
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Replace");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Replace");
|
| }
|
| }
|
|
|
| @@ -4772,8 +4754,8 @@ void CXFA_FM2JSContext::Right(CFXJSE_Value* pThis,
|
| sourceString.Right(count).AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Right");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Right");
|
| }
|
| }
|
|
|
| @@ -4793,8 +4775,8 @@ void CXFA_FM2JSContext::Rtrim(CFXJSE_Value* pThis,
|
| sourceString.AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Rtrim");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Rtrim");
|
| }
|
| }
|
|
|
| @@ -4820,8 +4802,8 @@ void CXFA_FM2JSContext::Space(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), spaceString.AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Space");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Space");
|
| }
|
| }
|
|
|
| @@ -4938,8 +4920,8 @@ void CXFA_FM2JSContext::Str(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Str");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Str");
|
| }
|
| }
|
|
|
| @@ -4995,8 +4977,8 @@ void CXFA_FM2JSContext::Stuff(CFXJSE_Value* pThis,
|
| resultString.AppendChar(0);
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), resultString.AsStringC());
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Stuff");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Stuff");
|
| }
|
| }
|
|
|
| @@ -5038,8 +5020,8 @@ void CXFA_FM2JSContext::Substr(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Substr");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Substr");
|
| }
|
| }
|
|
|
| @@ -5060,8 +5042,8 @@ void CXFA_FM2JSContext::Uuid(CFXJSE_Value* pThis,
|
| FX_GUID_ToString(&guid, bsUId, iNum);
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), bsUId.AsStringC());
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Uuid");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Uuid");
|
| }
|
| }
|
|
|
| @@ -5103,8 +5085,8 @@ void CXFA_FM2JSContext::Upper(CFXJSE_Value* pThis,
|
| .AsStringC());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Upper");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"Upper");
|
| }
|
| }
|
|
|
| @@ -5156,8 +5138,8 @@ void CXFA_FM2JSContext::WordNum(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetNull(args.GetReturnValue());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"WordNum");
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| + L"WordNum");
|
| }
|
| }
|
|
|
| @@ -5390,8 +5372,7 @@ void CXFA_FM2JSContext::Get(CFXJSE_Value* pThis,
|
| pFile->Release();
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Get");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Get");
|
| }
|
| }
|
|
|
| @@ -5445,11 +5426,10 @@ void CXFA_FM2JSContext::Post(CFXJSE_Value* pThis,
|
| FX_UTF8Encode(decodedResponse.c_str(), decodedResponse.GetLength())
|
| .AsStringC());
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY);
|
| + pContext->Throw(XFA_IDS_SERVER_DENY);
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Post");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Post");
|
| }
|
| }
|
|
|
| @@ -5487,11 +5467,10 @@ void CXFA_FM2JSContext::Put(CFXJSE_Value* pThis,
|
| if (bFlags) {
|
| FXJSE_Value_SetUTF8String(args.GetReturnValue(), "");
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_SERVER_DENY);
|
| + pContext->Throw(XFA_IDS_SERVER_DENY);
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Put");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Put");
|
| }
|
| }
|
|
|
| @@ -5517,7 +5496,7 @@ void CXFA_FM2JSContext::assign_value_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_GetObjectPropByIdx(lValue.get(), i, jsObjectValue.get());
|
| bSetStatus = SetObjectDefaultValue(jsObjectValue.get(), rValue.get());
|
| if (!bSetStatus) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_NOT_DEFAUL_VALUE);
|
| + pContext->Throw(XFA_IDS_NOT_DEFAUL_VALUE);
|
| break;
|
| }
|
| }
|
| @@ -5533,12 +5512,12 @@ void CXFA_FM2JSContext::assign_value_operator(CFXJSE_Value* pThis,
|
| } else if (FXJSE_Value_IsObject(lValue.get())) {
|
| bSetStatus = SetObjectDefaultValue(lValue.get(), rValue.get());
|
| if (!bSetStatus) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_NOT_DEFAUL_VALUE);
|
| + pContext->Throw(XFA_IDS_NOT_DEFAUL_VALUE);
|
| }
|
| }
|
| FXJSE_Value_Set(args.GetReturnValue(), rValue.get());
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5558,8 +5537,7 @@ void CXFA_FM2JSContext::logical_or_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first || second) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5579,8 +5557,7 @@ void CXFA_FM2JSContext::logical_and_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first && second) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5617,8 +5594,7 @@ void CXFA_FM2JSContext::equality_operator(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5654,8 +5630,7 @@ void CXFA_FM2JSContext::notequality_operator(CFXJSE_Value* pThis,
|
| }
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5713,8 +5688,7 @@ void CXFA_FM2JSContext::less_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first < second) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5747,8 +5721,7 @@ void CXFA_FM2JSContext::lessequal_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first <= second) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5777,8 +5750,7 @@ void CXFA_FM2JSContext::greater_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first > second) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5811,8 +5783,7 @@ void CXFA_FM2JSContext::greaterequal_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first >= second) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5832,8 +5803,7 @@ void CXFA_FM2JSContext::plus_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetDouble(args.GetReturnValue(), first + second);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5853,8 +5823,7 @@ void CXFA_FM2JSContext::minus_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetDouble(args.GetReturnValue(), first - second);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5874,8 +5843,7 @@ void CXFA_FM2JSContext::multiple_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetDouble(args.GetReturnValue(), first * second);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5894,13 +5862,13 @@ void CXFA_FM2JSContext::divide_operator(CFXJSE_Value* pThis,
|
| FX_DOUBLE first = ValueToDouble(pThis, argFirst.get());
|
| FX_DOUBLE second = ValueToDouble(pThis, argSecond.get());
|
| if (second == 0.0) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_DIVIDE_ZERO);
|
| + pContext->Throw(XFA_IDS_DIVIDE_ZERO);
|
| } else {
|
| FXJSE_Value_SetDouble(args.GetReturnValue(), first / second);
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5917,8 +5885,7 @@ void CXFA_FM2JSContext::positive_operator(CFXJSE_Value* pThis,
|
| 0.0 + ValueToDouble(pThis, argOne.get()));
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5935,8 +5902,7 @@ void CXFA_FM2JSContext::negative_operator(CFXJSE_Value* pThis,
|
| 0.0 - ValueToDouble(pThis, argOne.get()));
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -5953,8 +5919,7 @@ void CXFA_FM2JSContext::logical_not_operator(CFXJSE_Value* pThis,
|
| FXJSE_Value_SetInteger(args.GetReturnValue(), (first == 0.0) ? 1 : 0);
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -6033,9 +5998,8 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis,
|
| CFX_WideString::FromUTF8(szName.AsStringC());
|
| CFX_WideString wsSomExpression =
|
| CFX_WideString::FromUTF8(szSomExp.AsStringC());
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| - wsPropertyName.c_str(),
|
| - wsSomExpression.c_str());
|
| + pContext->Throw(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| + wsPropertyName.c_str(), wsSomExpression.c_str());
|
| }
|
| for (int32_t i = 0; i < iLength - 2; i++) {
|
| for (int32_t j = 0; j < iSizes[i]; j++)
|
| @@ -6096,13 +6060,12 @@ void CXFA_FM2JSContext::dot_accessor(CFXJSE_Value* pThis,
|
| CFX_WideString::FromUTF8(szName.AsStringC());
|
| CFX_WideString wsSomExpression =
|
| CFX_WideString::FromUTF8(szSomExp.AsStringC());
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| - wsPropertyName.c_str(),
|
| - wsSomExpression.c_str());
|
| + pContext->Throw(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| + wsPropertyName.c_str(), wsSomExpression.c_str());
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -6178,9 +6141,8 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis,
|
| CFX_WideString::FromUTF8(szName.AsStringC());
|
| CFX_WideString wsSomExpression =
|
| CFX_WideString::FromUTF8(szSomExp.AsStringC());
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| - wsPropertyName.c_str(),
|
| - wsSomExpression.c_str());
|
| + pContext->Throw(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| + wsPropertyName.c_str(), wsSomExpression.c_str());
|
| }
|
| for (int32_t i = 0; i < iLength - 2; i++) {
|
| for (int32_t j = 0; j < iSizes[i]; j++)
|
| @@ -6239,13 +6201,12 @@ void CXFA_FM2JSContext::dotdot_accessor(CFXJSE_Value* pThis,
|
| CFX_WideString::FromUTF8(szName.AsStringC());
|
| CFX_WideString wsSomExpression =
|
| CFX_WideString::FromUTF8(szSomExp.AsStringC());
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| - wsPropertyName.c_str(),
|
| - wsSomExpression.c_str());
|
| + pContext->Throw(XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT,
|
| + wsPropertyName.c_str(), wsSomExpression.c_str());
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -6259,7 +6220,7 @@ void CXFA_FM2JSContext::eval_translation(CFXJSE_Value* pThis,
|
| CFX_ByteString argString;
|
| ValueToUTF8String(argOne.get(), argString);
|
| if (argString.IsEmpty()) {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_ARGUMENT_MISMATCH);
|
| + pContext->Throw(XFA_IDS_ARGUMENT_MISMATCH);
|
| } else {
|
| CFX_WideString scriptString =
|
| CFX_WideString::FromUTF8(argString.AsStringC());
|
| @@ -6274,12 +6235,11 @@ void CXFA_FM2JSContext::eval_translation(CFXJSE_Value* pThis,
|
| FX_UTF8Encode(javaScript.c_str(), javaScript.GetLength())
|
| .AsStringC());
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD,
|
| - L"Eval");
|
| + pContext->Throw(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"Eval");
|
| }
|
| }
|
|
|
| @@ -6336,7 +6296,7 @@ void CXFA_FM2JSContext::get_fm_value(CFXJSE_Value* pThis,
|
| FXJSE_Value_Set(args.GetReturnValue(), argOne.get());
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -6358,8 +6318,7 @@ void CXFA_FM2JSContext::get_fm_jsobj(CFXJSE_Value* pThis,
|
| FXJSE_Value_Set(args.GetReturnValue(), argOne.get());
|
| }
|
| } else {
|
| - pThis->ToJSContext(nullptr)->ThrowScriptErrorMessage(
|
| - XFA_IDS_COMPILER_ERROR);
|
| + pThis->ToJSContext(nullptr)->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -6397,7 +6356,7 @@ void CXFA_FM2JSContext::fm_var_filter(CFXJSE_Value* pThis,
|
| if (!FXJSE_Value_IsNull(objectValue.get())) {
|
| FXJSE_Value_Set(args.GetReturnValue(), argOne.get());
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| } else {
|
| std::unique_ptr<CFXJSE_Value> simpleValue =
|
| @@ -6410,7 +6369,7 @@ void CXFA_FM2JSContext::fm_var_filter(CFXJSE_Value* pThis,
|
| FXJSE_Value_Set(args.GetReturnValue(), simpleValue.get());
|
| }
|
| } else {
|
| - pContext->ThrowScriptErrorMessage(XFA_IDS_COMPILER_ERROR);
|
| + pContext->Throw(XFA_IDS_COMPILER_ERROR);
|
| }
|
| }
|
|
|
| @@ -6985,7 +6944,7 @@ void CXFA_FM2JSContext::GlobalPropertyGetter(CFXJSE_Value* pValue) {
|
| FXJSE_Value_Set(pValue, m_pValue.get());
|
| }
|
|
|
| -void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) {
|
| +void CXFA_FM2JSContext::Throw(int32_t iStringID, ...) {
|
| IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider();
|
| ASSERT(pAppProvider);
|
| CFX_WideString wsFormat;
|
|
|