[code health] Replace ASSERT() with DCHECK() in fxjs/

Bug: pdfium:1596
Change-Id: Ia22599cc8b0a4be89851774a9cbe896eb589bc1b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/77690
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Daniel Hosseinian <dhoss@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
diff --git a/fxjs/cfxjs_engine.cpp b/fxjs/cfxjs_engine.cpp
index a4eb93e..2d34cc1 100644
--- a/fxjs/cfxjs_engine.cpp
+++ b/fxjs/cfxjs_engine.cpp
@@ -89,7 +89,7 @@
   ~V8TemplateMap() = default;
 
   void SetAndMakeWeak(WeakCallbackDataType* key, v8::Local<v8::Object> handle) {
-    ASSERT(!m_map.Contains(key));
+    DCHECK(!m_map.Contains(key));
 
     // Inserting an object into a GlobalValueMap with the appropriate traits
     // has the side-effect of making the object weak deep in the guts of V8,
@@ -169,7 +169,7 @@
       return;
     }
     v8::Local<v8::Object> holder = info.Holder();
-    ASSERT(holder->InternalFieldCount() == 2);
+    DCHECK(holder->InternalFieldCount() == 2);
     holder->SetAlignedPointerInInternalField(0, nullptr);
     holder->SetAlignedPointerInInternalField(1, nullptr);
   }
@@ -276,8 +276,8 @@
 
 void FXJS_Initialize(unsigned int embedderDataSlot, v8::Isolate* pIsolate) {
   if (g_isolate) {
-    ASSERT(g_embedderDataSlot == embedderDataSlot);
-    ASSERT(g_isolate == pIsolate);
+    DCHECK(g_embedderDataSlot == embedderDataSlot);
+    DCHECK(g_isolate == pIsolate);
     return;
   }
   g_embedderDataSlot = embedderDataSlot;
@@ -285,7 +285,7 @@
 }
 
 void FXJS_Release() {
-  ASSERT(!g_isolate || g_isolate_ref_count == 0);
+  DCHECK(!g_isolate || g_isolate_ref_count == 0);
   delete g_DefaultGlobalObjectTemplate;
   g_DefaultGlobalObjectTemplate = nullptr;
   g_isolate = nullptr;
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index 5c5a10b..573a114 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -29,6 +29,7 @@
 #include "fxjs/cjs_field.h"
 #include "fxjs/cjs_icon.h"
 #include "fxjs/js_resources.h"
+#include "third_party/base/check.h"
 
 const JSPropertySpec CJS_Document::PropertySpecs[] = {
     {"ADBE", get_ADBE_static, set_ADBE_static},
@@ -484,7 +485,7 @@
       continue;
 
     IPDF_Page* pPage = pWidget->GetPage();
-    ASSERT(pPage);
+    DCHECK(pPage);
 
     // If there is currently no pageview associated with the page being used
     // do not create one. We may be in the process of tearing down the document
diff --git a/fxjs/cjs_event_context.cpp b/fxjs/cjs_event_context.cpp
index b308c47..3cec037 100644
--- a/fxjs/cjs_event_context.cpp
+++ b/fxjs/cjs_event_context.cpp
@@ -12,11 +12,12 @@
 #include "fxjs/cjs_runtime.h"
 #include "fxjs/js_define.h"
 #include "fxjs/js_resources.h"
+#include "third_party/base/check.h"
 
 CJS_EventContext::CJS_EventContext(CJS_Runtime* pRuntime)
     : m_pRuntime(pRuntime),
       m_pEventRecorder(std::make_unique<CJS_EventRecorder>()) {
-  ASSERT(pRuntime);
+  DCHECK(pRuntime);
 }
 
 CJS_EventContext::~CJS_EventContext() = default;
@@ -40,7 +41,7 @@
   AutoRestorer<bool> restorer(&m_bBusy);
   m_bBusy = true;
 
-  ASSERT(m_pEventRecorder->IsValid());
+  DCHECK(m_pEventRecorder->IsValid());
   CJS_Runtime::FieldEvent event(m_pEventRecorder->TargetName(),
                                 m_pEventRecorder->EventType());
   if (!m_pRuntime->AddEventToSet(event)) {
diff --git a/fxjs/cjs_eventrecorder.cpp b/fxjs/cjs_eventrecorder.cpp
index 59febf0..23429a6 100644
--- a/fxjs/cjs_eventrecorder.cpp
+++ b/fxjs/cjs_eventrecorder.cpp
@@ -8,6 +8,7 @@
 
 #include "core/fpdfdoc/cpdf_bookmark.h"
 #include "core/fpdfdoc/cpdf_formfield.h"
+#include "third_party/base/check.h"
 
 CJS_EventRecorder::CJS_EventRecorder() = default;
 
@@ -123,7 +124,7 @@
                                       bool bShift,
                                       CPDF_FormField* pTarget,
                                       WideString* pValue) {
-  ASSERT(pValue);
+  DCHECK(pValue);
   Initialize(JET_FIELD_FOCUS);
 
   m_bModifier = bModifier;
@@ -136,7 +137,7 @@
                                      bool bShift,
                                      CPDF_FormField* pTarget,
                                      WideString* pValue) {
-  ASSERT(pValue);
+  DCHECK(pValue);
   Initialize(JET_FIELD_BLUR);
 
   m_bModifier = bModifier;
@@ -157,10 +158,10 @@
                                           bool bWillCommit,
                                           bool bFieldFull,
                                           bool* pbRc) {
-  ASSERT(pValue);
-  ASSERT(pbRc);
-  ASSERT(pSelStart);
-  ASSERT(pSelEnd);
+  DCHECK(pValue);
+  DCHECK(pbRc);
+  DCHECK(pSelStart);
+  DCHECK(pSelEnd);
 
   Initialize(JET_FIELD_KEYSTROKE);
 
@@ -187,8 +188,8 @@
                                          CPDF_FormField* pTarget,
                                          WideString* pValue,
                                          bool* pbRc) {
-  ASSERT(pValue);
-  ASSERT(pbRc);
+  DCHECK(pValue);
+  DCHECK(pbRc);
 
   Initialize(JET_FIELD_VALIDATE);
 
@@ -206,8 +207,8 @@
                                           CPDF_FormField* pTarget,
                                           WideString* pValue,
                                           bool* pRc) {
-  ASSERT(pValue);
-  ASSERT(pRc);
+  DCHECK(pValue);
+  DCHECK(pRc);
 
   Initialize(JET_FIELD_CALCULATE);
 
@@ -220,7 +221,7 @@
 
 void CJS_EventRecorder::OnField_Format(CPDF_FormField* pTarget,
                                        WideString* pValue) {
-  ASSERT(pValue);
+  DCHECK(pValue);
   Initialize(JET_FIELD_FORMAT);
 
   m_nCommitKey = 0;
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 806cd31..130d914 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -26,6 +26,7 @@
 #include "fxjs/cjs_icon.h"
 #include "fxjs/fxv8.h"
 #include "fxjs/js_resources.h"
+#include "third_party/base/check.h"
 #include "third_party/base/notreached.h"
 
 namespace {
@@ -102,7 +103,7 @@
                        bool bChangeMark,
                        bool bResetAP,
                        bool bRefresh) {
-  ASSERT(pFormControl);
+  DCHECK(pFormControl);
 
   CPDFSDK_InteractiveForm* pForm = pFormFillEnv->GetInteractiveForm();
   CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
@@ -220,7 +221,7 @@
                     const WideString& swFieldName,
                     int nControlIndex,
                     const ByteString& string) {
-  ASSERT(pFormFillEnv);
+  DCHECK(pFormFillEnv);
 
   BorderStyle nBorderStyle = BorderStyle::kSolid;
   if (string == "solid")
@@ -274,7 +275,7 @@
                             const WideString& swFieldName,
                             int nControlIndex,
                             const std::vector<uint32_t>& array) {
-  ASSERT(pFormFillEnv);
+  DCHECK(pFormFillEnv);
   std::vector<CPDF_FormField*> FieldArray =
       GetFormFieldsForName(pFormFillEnv, swFieldName);
 
@@ -309,7 +310,7 @@
       bool bAnySet = false;
       for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
         CPDF_FormControl* pFormControl = pFormField->GetControl(i);
-        ASSERT(pFormControl);
+        DCHECK(pFormControl);
 
         CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl);
         if (SetWidgetDisplayStatus(pWidget, number))
@@ -353,7 +354,7 @@
       bool bSet = false;
       for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
         CPDF_FormControl* pFormControl = pFormField->GetControl(i);
-        ASSERT(pFormControl);
+        DCHECK(pFormControl);
 
         if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
           if (number != pWidget->GetBorderWidth()) {
@@ -392,7 +393,7 @@
       bool bSet = false;
       for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
         CPDF_FormControl* pFormControl = pFormField->GetControl(i);
-        ASSERT(pFormControl);
+        DCHECK(pFormControl);
 
         if (CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl)) {
           CFX_FloatRect crRect = rect;
@@ -442,7 +443,7 @@
                    const WideString& swFieldName,
                    int nControlIndex,
                    const std::vector<WideString>& strArray) {
-  ASSERT(pFormFillEnv);
+  DCHECK(pFormFillEnv);
   if (strArray.empty())
     return;
 
@@ -659,7 +660,7 @@
 }
 
 CJS_Result CJS_Field::get_alignment(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -685,7 +686,7 @@
 
 CJS_Result CJS_Field::set_alignment(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
@@ -693,7 +694,7 @@
 }
 
 CJS_Result CJS_Field::get_border_style(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -721,7 +722,7 @@
 
 CJS_Result CJS_Field::set_border_style(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
@@ -736,7 +737,7 @@
 }
 
 CJS_Result CJS_Field::get_button_align_x(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -756,14 +757,14 @@
 
 CJS_Result CJS_Field::set_button_align_x(CJS_Runtime* pRuntime,
                                          v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_button_align_y(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -783,14 +784,14 @@
 
 CJS_Result CJS_Field::set_button_align_y(CJS_Runtime* pRuntime,
                                          v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_button_fit_bounds(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -809,14 +810,14 @@
 
 CJS_Result CJS_Field::set_button_fit_bounds(CJS_Runtime* pRuntime,
                                             v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_button_position(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -835,14 +836,14 @@
 
 CJS_Result CJS_Field::set_button_position(CJS_Runtime* pRuntime,
                                           v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kBadObjectError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_button_scale_how(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -861,14 +862,14 @@
 
 CJS_Result CJS_Field::set_button_scale_how(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_button_scale_when(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -900,14 +901,14 @@
 
 CJS_Result CJS_Field::set_button_scale_when(CJS_Runtime* pRuntime,
                                             v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_calc_order_index(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -924,14 +925,14 @@
 
 CJS_Result CJS_Field::set_calc_order_index(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_char_limit(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -945,14 +946,14 @@
 
 CJS_Result CJS_Field::set_char_limit(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_comb(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -966,14 +967,14 @@
 }
 
 CJS_Result CJS_Field::set_comb(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_commit_on_sel_change(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -989,7 +990,7 @@
 
 CJS_Result CJS_Field::set_commit_on_sel_change(CJS_Runtime* pRuntime,
                                                v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1055,7 +1056,7 @@
 }
 
 CJS_Result CJS_Field::get_default_value(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1072,14 +1073,14 @@
 
 CJS_Result CJS_Field::set_default_value(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_do_not_scroll(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1094,14 +1095,14 @@
 
 CJS_Result CJS_Field::set_do_not_scroll(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_do_not_spell_check(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1117,7 +1118,7 @@
 
 CJS_Result CJS_Field::set_do_not_spell_check(CJS_Runtime* pRuntime,
                                              v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1370,7 +1371,7 @@
 }
 
 CJS_Result CJS_Field::get_highlight(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1401,7 +1402,7 @@
 
 CJS_Result CJS_Field::set_highlight(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1442,7 +1443,7 @@
 }
 
 CJS_Result CJS_Field::get_multiline(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1457,14 +1458,14 @@
 
 CJS_Result CJS_Field::set_multiline(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
 }
 
 CJS_Result CJS_Field::get_multiple_selection(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
     return CJS_Result::Failure(JSMessage::kBadObjectError);
@@ -1479,7 +1480,7 @@
 
 CJS_Result CJS_Field::set_multiple_selection(CJS_Runtime* pRuntime,
                                              v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1543,7 +1544,7 @@
 }
 
 CJS_Result CJS_Field::get_password(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1558,7 +1559,7 @@
 
 CJS_Result CJS_Field::set_password(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1755,7 +1756,7 @@
 }
 
 CJS_Result CJS_Field::get_rich_text(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1770,7 +1771,7 @@
 
 CJS_Result CJS_Field::set_rich_text(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1786,7 +1787,7 @@
 }
 
 CJS_Result CJS_Field::get_rotation(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1801,7 +1802,7 @@
 
 CJS_Result CJS_Field::set_rotation(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1864,7 +1865,7 @@
 }
 
 CJS_Result CJS_Field::get_style(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1907,7 +1908,7 @@
 
 CJS_Result CJS_Field::set_style(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -1965,7 +1966,7 @@
 }
 
 CJS_Result CJS_Field::get_text_font(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -1993,7 +1994,7 @@
 
 CJS_Result CJS_Field::set_text_font(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
@@ -2003,7 +2004,7 @@
 }
 
 CJS_Result CJS_Field::get_text_size(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -2021,7 +2022,7 @@
 
 CJS_Result CJS_Field::set_text_size(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -2059,7 +2060,7 @@
 }
 
 CJS_Result CJS_Field::get_user_name(CJS_Runtime* pRuntime) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
@@ -2071,7 +2072,7 @@
 
 CJS_Result CJS_Field::set_user_name(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  ASSERT(m_pFormFillEnv);
+  DCHECK(m_pFormFillEnv);
   if (!m_bCanSet)
     return CJS_Result::Failure(JSMessage::kReadOnlyError);
   return CJS_Result::Success();
@@ -2624,7 +2625,7 @@
 
 void CJS_Field::DoDelay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
                         CJS_DelayData* pData) {
-  ASSERT(pFormFillEnv);
+  DCHECK(pFormFillEnv);
   switch (pData->eProp) {
     case FP_BORDERSTYLE:
       SetBorderStyle(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp
index a557221..11f32f9 100644
--- a/fxjs/cjs_publicmethods.cpp
+++ b/fxjs/cjs_publicmethods.cpp
@@ -34,6 +34,7 @@
 #include "fxjs/fx_date_helpers.h"
 #include "fxjs/js_define.h"
 #include "fxjs/js_resources.h"
+#include "third_party/base/check.h"
 #include "third_party/base/optional.h"
 #include "third_party/base/stl_util.h"
 
@@ -181,7 +182,7 @@
 }
 
 char DigitSeparatorForStyle(int style) {
-  ASSERT(IsStyleWithDigitSeparator(style));
+  DCHECK(IsStyleWithDigitSeparator(style));
   return style == 0 ? ',' : '.';
 }
 
@@ -317,11 +318,11 @@
 v8::Local<v8::Array> CJS_PublicMethods::AF_MakeArrayFromList(
     CJS_Runtime* pRuntime,
     v8::Local<v8::Value> val) {
-  ASSERT(!val.IsEmpty());
+  DCHECK(!val.IsEmpty());
   if (val->IsArray())
     return pRuntime->ToArray(val);
 
-  ASSERT(val->IsString());
+  DCHECK(val->IsString());
   WideString wsStr = pRuntime->ToWideString(val);
   ByteString t = wsStr.ToDefANSI();
   const char* p = t.c_str();
@@ -625,7 +626,7 @@
       iDec2 = 1;
     }
   }
-  ASSERT(iDec2 >= 0);
+  DCHECK(iDec2 >= 0);
 
   // Processing separator style
   if (static_cast<size_t>(iDec2) < strValue.GetLength()) {
diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp
index 443f1a5..b39f698 100644
--- a/fxjs/cjs_runtime.cpp
+++ b/fxjs/cjs_runtime.cpp
@@ -38,6 +38,7 @@
 #include "fxjs/cjs_zoomtype.h"
 #include "fxjs/fxv8.h"
 #include "fxjs/js_define.h"
+#include "third_party/base/check.h"
 
 CJS_Runtime::CJS_Runtime(CPDFSDK_FormFillEnvironment* pFormFillEnv)
     : m_pFormFillEnv(pFormFillEnv) {
@@ -127,7 +128,7 @@
 }
 
 void CJS_Runtime::ReleaseEventContext(IJS_EventContext* pContext) {
-  ASSERT(pContext == m_EventContextArray.back().get());
+  DCHECK(pContext == m_EventContextArray.back().get());
   m_EventContextArray.pop_back();
 }
 
diff --git a/fxjs/gc/heap.cpp b/fxjs/gc/heap.cpp
index 7e486ec..d550253 100644
--- a/fxjs/gc/heap.cpp
+++ b/fxjs/gc/heap.cpp
@@ -5,6 +5,7 @@
 #include "fxjs/gc/heap.h"
 
 #include "core/fxcrt/fx_system.h"
+#include "third_party/base/check.h"
 #include "third_party/base/ptr_util.h"
 
 namespace {
@@ -47,7 +48,7 @@
 
 void FXGC_Initialize(v8::Platform* platform, v8::Isolate* isolate) {
   if (platform) {
-    ASSERT(!g_platform);
+    DCHECK(!g_platform);
     g_platform = platform;
     g_isolate = isolate;
     cppgc::InitializeProcess(platform->GetPageAllocator());
@@ -88,8 +89,8 @@
 }
 
 void FXGCHeapDeleter::operator()(cppgc::Heap* heap) {
-  ASSERT(heap);
-  ASSERT(g_platform_ref_count > 0);
+  DCHECK(heap);
+  DCHECK(g_platform_ref_count > 0);
   --g_platform_ref_count;
 
   FXGC_ForceGarbageCollection(heap);
diff --git a/fxjs/global_timer.cpp b/fxjs/global_timer.cpp
index 6850d0a..0304737 100644
--- a/fxjs/global_timer.cpp
+++ b/fxjs/global_timer.cpp
@@ -10,6 +10,7 @@
 
 #include "core/fxcrt/cfx_timer.h"
 #include "fxjs/cjs_app.h"
+#include "third_party/base/check.h"
 #include "third_party/base/no_destructor.h"
 #include "third_party/base/stl_util.h"
 
@@ -36,7 +37,7 @@
       m_pRuntime(pRuntime),
       m_pEmbedApp(pObj) {
   if (HasValidID()) {
-    ASSERT(!pdfium::Contains(GetGlobalTimerMap(), m_nTimerID));
+    DCHECK(!pdfium::Contains(GetGlobalTimerMap(), m_nTimerID));
     GetGlobalTimerMap()[m_nTimerID] = this;
   }
 }
@@ -48,7 +49,7 @@
   if (m_pRuntime && m_pRuntime->GetTimerHandler())
     m_pRuntime->GetTimerHandler()->KillTimer(m_nTimerID);
 
-  ASSERT(pdfium::Contains(GetGlobalTimerMap(), m_nTimerID));
+  DCHECK(pdfium::Contains(GetGlobalTimerMap(), m_nTimerID));
   GetGlobalTimerMap().erase(m_nTimerID);
 }
 
diff --git a/fxjs/js_define.cpp b/fxjs/js_define.cpp
index 2bc1284..46acf24 100644
--- a/fxjs/js_define.cpp
+++ b/fxjs/js_define.cpp
@@ -16,6 +16,7 @@
 #include "fxjs/cjs_object.h"
 #include "fxjs/fx_date_helpers.h"
 #include "fxjs/fxv8.h"
+#include "third_party/base/check.h"
 
 void JSDestructor(v8::Local<v8::Object> obj) {
   CFXJS_Engine::SetObjectPrivate(obj, nullptr);
@@ -59,7 +60,7 @@
     const std::vector<v8::Local<v8::Value>>& originals,
     size_t nKeywords,
     ...) {
-  ASSERT(nKeywords);
+  DCHECK(nKeywords);
 
   std::vector<v8::Local<v8::Value>> result(nKeywords, v8::Local<v8::Value>());
   size_t size = std::min(originals.size(), nKeywords);
diff --git a/fxjs/xfa/cfxjse_class.cpp b/fxjs/xfa/cfxjse_class.cpp
index 693636d..376f2f9 100644
--- a/fxjs/xfa/cfxjse_class.cpp
+++ b/fxjs/xfa/cfxjse_class.cpp
@@ -16,6 +16,7 @@
 #include "fxjs/xfa/cfxjse_context.h"
 #include "fxjs/xfa/cfxjse_isolatetracker.h"
 #include "fxjs/xfa/cfxjse_value.h"
+#include "third_party/base/check.h"
 
 using pdfium::fxjse::kClassTag;
 using pdfium::fxjse::kFuncTag;
@@ -52,7 +53,7 @@
   if (!lpClassDefinition)
     return;
 
-  ASSERT(info.Holder()->InternalFieldCount() == 2);
+  DCHECK(info.Holder()->InternalFieldCount() == 2);
   info.Holder()->SetAlignedPointerInInternalField(0, nullptr);
   info.Holder()->SetAlignedPointerInInternalField(1, nullptr);
 }
@@ -117,7 +118,7 @@
                           v8::Local<v8::Object> pObject,
                           ByteStringView szPropName,
                           CFXJSE_Value* pValue) {
-  ASSERT(lpClass);
+  DCHECK(lpClass);
 
   int32_t nPropType =
       lpClass->dynPropTypeGetter == nullptr
@@ -156,7 +157,7 @@
                           v8::Local<v8::Object> pObject,
                           ByteStringView szPropName,
                           CFXJSE_Value* pValue) {
-  ASSERT(lpClass);
+  DCHECK(lpClass);
   int32_t nPropType =
       lpClass->dynPropTypeGetter == nullptr
           ? FXJSE_ClassPropType_Property
@@ -173,7 +174,7 @@
                          const FXJSE_CLASS_DESCRIPTOR* lpClass,
                          v8::Local<v8::Object> pObject,
                          ByteStringView szPropName) {
-  ASSERT(lpClass);
+  DCHECK(lpClass);
   int32_t nPropType =
       lpClass->dynPropTypeGetter == nullptr
           ? FXJSE_ClassPropType_Property
diff --git a/fxjs/xfa/cfxjse_context.cpp b/fxjs/xfa/cfxjse_context.cpp
index 3f1abe4..d45581a 100644
--- a/fxjs/xfa/cfxjse_context.cpp
+++ b/fxjs/xfa/cfxjse_context.cpp
@@ -15,6 +15,7 @@
 #include "fxjs/xfa/cfxjse_runtimedata.h"
 #include "fxjs/xfa/cfxjse_value.h"
 #include "fxjs/xfa/cjx_object.h"
+#include "third_party/base/check.h"
 #include "third_party/base/ptr_util.h"
 #include "xfa/fxfa/parser/cxfa_thisproxy.h"
 
@@ -108,8 +109,8 @@
 }
 
 void FXJSE_UpdateProxyBinding(v8::Local<v8::Object> hObject) {
-  ASSERT(!hObject.IsEmpty());
-  ASSERT(hObject->InternalFieldCount() == 2);
+  DCHECK(!hObject.IsEmpty());
+  DCHECK(hObject->InternalFieldCount() == 2);
   hObject->SetAlignedPointerInInternalField(
       0, const_cast<char*>(kFXJSEProxyObjectTag));
   hObject->SetAlignedPointerInInternalField(1, nullptr);
@@ -119,16 +120,16 @@
 
 void FXJSE_UpdateObjectBinding(v8::Local<v8::Object> hObject,
                                CFXJSE_HostObject* lpNewBinding) {
-  ASSERT(!hObject.IsEmpty());
-  ASSERT(hObject->InternalFieldCount() == 2);
+  DCHECK(!hObject.IsEmpty());
+  DCHECK(hObject->InternalFieldCount() == 2);
   hObject->SetAlignedPointerInInternalField(
       0, const_cast<char*>(kFXJSEHostObjectTag));
   hObject->SetAlignedPointerInInternalField(1, lpNewBinding);
 }
 
 void FXJSE_ClearObjectBinding(v8::Local<v8::Object> hObject) {
-  ASSERT(!hObject.IsEmpty());
-  ASSERT(hObject->InternalFieldCount() == 2);
+  DCHECK(!hObject.IsEmpty());
+  DCHECK(hObject->InternalFieldCount() == 2);
   hObject->SetAlignedPointerInInternalField(0, nullptr);
   hObject->SetAlignedPointerInInternalField(1, nullptr);
 }
@@ -241,10 +242,10 @@
   if (hNewThis.IsEmpty()) {
     v8::Local<v8::Script> hScript;
     if (v8::Script::Compile(hContext, hScriptString).ToLocal(&hScript)) {
-      ASSERT(!trycatch.HasCaught());
+      DCHECK(!trycatch.HasCaught());
       v8::Local<v8::Value> hValue;
       if (hScript->Run(hContext).ToLocal(&hValue)) {
-        ASSERT(!trycatch.HasCaught());
+        DCHECK(!trycatch.HasCaught());
         if (lpRetValue)
           lpRetValue->ForceSetValue(GetIsolate(), hValue);
         return true;
@@ -262,13 +263,13 @@
       v8::Script::Compile(hContext, hEval).ToLocalChecked();
   v8::Local<v8::Value> hWrapperValue;
   if (hWrapper->Run(hContext).ToLocal(&hWrapperValue)) {
-    ASSERT(!trycatch.HasCaught());
+    DCHECK(!trycatch.HasCaught());
     v8::Local<v8::Function> hWrapperFn = hWrapperValue.As<v8::Function>();
     v8::Local<v8::Value> rgArgs[] = {hScriptString};
     v8::Local<v8::Value> hValue;
     if (hWrapperFn->Call(hContext, hNewThis.As<v8::Object>(), 1, rgArgs)
             .ToLocal(&hValue)) {
-      ASSERT(!trycatch.HasCaught());
+      DCHECK(!trycatch.HasCaught());
       if (lpRetValue)
         lpRetValue->ForceSetValue(GetIsolate(), hValue);
       return true;
diff --git a/fxjs/xfa/cfxjse_formcalc_context.cpp b/fxjs/xfa/cfxjse_formcalc_context.cpp
index 84dfaba..a2123c5 100644
--- a/fxjs/xfa/cfxjse_formcalc_context.cpp
+++ b/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -21,6 +21,7 @@
 #include "fxjs/xfa/cfxjse_engine.h"
 #include "fxjs/xfa/cfxjse_value.h"
 #include "fxjs/xfa/cjx_object.h"
+#include "third_party/base/check.h"
 #include "third_party/base/optional.h"
 #include "third_party/base/stl_util.h"
 #include "xfa/fgas/crt/cfgas_decimal.h"
@@ -1383,7 +1384,7 @@
 v8::Local<v8::Value> GetSimpleValue(
     const v8::FunctionCallbackInfo<v8::Value>& info,
     uint32_t index) {
-  ASSERT(index < static_cast<uint32_t>(info.Length()));
+  DCHECK(index < static_cast<uint32_t>(info.Length()));
   return GetExtractedValue(info.GetIsolate(), info[index]);
 }
 
@@ -5550,6 +5551,6 @@
 }
 
 void CFXJSE_FormCalcContext::ThrowException(const WideString& str) const {
-  ASSERT(!str.IsEmpty());
+  DCHECK(!str.IsEmpty());
   FXJSE_ThrowMessage(str.ToUTF8().AsStringView());
 }
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.cpp b/fxjs/xfa/cfxjse_resolveprocessor.cpp
index e9dc7a7..34f294b 100644
--- a/fxjs/xfa/cfxjse_resolveprocessor.cpp
+++ b/fxjs/xfa/cfxjse_resolveprocessor.cpp
@@ -15,6 +15,7 @@
 #include "fxjs/xfa/cfxjse_nodehelper.h"
 #include "fxjs/xfa/cfxjse_value.h"
 #include "fxjs/xfa/cjx_object.h"
+#include "third_party/base/check.h"
 #include "third_party/base/stl_util.h"
 #include "xfa/fxfa/parser/cxfa_document.h"
 #include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -29,7 +30,7 @@
                        WideString wsCondition,
                        size_t iFoundCount,
                        CFXJSE_ResolveNodeData* pRnd) {
-  ASSERT(iFoundCount == pRnd->m_Result.objects.size());
+  DCHECK(iFoundCount == pRnd->m_Result.objects.size());
   WideString wsExpression;
   CXFA_Script::Type eLangType = CXFA_Script::Type::Unknown;
   if (wsCondition.First(2).EqualsASCII(".[") && wsCondition.Back() == L']')
@@ -528,7 +529,7 @@
 int32_t CFXJSE_ResolveProcessor::GetFilter(WideStringView wsExpression,
                                            int32_t nStart,
                                            CFXJSE_ResolveNodeData& rnd) {
-  ASSERT(nStart > -1);
+  DCHECK(nStart > -1);
 
   int32_t iLength = wsExpression.GetLength();
   if (nStart >= iLength)
diff --git a/fxjs/xfa/cfxjse_runtimedata.cpp b/fxjs/xfa/cfxjse_runtimedata.cpp
index 87ff7eb..561c08d 100644
--- a/fxjs/xfa/cfxjse_runtimedata.cpp
+++ b/fxjs/xfa/cfxjse_runtimedata.cpp
@@ -11,6 +11,7 @@
 #include "fxjs/cfxjs_engine.h"
 #include "fxjs/fxv8.h"
 #include "fxjs/xfa/cfxjse_isolatetracker.h"
+#include "third_party/base/check.h"
 
 CFXJSE_RuntimeData::CFXJSE_RuntimeData() = default;
 
@@ -31,8 +32,8 @@
   v8::Local<v8::Context> hContext =
       v8::Context::New(pIsolate, 0, hGlobalTemplate);
 
-  ASSERT(hContext->Global()->InternalFieldCount() == 0);
-  ASSERT(hContext->Global()
+  DCHECK(hContext->Global()->InternalFieldCount() == 0);
+  DCHECK(hContext->Global()
              ->GetPrototype()
              .As<v8::Object>()
              ->InternalFieldCount() == 0);
diff --git a/fxjs/xfa/cfxjse_value.cpp b/fxjs/xfa/cfxjse_value.cpp
index d6c671d..5aa05c1 100644
--- a/fxjs/xfa/cfxjse_value.cpp
+++ b/fxjs/xfa/cfxjse_value.cpp
@@ -13,6 +13,7 @@
 #include "fxjs/xfa/cfxjse_class.h"
 #include "fxjs/xfa/cfxjse_context.h"
 #include "fxjs/xfa/cfxjse_isolatetracker.h"
+#include "third_party/base/check.h"
 
 namespace {
 
@@ -57,7 +58,7 @@
 
 void FXJSE_ThrowMessage(ByteStringView utf8Message) {
   v8::Isolate* pIsolate = v8::Isolate::GetCurrent();
-  ASSERT(pIsolate);
+  DCHECK(pIsolate);
 
   CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
   v8::Local<v8::String> hMessage = fxv8::NewStringHelper(pIsolate, utf8Message);
@@ -197,8 +198,8 @@
     v8::Isolate* pIsolate,
     v8::Local<v8::Function> hOldFunction,
     v8::Local<v8::Object> hNewThis) {
-  ASSERT(!hOldFunction.IsEmpty());
-  ASSERT(!hNewThis.IsEmpty());
+  DCHECK(!hOldFunction.IsEmpty());
+  DCHECK(!hNewThis.IsEmpty());
 
   CFXJSE_ScopeUtil_RootContext scope(pIsolate);
   v8::Local<v8::Value> rgArgs[2];
@@ -312,7 +313,7 @@
 }
 
 bool CFXJSE_Value::ToBoolean(v8::Isolate* pIsolate) const {
-  ASSERT(!IsEmpty());
+  DCHECK(!IsEmpty());
   CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
   return fxv8::ReentrantToBooleanHelper(
       pIsolate, v8::Local<v8::Value>::New(pIsolate, m_hValue));
@@ -323,21 +324,21 @@
 }
 
 double CFXJSE_Value::ToDouble(v8::Isolate* pIsolate) const {
-  ASSERT(!IsEmpty());
+  DCHECK(!IsEmpty());
   CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
   return fxv8::ReentrantToDoubleHelper(
       pIsolate, v8::Local<v8::Value>::New(pIsolate, m_hValue));
 }
 
 int32_t CFXJSE_Value::ToInteger(v8::Isolate* pIsolate) const {
-  ASSERT(!IsEmpty());
+  DCHECK(!IsEmpty());
   CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
   return fxv8::ReentrantToInt32Helper(
       pIsolate, v8::Local<v8::Value>::New(pIsolate, m_hValue));
 }
 
 ByteString CFXJSE_Value::ToString(v8::Isolate* pIsolate) const {
-  ASSERT(!IsEmpty());
+  DCHECK(!IsEmpty());
   CFXJSE_ScopeUtil_IsolateHandleRootContext scope(pIsolate);
   return fxv8::ReentrantToByteStringHelper(
       pIsolate, v8::Local<v8::Value>::New(pIsolate, m_hValue));
diff --git a/fxjs/xfa/cfxjse_value.h b/fxjs/xfa/cfxjse_value.h
index 9bdc591..6cc0517 100644
--- a/fxjs/xfa/cfxjse_value.h
+++ b/fxjs/xfa/cfxjse_value.h
@@ -13,6 +13,7 @@
 #include "core/fxcrt/fx_string.h"
 #include "core/fxcrt/fx_system.h"
 #include "core/fxcrt/unowned_ptr.h"
+#include "third_party/base/check.h"
 #include "v8/include/v8.h"
 
 class CFXJSE_Class;
@@ -88,7 +89,7 @@
     m_hValue.Reset(pIsolate, hValue);
   }
   void Assign(v8::Isolate* pIsolate, const CFXJSE_Value* lpValue) {
-    ASSERT(lpValue);
+    DCHECK(lpValue);
     if (lpValue) {
       m_hValue.Reset(pIsolate, lpValue->m_hValue);
     } else {
diff --git a/fxjs/xfa/cjx_draw.cpp b/fxjs/xfa/cjx_draw.cpp
index e8b956b..b5f33a0 100644
--- a/fxjs/xfa/cjx_draw.cpp
+++ b/fxjs/xfa/cjx_draw.cpp
@@ -8,6 +8,7 @@
 
 #include "fxjs/fxv8.h"
 #include "fxjs/xfa/cfxjse_value.h"
+#include "third_party/base/check.h"
 #include "xfa/fxfa/parser/cxfa_draw.h"
 
 CJX_Draw::CJX_Draw(CXFA_Draw* node) : CJX_Container(node) {}
@@ -41,7 +42,7 @@
   if (!pValue || !fxv8::IsString(*pValue))
     return;
 
-  ASSERT(GetXFANode()->IsWidgetReady());
+  DCHECK(GetXFANode()->IsWidgetReady());
   if (GetXFANode()->GetFFWidgetType() != XFA_FFWidgetType::kText)
     return;
 
diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp
index d284839..cf20597 100644
--- a/fxjs/xfa/cjx_hostpseudomodel.cpp
+++ b/fxjs/xfa/cjx_hostpseudomodel.cpp
@@ -12,6 +12,7 @@
 #include "fxjs/fxv8.h"
 #include "fxjs/js_resources.h"
 #include "fxjs/xfa/cfxjse_engine.h"
+#include "third_party/base/check.h"
 #include "xfa/fxfa/cxfa_ffdoc.h"
 #include "xfa/fxfa/cxfa_ffnotify.h"
 #include "xfa/fxfa/parser/cscript_hostpseudomodel.h"
@@ -22,7 +23,7 @@
 int32_t FilterName(WideStringView wsExpression,
                    int32_t nStart,
                    WideString& wsFilter) {
-  ASSERT(nStart > -1);
+  DCHECK(nStart > -1);
   int32_t iLength = wsExpression.GetLength();
   if (nStart >= iLength)
     return iLength;
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index 4d4f13b..dec8d87 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -22,6 +22,7 @@
 #include "fxjs/xfa/cjx_draw.h"
 #include "fxjs/xfa/cjx_field.h"
 #include "fxjs/xfa/cjx_instancemanager.h"
+#include "third_party/base/check.h"
 #include "third_party/base/compiler_specific.h"
 #include "third_party/base/stl_util.h"
 #include "xfa/fgas/crt/cfgas_decimal.h"
@@ -191,7 +192,7 @@
 }
 
 void CJX_Object::ThrowException(const WideString& str) const {
-  ASSERT(!str.IsEmpty());
+  DCHECK(!str.IsEmpty());
   FXJSE_ThrowMessage(str.ToUTF8().AsStringView());
 }
 
@@ -544,7 +545,7 @@
             }
             valueNodes = pBind->GetNodeListForType(XFA_Element::DataValue);
           }
-          ASSERT(valueNodes.size() == wsSaveTextArray.size());
+          DCHECK(valueNodes.size() == wsSaveTextArray.size());
           size_t i = 0;
           for (CXFA_Node* pValueNode : valueNodes) {
             pValueNode->JSObject()->SetAttributeValue(wsSaveTextArray[i],
@@ -569,7 +570,7 @@
           break;
 
         CXFA_Node* pChildValue = pValue->GetFirstChild();
-        ASSERT(pChildValue);
+        DCHECK(pChildValue);
         pChildValue->JSObject()->SetContent(wsContent, wsContent, bNotify,
                                             bScriptModify, false);
       }