summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-27 12:26:00 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-27 12:26:01 -0700
commit43854a5073602a4613131aa6dbac5f7b9a095bcd (patch)
tree653ebf0cd690e13d1ca9e315ffeb34f8ac85cfbb /xfa/fxfa/fm2js
parentb2f6f9158f54cee1825830c7ed57fe9d89cff26e (diff)
downloadpdfium-43854a5073602a4613131aa6dbac5f7b9a095bcd.tar.xz
Standardize on ASSERT.
There are currently three ways to assert in the code (ASSERT, FXSYS_assert and assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can be overridden if the platform requies and we can pickup the Chromium version if it has already been defined in the build. This does change behaviour. Currently FXSYS_assert is always defined but ASSERT is only defined in debug builds. So, the FXSYS_assert's would fire in Release builds. That will no longer happen. BUG=pdfium:219 Review-Url: https://codereview.chromium.org/1914303003
Diffstat (limited to 'xfa/fxfa/fm2js')
-rw-r--r--xfa/fxfa/fm2js/xfa_fm2jscontext.cpp36
-rw-r--r--xfa/fxfa/fm2js/xfa_simpleexpression.cpp8
2 files changed, 22 insertions, 22 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
index 9ab426d541..852ea1bd6a 100644
--- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
+++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp
@@ -1090,7 +1090,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis,
FXJSE_Value_SetNull(args.GetReturnValue());
} else {
CXFA_Document* pDoc = pContext->GetDocument();
- FXSYS_assert(pDoc);
+ ASSERT(pDoc);
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
CFX_ByteString szArgString;
HValueToUTF8String(argOne, szArgString);
@@ -1110,7 +1110,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis,
int32_t second = uniTime.GetSecond();
int32_t milSecond = uniTime.GetMillisecond();
IFX_Locale* pDefLocale = pMgr->GetDefLocale();
- FXSYS_assert(pDefLocale);
+ ASSERT(pDefLocale);
FX_TIMEZONE tzLocale;
pDefLocale->GetTimeZone(tzLocale);
int32_t mins = hour * 60 + min;
@@ -1578,7 +1578,7 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis,
if (localString.IsEmpty()) {
CXFA_Node* pThisNode =
ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2025,7 +2025,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocale.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2062,7 +2062,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocale.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2102,7 +2102,7 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocale.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2141,7 +2141,7 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocale.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2182,7 +2182,7 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocale.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2364,7 +2364,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocalStr.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -2419,7 +2419,7 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis,
IFX_Locale* pLocale = NULL;
if (szLocalStr.IsEmpty()) {
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
pLocale = widgetData.GetLocal();
} else {
@@ -3287,7 +3287,7 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis,
#ifndef NDEBUG
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
- FXSYS_assert(FXJSE_Value_ToInteger(lengthValue) >= 3);
+ ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3);
FXJSE_Value_Release(lengthValue);
#endif
FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime);
@@ -4376,7 +4376,7 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis,
CXFA_Document* pDoc = pContext->GetDocument();
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
IFX_Locale* pLocale = widgetData.GetLocal();
uint32_t patternType;
@@ -4590,7 +4590,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis,
CXFA_Document* pDoc = pContext->GetDocument();
IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr();
CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject());
- FXSYS_assert(pThisNode);
+ ASSERT(pThisNode);
CXFA_WidgetData widgetData(pThisNode);
IFX_Locale* pLocale = widgetData.GetLocal();
uint32_t patternType;
@@ -6464,7 +6464,7 @@ void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis,
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
- FXSYS_assert(FXJSE_Value_ToInteger(lengthValue) >= 3);
+ ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3);
FXJSE_Value_Release(lengthValue);
#endif
FXJSE_Value_GetObjectPropByIdx(argOne, 2, args.GetReturnValue());
@@ -6489,7 +6489,7 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis,
#ifndef NDEBUG
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
FXJSE_Value_GetObjectProp(argOne, "length", lengthValue);
- FXSYS_assert(FXJSE_Value_ToInteger(lengthValue) >= 3);
+ ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3);
FXJSE_Value_Release(lengthValue);
#endif
FXJSE_HVALUE flagsValue = FXJSE_Value_Create(hruntime);
@@ -6587,7 +6587,7 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis,
CXFA_FM2JSContext* pContext =
(CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL);
FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime();
- FXSYS_assert(index < (uint32_t)args.GetLength());
+ ASSERT(index < (uint32_t)args.GetLength());
FXJSE_HVALUE argIndex = args.GetValue(index);
if (FXJSE_Value_IsArray(argIndex)) {
FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime);
@@ -6875,7 +6875,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis,
dFlags = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent;
} else {
pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL);
- FXSYS_assert(pNode);
+ ASSERT(pNode);
if (bHasNoResolveName) {
CFX_WideString wsName;
if (CXFA_Node* pXFANode = pNode->AsNode()) {
@@ -7215,7 +7215,7 @@ void CXFA_FM2JSContext::Release() {
}
void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) {
IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider();
- FXSYS_assert(pAppProvider);
+ ASSERT(pAppProvider);
CFX_WideString wsFormat;
pAppProvider->LoadString(iStringID, wsFormat);
CFX_WideString wsMessage;
diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
index f652961b6e..468bb3bf89 100644
--- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
+++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp
@@ -332,7 +332,7 @@ void CXFA_FMEqualityExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[NOTEQUALITY];
break;
default:
- FXSYS_assert(FALSE);
+ ASSERT(FALSE);
break;
}
javascript << FX_WSTRC(L"(");
@@ -368,7 +368,7 @@ void CXFA_FMRelationalExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[GREATEREQUAL];
break;
default:
- FXSYS_assert(FALSE);
+ ASSERT(FALSE);
break;
}
javascript << FX_WSTRC(L"(");
@@ -394,7 +394,7 @@ void CXFA_FMAdditiveExpression::ToJavaScript(CFX_WideTextBuf& javascript) {
javascript << gs_lpStrExpFuncName[MINUS];
break;
default:
- FXSYS_assert(FALSE);
+ ASSERT(FALSE);
break;
}
javascript << FX_WSTRC(L"(");
@@ -421,7 +421,7 @@ void CXFA_FMMultiplicativeExpression::ToJavaScript(
javascript << gs_lpStrExpFuncName[DIVIDE];
break;
default:
- FXSYS_assert(FALSE);
+ ASSERT(FALSE);
break;
}
javascript << FX_WSTRC(L"(");