Rename CJS_Return to CJS_Result.

"Return" is a verb, and "return" is a reserved-word at that,
so avoid using it as part of a class name.

Fully mechanical change apart from rename.

Change-Id: I120e453e8ba001c4ab74a39e2da6aa6eb590835f
Reviewed-on: https://pdfium-review.googlesource.com/40532
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/cfxjse_class.cpp b/fxjs/cfxjse_class.cpp
index 9207fd5..0d68147 100644
--- a/fxjs/cfxjse_class.cpp
+++ b/fxjs/cfxjse_class.cpp
@@ -12,7 +12,7 @@
 #include "fxjs/cfxjse_arguments.h"
 #include "fxjs/cfxjse_context.h"
 #include "fxjs/cfxjse_value.h"
-#include "fxjs/cjs_return.h"
+#include "fxjs/cjs_result.h"
 #include "fxjs/js_resources.h"
 #include "third_party/base/ptr_util.h"
 
@@ -105,7 +105,7 @@
     return;
 
   v8::String::Utf8Value szPropName(info.GetIsolate(), hPropName);
-  CJS_Return result =
+  CJS_Result result =
       pClassDescriptor->dynMethodCall(info, WideString::FromUTF8(*szPropName));
 
   if (result.HasError()) {
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index 7a4865b..5d2ee25 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -437,12 +437,12 @@
   return FXJSE_ClassPropType_Property;
 }
 
-CJS_Return CFXJSE_Engine::NormalMethodCall(
+CJS_Result CFXJSE_Engine::NormalMethodCall(
     const v8::FunctionCallbackInfo<v8::Value>& info,
     const WideString& functionName) {
   CXFA_Object* pObject = ToObject(info);
   if (!pObject)
-    return CJS_Return::Failure(L"no Holder() present.");
+    return CJS_Result::Failure(L"no Holder() present.");
 
   CFXJSE_Engine* lpScriptContext = pObject->GetDocument()->GetScriptContext();
   pObject = lpScriptContext->GetVariablesThis(pObject, false);
diff --git a/fxjs/cfxjse_engine.h b/fxjs/cfxjse_engine.h
index 380965e..01bce53 100644
--- a/fxjs/cfxjse_engine.h
+++ b/fxjs/cfxjse_engine.h
@@ -42,7 +42,7 @@
   static void NormalPropertySetter(CFXJSE_Value* pObject,
                                    const ByteStringView& szPropName,
                                    CFXJSE_Value* pValue);
-  static CJS_Return NormalMethodCall(
+  static CJS_Result NormalMethodCall(
       const v8::FunctionCallbackInfo<v8::Value>& info,
       const WideString& functionName);
   static int32_t NormalPropTypeGetter(CFXJSE_Value* pObject,
diff --git a/fxjs/cjs_annot.cpp b/fxjs/cjs_annot.cpp
index 4e93dc2..dda52f6 100644
--- a/fxjs/cjs_annot.cpp
+++ b/fxjs/cjs_annot.cpp
@@ -37,23 +37,23 @@
 
 CJS_Annot::~CJS_Annot() = default;
 
-CJS_Return CJS_Annot::get_hidden(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Annot::get_hidden(CJS_Runtime* pRuntime) {
   if (!m_pAnnot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_Annot* pPDFAnnot = m_pAnnot->AsBAAnnot()->GetPDFAnnot();
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       CPDF_Annot::IsAnnotationHidden(pPDFAnnot->GetAnnotDict())));
 }
 
-CJS_Return CJS_Annot::set_hidden(CJS_Runtime* pRuntime,
+CJS_Result CJS_Annot::set_hidden(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
   // May invalidate m_pAnnot.
   bool bHidden = pRuntime->ToBoolean(vp);
 
   CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get());
   if (!pBAAnnot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   uint32_t flags = pBAAnnot->GetFlags();
   if (bHidden) {
@@ -68,42 +68,42 @@
     flags |= ANNOTFLAG_PRINT;
   }
   pBAAnnot->SetFlags(flags);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Annot::get_name(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Annot::get_name(CJS_Runtime* pRuntime) {
   CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get());
   if (!pBAAnnot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pBAAnnot->GetAnnotName().AsStringView()));
 }
 
-CJS_Return CJS_Annot::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Annot::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   // May invalidate m_pAnnot.
   WideString annotName = pRuntime->ToWideString(vp);
 
   CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get());
   if (!pBAAnnot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   pBAAnnot->SetAnnotName(annotName);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Annot::get_type(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Annot::get_type(CJS_Runtime* pRuntime) {
   CPDFSDK_BAAnnot* pBAAnnot = ToBAAnnot(m_pAnnot.Get());
   if (!pBAAnnot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewString(
+  return CJS_Result::Success(pRuntime->NewString(
       WideString::FromLocal(
           CPDF_Annot::AnnotSubtypeToString(pBAAnnot->GetAnnotSubtype())
               .AsStringView())
           .AsStringView()));
 }
 
-CJS_Return CJS_Annot::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+CJS_Result CJS_Annot::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
diff --git a/fxjs/cjs_annot.h b/fxjs/cjs_annot.h
index d313d56..79b2663 100644
--- a/fxjs/cjs_annot.h
+++ b/fxjs/cjs_annot.h
@@ -29,14 +29,14 @@
   static const char kName[];
   static const JSPropertySpec PropertySpecs[];
 
-  CJS_Return get_hidden(CJS_Runtime* pRuntime);
-  CJS_Return set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_hidden(CJS_Runtime* pRuntime);
+  CJS_Result set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_name(CJS_Runtime* pRuntime);
-  CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_name(CJS_Runtime* pRuntime);
+  CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_type(CJS_Runtime* pRuntime);
-  CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_type(CJS_Runtime* pRuntime);
+  CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
   CPDFSDK_Annot::ObservedPtr m_pAnnot;
 };
diff --git a/fxjs/cjs_app.cpp b/fxjs/cjs_app.cpp
index bd57e05..12bb8dd 100644
--- a/fxjs/cjs_app.cpp
+++ b/fxjs/cjs_app.cpp
@@ -101,7 +101,7 @@
 
 CJS_App::~CJS_App() = default;
 
-CJS_Return CJS_App::get_active_docs(CJS_Runtime* pRuntime) {
+CJS_Result CJS_App::get_active_docs(CJS_Runtime* pRuntime) {
   v8::Local<v8::Object> pObj = pRuntime->GetThisObj();
   auto pJSDocument = JSGetObject<CJS_Document>(pObj);
   v8::Local<v8::Array> aDocs = pRuntime->NewArray();
@@ -110,111 +110,111 @@
       pJSDocument ? v8::Local<v8::Value>(pJSDocument->ToV8Object())
                   : v8::Local<v8::Value>());
   if (pRuntime->GetArrayLength(aDocs) > 0)
-    return CJS_Return::Success(aDocs);
+    return CJS_Result::Success(aDocs);
 
-  return CJS_Return::Success(pRuntime->NewUndefined());
+  return CJS_Result::Success(pRuntime->NewUndefined());
 }
 
-CJS_Return CJS_App::set_active_docs(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_active_docs(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_calculate(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewBoolean(m_bCalculate));
+CJS_Result CJS_App::get_calculate(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewBoolean(m_bCalculate));
 }
 
-CJS_Return CJS_App::set_calculate(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_calculate(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
   m_bCalculate = pRuntime->ToBoolean(vp);
   pRuntime->GetFormFillEnv()->GetInterForm()->EnableCalculate(m_bCalculate);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::get_forms_version(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewNumber(JS_NUM_FORMSVERSION));
+CJS_Result CJS_App::get_forms_version(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewNumber(JS_NUM_FORMSVERSION));
 }
 
-CJS_Return CJS_App::set_forms_version(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_forms_version(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_viewer_type(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewString(JS_STR_VIEWERTYPE));
+CJS_Result CJS_App::get_viewer_type(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewString(JS_STR_VIEWERTYPE));
 }
 
-CJS_Return CJS_App::set_viewer_type(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_viewer_type(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_viewer_variation(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewString(JS_STR_VIEWERVARIATION));
+CJS_Result CJS_App::get_viewer_variation(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewString(JS_STR_VIEWERVARIATION));
 }
 
-CJS_Return CJS_App::set_viewer_variation(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_viewer_variation(CJS_Runtime* pRuntime,
                                          v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_viewer_version(CJS_Runtime* pRuntime) {
+CJS_Result CJS_App::get_viewer_version(CJS_Runtime* pRuntime) {
 #ifdef PDF_ENABLE_XFA
   CPDFXFA_Context* pXFAContext = pRuntime->GetFormFillEnv()->GetXFAContext();
   if (pXFAContext->ContainsXFAForm())
-    return CJS_Return::Success(pRuntime->NewNumber(JS_NUM_VIEWERVERSION_XFA));
+    return CJS_Result::Success(pRuntime->NewNumber(JS_NUM_VIEWERVERSION_XFA));
 #endif  // PDF_ENABLE_XFA
-  return CJS_Return::Success(pRuntime->NewNumber(JS_NUM_VIEWERVERSION));
+  return CJS_Result::Success(pRuntime->NewNumber(JS_NUM_VIEWERVERSION));
 }
 
-CJS_Return CJS_App::set_viewer_version(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_viewer_version(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_platform(CJS_Runtime* pRuntime) {
+CJS_Result CJS_App::get_platform(CJS_Runtime* pRuntime) {
 #ifdef PDF_ENABLE_XFA
   CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
   if (!pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString platform = pFormFillEnv->GetPlatform();
   if (!platform.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewString(platform.AsStringView()));
+    return CJS_Result::Success(pRuntime->NewString(platform.AsStringView()));
 #endif
-  return CJS_Return::Success(pRuntime->NewString(JS_STR_PLATFORM));
+  return CJS_Result::Success(pRuntime->NewString(JS_STR_PLATFORM));
 }
 
-CJS_Return CJS_App::set_platform(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_platform(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_language(CJS_Runtime* pRuntime) {
+CJS_Result CJS_App::get_language(CJS_Runtime* pRuntime) {
 #ifdef PDF_ENABLE_XFA
   CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
   if (!pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString language = pFormFillEnv->GetLanguage();
   if (!language.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewString(language.AsStringView()));
+    return CJS_Result::Success(pRuntime->NewString(language.AsStringView()));
 #endif
-  return CJS_Return::Success(pRuntime->NewString(JS_STR_LANGUAGE));
+  return CJS_Result::Success(pRuntime->NewString(JS_STR_LANGUAGE));
 }
 
-CJS_Return CJS_App::set_language(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_language(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
 // creates a new fdf object that contains no data
 // comment: need reader support
 // note:
 // CFDF_Document * CPDFSDK_FormFillEnvironment::NewFDF();
-CJS_Return CJS_App::newFDF(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::newFDF(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // opens a specified pdf document and returns its document object
@@ -224,22 +224,22 @@
 // CFDF_Document * CPDFSDK_FormFillEnvironment::OpenFDF(string strPath,bool
 // bUserConv);
 
-CJS_Return CJS_App::openFDF(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::openFDF(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::alert(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::alert(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params) {
   std::vector<v8::Local<v8::Value>> newParams = ExpandKeywordParams(
       pRuntime, params, 4, L"cMsg", L"nIcon", L"nType", L"cTitle");
 
   if (!IsTypeKnown(newParams[0]))
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
   if (!pFormFillEnv)
-    return CJS_Return::Success(pRuntime->NewNumber(0));
+    return CJS_Result::Success(pRuntime->NewNumber(0));
 
   WideString swMsg;
   if (newParams[0]->IsArray()) {
@@ -276,51 +276,51 @@
       pFormFillEnv->JS_appAlert(swMsg, swTitle, iType, iIcon));
   pRuntime->EndBlock();
 
-  return CJS_Return::Success(ret);
+  return CJS_Result::Success(ret);
 }
 
-CJS_Return CJS_App::beep(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::beep(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int type = JSPLATFORM_BEEP_DEFAULT;
   if (IsTypeKnown(params[0]))
     type = pRuntime->ToInt32(params[0]);
 
   pRuntime->GetFormFillEnv()->JS_appBeep(type);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::findComponent(
+CJS_Result CJS_App::findComponent(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::popUpMenuEx(
+CJS_Result CJS_App::popUpMenuEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::get_fs(CJS_Runtime* pRuntime) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_App::get_fs(CJS_Runtime* pRuntime) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::set_fs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_App::set_fs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::setInterval(
+CJS_Result CJS_App::setInterval(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() == 0 || params.size() > 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString script = pRuntime->ToWideString(params[0]);
   if (script.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kInvalidInputError);
+    return CJS_Result::Failure(JSMessage::kInvalidInputError);
 
   uint32_t dwInterval = params.size() > 1 ? pRuntime->ToInt32(params[1]) : 1000;
   auto timerRef = pdfium::MakeUnique<GlobalTimer>(
@@ -331,24 +331,24 @@
   v8::Local<v8::Object> pRetObj = pRuntime->NewFXJSBoundObject(
       CJS_TimerObj::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pRetObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto* pJS_TimerObj =
       static_cast<CJS_TimerObj*>(CFXJS_Engine::GetObjectPrivate(pRetObj));
 
   pJS_TimerObj->SetTimer(pTimerRef);
-  return CJS_Return::Success(pRetObj);
+  return CJS_Result::Success(pRetObj);
 }
 
-CJS_Return CJS_App::setTimeOut(
+CJS_Result CJS_App::setTimeOut(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() == 0 || params.size() > 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString script = pRuntime->ToWideString(params[0]);
   if (script.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kInvalidInputError);
+    return CJS_Result::Failure(JSMessage::kInvalidInputError);
 
   uint32_t dwTimeOut = params.size() > 1 ? pRuntime->ToInt32(params[1]) : 1000;
   auto timerRef = pdfium::MakeUnique<GlobalTimer>(
@@ -360,33 +360,33 @@
   v8::Local<v8::Object> pRetObj = pRuntime->NewFXJSBoundObject(
       CJS_TimerObj::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pRetObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto* pJS_TimerObj =
       static_cast<CJS_TimerObj*>(CFXJS_Engine::GetObjectPrivate(pRetObj));
 
   pJS_TimerObj->SetTimer(pTimerRef);
-  return CJS_Return::Success(pRetObj);
+  return CJS_Result::Success(pRetObj);
 }
 
-CJS_Return CJS_App::clearTimeOut(
+CJS_Result CJS_App::clearTimeOut(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_App::ClearTimerCommon(pRuntime, params[0]);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::clearInterval(
+CJS_Result CJS_App::clearInterval(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_App::ClearTimerCommon(pRuntime, params[0]);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJS_App::ClearTimerCommon(CJS_Runtime* pRuntime,
@@ -402,7 +402,7 @@
   GlobalTimer::Cancel(pTimer->GetTimerID());
 }
 
-CJS_Return CJS_App::execMenuItem(
+CJS_Result CJS_App::execMenuItem(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() > 0 && IsTypeKnown(params[0])) {
@@ -411,7 +411,7 @@
       pRuntime->GetFormFillEnv()->SaveCalled();
   }
 
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
 void CJS_App::TimerProc(GlobalTimer* pTimer) {
@@ -433,26 +433,26 @@
   pContext->RunScript(wsScript);
 }
 
-CJS_Return CJS_App::goBack(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::goBack(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params) {
   // Not supported, but do not return error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::goForward(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::goForward(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   // Not supported, but do not return error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::mailMsg(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::mailMsg(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   std::vector<v8::Local<v8::Value>> newParams =
       ExpandKeywordParams(pRuntime, params, 6, L"bUI", L"cTo", L"cCc", L"cBcc",
                           L"cSubject", L"cMsg");
 
   if (!IsTypeKnown(newParams[0]))
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   bool bUI = pRuntime->ToBoolean(newParams[0]);
   WideString cTo;
@@ -461,7 +461,7 @@
   } else {
     // cTo parameter required when UI not invoked.
     if (!bUI)
-      return CJS_Return::Failure(JSMessage::kParamError);
+      return CJS_Result::Failure(JSMessage::kParamError);
   }
 
   WideString cCc;
@@ -484,44 +484,44 @@
   pRuntime->GetFormFillEnv()->JS_docmailForm(nullptr, 0, bUI, cTo, cSubject,
                                              cCc, cBcc, cMsg);
   pRuntime->EndBlock();
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::launchURL(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::launchURL(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::get_runtime_highlight(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewBoolean(m_bRuntimeHighLight));
+CJS_Result CJS_App::get_runtime_highlight(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewBoolean(m_bRuntimeHighLight));
 }
 
-CJS_Return CJS_App::set_runtime_highlight(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_runtime_highlight(CJS_Runtime* pRuntime,
                                           v8::Local<v8::Value> vp) {
   m_bRuntimeHighLight = pRuntime->ToBoolean(vp);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_App::get_fullscreen(CJS_Runtime* pRuntime) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_App::get_fullscreen(CJS_Runtime* pRuntime) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::set_fullscreen(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::set_fullscreen(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::popUpMenu(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::popUpMenu(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::browseForDoc(
+CJS_Result CJS_App::browseForDoc(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return an error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 WideString CJS_App::SysPathToPDFPath(const WideString& sOldPath) {
@@ -533,24 +533,24 @@
   return sRet;
 }
 
-CJS_Return CJS_App::newDoc(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::newDoc(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::openDoc(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::openDoc(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::response(CJS_Runtime* pRuntime,
+CJS_Result CJS_App::response(CJS_Runtime* pRuntime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   std::vector<v8::Local<v8::Value>> newParams =
       ExpandKeywordParams(pRuntime, params, 5, L"cQuestion", L"cTitle",
                           L"cDefault", L"bPassword", L"cLabel");
 
   if (!IsTypeKnown(newParams[0]))
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString swQuestion = pRuntime->ToWideString(newParams[0]);
   WideString swTitle = L"PDF";
@@ -576,24 +576,24 @@
       MAX_INPUT_BYTES);
 
   if (nLengthBytes < 0 || nLengthBytes > MAX_INPUT_BYTES)
-    return CJS_Return::Failure(JSMessage::kParamTooLongError);
+    return CJS_Result::Failure(JSMessage::kParamTooLongError);
 
-  return CJS_Return::Success(pRuntime->NewString(
+  return CJS_Result::Success(pRuntime->NewString(
       WideString::FromUTF16LE(reinterpret_cast<uint16_t*>(pBuff.data()),
                               nLengthBytes / sizeof(uint16_t))
           .AsStringView()));
 }
 
-CJS_Return CJS_App::get_media(CJS_Runtime* pRuntime) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_App::get_media(CJS_Runtime* pRuntime) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_App::set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_App::execDialog(
+CJS_Result CJS_App::execDialog(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
diff --git a/fxjs/cjs_app.h b/fxjs/cjs_app.h
index e962b34..5690f47 100644
--- a/fxjs/cjs_app.h
+++ b/fxjs/cjs_app.h
@@ -70,85 +70,85 @@
   static const JSPropertySpec PropertySpecs[];
   static const JSMethodSpec MethodSpecs[];
 
-  CJS_Return get_active_docs(CJS_Runtime* pRuntime);
-  CJS_Return set_active_docs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_active_docs(CJS_Runtime* pRuntime);
+  CJS_Result set_active_docs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_calculate(CJS_Runtime* pRuntime);
-  CJS_Return set_calculate(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_calculate(CJS_Runtime* pRuntime);
+  CJS_Result set_calculate(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_forms_version(CJS_Runtime* pRuntime);
-  CJS_Return set_forms_version(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_forms_version(CJS_Runtime* pRuntime);
+  CJS_Result set_forms_version(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_fs(CJS_Runtime* pRuntime);
-  CJS_Return set_fs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_fs(CJS_Runtime* pRuntime);
+  CJS_Result set_fs(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_fullscreen(CJS_Runtime* pRuntime);
-  CJS_Return set_fullscreen(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_fullscreen(CJS_Runtime* pRuntime);
+  CJS_Result set_fullscreen(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_language(CJS_Runtime* pRuntime);
-  CJS_Return set_language(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_language(CJS_Runtime* pRuntime);
+  CJS_Result set_language(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_media(CJS_Runtime* pRuntime);
-  CJS_Return set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_media(CJS_Runtime* pRuntime);
+  CJS_Result set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_platform(CJS_Runtime* pRuntime);
-  CJS_Return set_platform(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_platform(CJS_Runtime* pRuntime);
+  CJS_Result set_platform(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_runtime_highlight(CJS_Runtime* pRuntime);
-  CJS_Return set_runtime_highlight(CJS_Runtime* pRuntime,
+  CJS_Result get_runtime_highlight(CJS_Runtime* pRuntime);
+  CJS_Result set_runtime_highlight(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp);
 
-  CJS_Return get_viewer_type(CJS_Runtime* pRuntime);
-  CJS_Return set_viewer_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_viewer_type(CJS_Runtime* pRuntime);
+  CJS_Result set_viewer_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_viewer_variation(CJS_Runtime* pRuntime);
-  CJS_Return set_viewer_variation(CJS_Runtime* pRuntime,
+  CJS_Result get_viewer_variation(CJS_Runtime* pRuntime);
+  CJS_Result set_viewer_variation(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp);
 
-  CJS_Return get_viewer_version(CJS_Runtime* pRuntime);
-  CJS_Return set_viewer_version(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_viewer_version(CJS_Runtime* pRuntime);
+  CJS_Result set_viewer_version(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return alert(CJS_Runtime* pRuntime,
+  CJS_Result alert(CJS_Runtime* pRuntime,
                    const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return beep(CJS_Runtime* pRuntime,
+  CJS_Result beep(CJS_Runtime* pRuntime,
                   const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return browseForDoc(CJS_Runtime* pRuntime,
+  CJS_Result browseForDoc(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return clearInterval(CJS_Runtime* pRuntime,
+  CJS_Result clearInterval(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return clearTimeOut(CJS_Runtime* pRuntime,
+  CJS_Result clearTimeOut(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return execDialog(CJS_Runtime* pRuntime,
+  CJS_Result execDialog(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return execMenuItem(CJS_Runtime* pRuntime,
+  CJS_Result execMenuItem(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return findComponent(CJS_Runtime* pRuntime,
+  CJS_Result findComponent(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return goBack(CJS_Runtime* pRuntime,
+  CJS_Result goBack(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return goForward(CJS_Runtime* pRuntime,
+  CJS_Result goForward(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return launchURL(CJS_Runtime* pRuntime,
+  CJS_Result launchURL(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return mailMsg(CJS_Runtime* pRuntime,
+  CJS_Result mailMsg(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return newFDF(CJS_Runtime* pRuntime,
+  CJS_Result newFDF(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return newDoc(CJS_Runtime* pRuntime,
+  CJS_Result newDoc(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return openDoc(CJS_Runtime* pRuntime,
+  CJS_Result openDoc(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return openFDF(CJS_Runtime* pRuntime,
+  CJS_Result openFDF(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return popUpMenuEx(CJS_Runtime* pRuntime,
+  CJS_Result popUpMenuEx(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return popUpMenu(CJS_Runtime* pRuntime,
+  CJS_Result popUpMenu(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return response(CJS_Runtime* pRuntime,
+  CJS_Result response(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return setInterval(CJS_Runtime* pRuntime,
+  CJS_Result setInterval(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return setTimeOut(CJS_Runtime* pRuntime,
+  CJS_Result setTimeOut(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
 
   void RunJsScript(CJS_Runtime* pRuntime, const WideString& wsScript);
diff --git a/fxjs/cjs_color.cpp b/fxjs/cjs_color.cpp
index 3bfa1a7..bba4513 100644
--- a/fxjs/cjs_color.cpp
+++ b/fxjs/cjs_color.cpp
@@ -143,133 +143,133 @@
 
 CJS_Color::~CJS_Color() = default;
 
-CJS_Return CJS_Color::get_transparent(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_transparent(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crTransparent);
 }
 
-CJS_Return CJS_Color::set_transparent(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_transparent(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crTransparent);
 }
 
-CJS_Return CJS_Color::get_black(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_black(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crBlack);
 }
 
-CJS_Return CJS_Color::set_black(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_black(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crBlack);
 }
 
-CJS_Return CJS_Color::get_white(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_white(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crWhite);
 }
 
-CJS_Return CJS_Color::set_white(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_white(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crWhite);
 }
 
-CJS_Return CJS_Color::get_red(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_red(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crRed);
 }
 
-CJS_Return CJS_Color::set_red(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Color::set_red(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crRed);
 }
 
-CJS_Return CJS_Color::get_green(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_green(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crGreen);
 }
 
-CJS_Return CJS_Color::set_green(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_green(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crGreen);
 }
 
-CJS_Return CJS_Color::get_blue(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_blue(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crBlue);
 }
 
-CJS_Return CJS_Color::set_blue(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Color::set_blue(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crBlue);
 }
 
-CJS_Return CJS_Color::get_cyan(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_cyan(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crCyan);
 }
 
-CJS_Return CJS_Color::set_cyan(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Color::set_cyan(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crCyan);
 }
 
-CJS_Return CJS_Color::get_magenta(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_magenta(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crMagenta);
 }
 
-CJS_Return CJS_Color::set_magenta(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_magenta(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crMagenta);
 }
 
-CJS_Return CJS_Color::get_yellow(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_yellow(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crYellow);
 }
 
-CJS_Return CJS_Color::set_yellow(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_yellow(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crYellow);
 }
 
-CJS_Return CJS_Color::get_dark_gray(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_dark_gray(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crDKGray);
 }
 
-CJS_Return CJS_Color::set_dark_gray(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_dark_gray(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crDKGray);
 }
 
-CJS_Return CJS_Color::get_gray(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_gray(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crGray);
 }
 
-CJS_Return CJS_Color::set_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Color::set_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crGray);
 }
 
-CJS_Return CJS_Color::get_light_gray(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Color::get_light_gray(CJS_Runtime* pRuntime) {
   return GetPropertyHelper(pRuntime, &m_crLTGray);
 }
 
-CJS_Return CJS_Color::set_light_gray(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::set_light_gray(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   return SetPropertyHelper(pRuntime, vp, &m_crLTGray);
 }
 
-CJS_Return CJS_Color::GetPropertyHelper(CJS_Runtime* pRuntime, CFX_Color* var) {
+CJS_Result CJS_Color::GetPropertyHelper(CJS_Runtime* pRuntime, CFX_Color* var) {
   v8::Local<v8::Value> array = ConvertPWLColorToArray(pRuntime, *var);
   if (array.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewArray());
+    return CJS_Result::Success(pRuntime->NewArray());
 
-  return CJS_Return::Success(array);
+  return CJS_Result::Success(array);
 }
 
-CJS_Return CJS_Color::SetPropertyHelper(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::SetPropertyHelper(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp,
                                         CFX_Color* var) {
   if (vp.IsEmpty() || !vp->IsArray())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   *var = ConvertArrayToPWLColor(pRuntime, pRuntime->ToArray(vp));
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Color::convert(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::convert(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   int iSize = params.size();
   if (iSize < 2 || params[0].IsEmpty() || !params[0]->IsArray())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString sDestSpace = pRuntime->ToWideString(params[1]);
   int nColorType = CFX_Color::kTransparent;
@@ -287,16 +287,16 @@
   v8::Local<v8::Value> array =
       ConvertPWLColorToArray(pRuntime, color.ConvertColorType(nColorType));
   if (array.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewArray());
+    return CJS_Result::Success(pRuntime->NewArray());
 
-  return CJS_Return::Success(array);
+  return CJS_Result::Success(array);
 }
 
-CJS_Return CJS_Color::equal(CJS_Runtime* pRuntime,
+CJS_Result CJS_Color::equal(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 2 || params[0].IsEmpty() || !params[0]->IsArray() ||
       params[1].IsEmpty() || !params[1]->IsArray()) {
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
   }
 
   CFX_Color color1 =
@@ -305,5 +305,5 @@
       ConvertArrayToPWLColor(pRuntime, pRuntime->ToArray(params[1]));
 
   color1 = color1.ConvertColorType(color2.nColorType);
-  return CJS_Return::Success(pRuntime->NewBoolean(color1 == color2));
+  return CJS_Result::Success(pRuntime->NewBoolean(color1 == color2));
 }
diff --git a/fxjs/cjs_color.h b/fxjs/cjs_color.h
index e1b7caa..aff19d7 100644
--- a/fxjs/cjs_color.h
+++ b/fxjs/cjs_color.h
@@ -46,49 +46,49 @@
   static const JSPropertySpec PropertySpecs[];
   static const JSMethodSpec MethodSpecs[];
 
-  CJS_Return get_black(CJS_Runtime* pRuntime);
-  CJS_Return set_black(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_black(CJS_Runtime* pRuntime);
+  CJS_Result set_black(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_blue(CJS_Runtime* pRuntime);
-  CJS_Return set_blue(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_blue(CJS_Runtime* pRuntime);
+  CJS_Result set_blue(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_cyan(CJS_Runtime* pRuntime);
-  CJS_Return set_cyan(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_cyan(CJS_Runtime* pRuntime);
+  CJS_Result set_cyan(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_dark_gray(CJS_Runtime* pRuntime);
-  CJS_Return set_dark_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_dark_gray(CJS_Runtime* pRuntime);
+  CJS_Result set_dark_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_gray(CJS_Runtime* pRuntime);
-  CJS_Return set_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_gray(CJS_Runtime* pRuntime);
+  CJS_Result set_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_green(CJS_Runtime* pRuntime);
-  CJS_Return set_green(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_green(CJS_Runtime* pRuntime);
+  CJS_Result set_green(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_light_gray(CJS_Runtime* pRuntime);
-  CJS_Return set_light_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_light_gray(CJS_Runtime* pRuntime);
+  CJS_Result set_light_gray(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_magenta(CJS_Runtime* pRuntime);
-  CJS_Return set_magenta(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_magenta(CJS_Runtime* pRuntime);
+  CJS_Result set_magenta(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_red(CJS_Runtime* pRuntime);
-  CJS_Return set_red(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_red(CJS_Runtime* pRuntime);
+  CJS_Result set_red(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_transparent(CJS_Runtime* pRuntime);
-  CJS_Return set_transparent(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_transparent(CJS_Runtime* pRuntime);
+  CJS_Result set_transparent(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_white(CJS_Runtime* pRuntime);
-  CJS_Return set_white(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_white(CJS_Runtime* pRuntime);
+  CJS_Result set_white(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_yellow(CJS_Runtime* pRuntime);
-  CJS_Return set_yellow(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_yellow(CJS_Runtime* pRuntime);
+  CJS_Result set_yellow(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return convert(CJS_Runtime* pRuntime,
+  CJS_Result convert(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return equal(CJS_Runtime* pRuntime,
+  CJS_Result equal(CJS_Runtime* pRuntime,
                    const std::vector<v8::Local<v8::Value>>& params);
 
-  CJS_Return GetPropertyHelper(CJS_Runtime* pRuntime, CFX_Color* val);
-  CJS_Return SetPropertyHelper(CJS_Runtime* pRuntime,
+  CJS_Result GetPropertyHelper(CJS_Runtime* pRuntime, CFX_Color* val);
+  CJS_Result SetPropertyHelper(CJS_Runtime* pRuntime,
                                v8::Local<v8::Value> vp,
                                CFX_Color* val);
 
diff --git a/fxjs/cjs_console.cpp b/fxjs/cjs_console.cpp
index cf95ffa..4d432db 100644
--- a/fxjs/cjs_console.cpp
+++ b/fxjs/cjs_console.cpp
@@ -38,23 +38,23 @@
 
 CJS_Console::~CJS_Console() = default;
 
-CJS_Return CJS_Console::clear(CJS_Runtime* pRuntime,
+CJS_Result CJS_Console::clear(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Console::hide(CJS_Runtime* pRuntime,
+CJS_Result CJS_Console::hide(CJS_Runtime* pRuntime,
                              const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Console::println(
+CJS_Result CJS_Console::println(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Console::show(CJS_Runtime* pRuntime,
+CJS_Result CJS_Console::show(CJS_Runtime* pRuntime,
                              const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
diff --git a/fxjs/cjs_console.h b/fxjs/cjs_console.h
index 236ad47..9ab2555 100644
--- a/fxjs/cjs_console.h
+++ b/fxjs/cjs_console.h
@@ -29,13 +29,13 @@
   static const char kName[];
   static const JSMethodSpec MethodSpecs[];
 
-  CJS_Return clear(CJS_Runtime* pRuntime,
+  CJS_Result clear(CJS_Runtime* pRuntime,
                    const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return hide(CJS_Runtime* pRuntime,
+  CJS_Result hide(CJS_Runtime* pRuntime,
                   const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return println(CJS_Runtime* pRuntime,
+  CJS_Result println(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return show(CJS_Runtime* pRuntime,
+  CJS_Result show(CJS_Runtime* pRuntime,
                   const std::vector<v8::Local<v8::Value>>& params);
 };
 
diff --git a/fxjs/cjs_document.cpp b/fxjs/cjs_document.cpp
index b842c15..486da11 100644
--- a/fxjs/cjs_document.cpp
+++ b/fxjs/cjs_document.cpp
@@ -131,63 +131,63 @@
 CJS_Document::~CJS_Document() = default;
 
 // The total number of fields in document.
-CJS_Return CJS_Document::get_num_fields(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_num_fields(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
-  return CJS_Return::Success(pRuntime->NewNumber(
+  return CJS_Result::Success(pRuntime->NewNumber(
       static_cast<int>(pPDFForm->CountFields(WideString()))));
 }
 
-CJS_Return CJS_Document::set_num_fields(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_num_fields(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::get_dirty(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_dirty(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(!!m_pFormFillEnv->GetChangeMark()));
 }
 
-CJS_Return CJS_Document::set_dirty(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_dirty(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   pRuntime->ToBoolean(vp) ? m_pFormFillEnv->SetChangeMark()
                           : m_pFormFillEnv->ClearChangeMark();
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_ADBE(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewUndefined());
+CJS_Result CJS_Document::get_ADBE(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewUndefined());
 }
 
-CJS_Return CJS_Document::set_ADBE(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_ADBE(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_page_num(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_page_num(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetCurrentView();
   if (!pPageView)
-    return CJS_Return::Success(pRuntime->NewUndefined());
+    return CJS_Result::Success(pRuntime->NewUndefined());
 
-  return CJS_Return::Success(pRuntime->NewNumber(pPageView->GetPageIndex()));
+  return CJS_Result::Success(pRuntime->NewNumber(pPageView->GetPageIndex()));
 }
 
-CJS_Return CJS_Document::set_page_num(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_page_num(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int iPageCount = m_pFormFillEnv->GetPageCount();
   int iPageNum = pRuntime->ToInt32(vp);
@@ -198,131 +198,131 @@
   else if (iPageNum < 0)
     m_pFormFillEnv->JS_docgotoPage(0);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::addAnnot(
+CJS_Result CJS_Document::addAnnot(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Not supported, but do not return an error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::addField(
+CJS_Result CJS_Document::addField(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Not supported, but do not return an error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::exportAsText(
+CJS_Result CJS_Document::exportAsText(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return an error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::exportAsFDF(
+CJS_Result CJS_Document::exportAsFDF(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return an error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::exportAsXFDF(
+CJS_Result CJS_Document::exportAsXFDF(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return an error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getField(
+CJS_Result CJS_Document::getField(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString wideName = pRuntime->ToWideString(params[0]);
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
   if (pPDFForm->CountFields(wideName) <= 0)
-    return CJS_Return::Success(pRuntime->NewUndefined());
+    return CJS_Result::Success(pRuntime->NewUndefined());
 
   v8::Local<v8::Object> pFieldObj = pRuntime->NewFXJSBoundObject(
       CJS_Field::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pFieldObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto* pJSField =
       static_cast<CJS_Field*>(CFXJS_Engine::GetObjectPrivate(pFieldObj));
   if (!pJSField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   pJSField->AttachField(this, wideName);
-  return CJS_Return::Success(pJSField->ToV8Object());
+  return CJS_Result::Success(pJSField->ToV8Object());
 }
 
 // Gets the name of the nth field in the document
-CJS_Return CJS_Document::getNthFieldName(
+CJS_Result CJS_Document::getNthFieldName(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int nIndex = pRuntime->ToInt32(params[0]);
   if (nIndex < 0)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDF_InterForm* pPDFForm = pInterForm->GetInterForm();
   CPDF_FormField* pField = pPDFForm->GetField(nIndex, WideString());
   if (!pField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success(
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success(
       pRuntime->NewString(pField->GetFullName().AsStringView()));
 }
 
-CJS_Return CJS_Document::importAnFDF(
+CJS_Result CJS_Document::importAnFDF(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::importAnXFDF(
+CJS_Result CJS_Document::importAnXFDF(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::importTextData(
+CJS_Result CJS_Document::importTextData(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // exports the form data and mails the resulting fdf file as an attachment to
 // all recipients.
 // comment: need reader supports
-CJS_Return CJS_Document::mailForm(
+CJS_Result CJS_Document::mailForm(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_pFormFillEnv->GetPermissions(FPDFPERM_EXTRACT_ACCESS))
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   ByteString sTextBuf = pInterForm->ExportFormToFDFTextBuf();
   if (sTextBuf.GetLength() == 0)
-    return CJS_Return::Failure(L"Bad FDF format.");
+    return CJS_Result::Failure(L"Bad FDF format.");
 
   size_t nLength = params.size();
   bool bUI = nLength > 0 ? pRuntime->ToBoolean(params[0]) : true;
@@ -338,14 +338,14 @@
   pFormFillEnv->JS_docmailForm(mutable_buf.data(), mutable_buf.size(), bUI, cTo,
                                cSubject, cCc, cBcc, cMsg);
   pRuntime->EndBlock();
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::print(
+CJS_Result CJS_Document::print(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   bool bUI = true;
   int nStart = 0;
@@ -391,35 +391,35 @@
   }
 
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   m_pFormFillEnv->JS_docprint(bUI, nStart, nEnd, bSilent, bShrinkToFit,
                               bPrintAsImage, bReverse, bAnnotations);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // removes the specified field from the document.
 // comment:
 // note: if the filed name is not rational, adobe is dumb for it.
 
-CJS_Return CJS_Document::removeField(
+CJS_Result CJS_Document::removeField(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!(m_pFormFillEnv->GetPermissions(FPDFPERM_MODIFY) ||
         m_pFormFillEnv->GetPermissions(FPDFPERM_ANNOT_FORM)))
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
 
   WideString sFieldName = pRuntime->ToWideString(params[0]);
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   std::vector<CPDFSDK_Annot::ObservedPtr> widgets;
   pInterForm->GetWidgets(sFieldName, &widgets);
   if (widgets.empty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   for (const auto& pAnnot : widgets) {
     CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot.Get());
@@ -449,22 +449,22 @@
   }
   m_pFormFillEnv->SetChangeMark();
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // reset filed values within a document.
 // comment:
 // note: if the fields names r not rational, aodbe is dumb for it.
 
-CJS_Return CJS_Document::resetForm(
+CJS_Result CJS_Document::resetForm(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!(m_pFormFillEnv->GetPermissions(FPDFPERM_MODIFY) ||
         m_pFormFillEnv->GetPermissions(FPDFPERM_ANNOT_FORM) ||
         m_pFormFillEnv->GetPermissions(FPDFPERM_FILL_FORM))) {
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
   }
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
@@ -472,7 +472,7 @@
   if (params.empty()) {
     pPDFForm->ResetForm(NotificationOption::kNotify);
     m_pFormFillEnv->SetChangeMark();
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   v8::Local<v8::Array> array;
@@ -496,30 +496,30 @@
     m_pFormFillEnv->SetChangeMark();
   }
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::saveAs(
+CJS_Result CJS_Document::saveAs(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::syncAnnotScan(
+CJS_Result CJS_Document::syncAnnotScan(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::submitForm(
+CJS_Result CJS_Document::submitForm(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   size_t nSize = params.size();
   if (nSize < 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   v8::Local<v8::Array> aFields;
   WideString strURL;
@@ -553,7 +553,7 @@
       pInterForm->SubmitForm(strURL, false);
       pRuntime->EndBlock();
     }
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   std::vector<CPDF_FormField*> fieldObjects;
@@ -575,23 +575,23 @@
     pInterForm->SubmitFields(strURL, fieldObjects, true, !bFDF);
     pRuntime->EndBlock();
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJS_Document::SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) {
   m_pFormFillEnv.Reset(pFormFillEnv);
 }
 
-CJS_Return CJS_Document::get_bookmark_root(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_bookmark_root(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_bookmark_root(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_bookmark_root(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::mailDoc(
+CJS_Result CJS_Document::mailDoc(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // TODO(tsepez): Check maximum number of allowed params.
@@ -631,25 +631,25 @@
   CPDFSDK_FormFillEnvironment* pFormFillEnv = pRuntime->GetFormFillEnv();
   pFormFillEnv->JS_docmailForm(nullptr, 0, bUI, cTo, cSubject, cCc, cBcc, cMsg);
   pRuntime->EndBlock();
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_author(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_author(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "Author");
 }
 
-CJS_Return CJS_Document::set_author(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_author(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "Author");
 }
 
-CJS_Return CJS_Document::get_info(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_info(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   const auto* pDictionary = m_pFormFillEnv->GetPDFDocument()->GetInfo();
   if (!pDictionary)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString cwAuthor = pDictionary->GetUnicodeTextFor("Author");
   WideString cwTitle = pDictionary->GetUnicodeTextFor("Title");
@@ -699,81 +699,81 @@
           pObj, wsKey, pRuntime->NewBoolean(!!pValueObj->GetInteger()));
     }
   }
-  return CJS_Return::Success(pObj);
+  return CJS_Result::Success(pObj);
 }
 
-CJS_Return CJS_Document::set_info(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_info(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::getPropertyInternal(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::getPropertyInternal(CJS_Runtime* pRuntime,
                                              const ByteString& propName) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_Dictionary* pDictionary = m_pFormFillEnv->GetPDFDocument()->GetInfo();
   if (!pDictionary)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success(pRuntime->NewString(
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success(pRuntime->NewString(
       pDictionary->GetUnicodeTextFor(propName).AsStringView()));
 }
 
-CJS_Return CJS_Document::setPropertyInternal(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::setPropertyInternal(CJS_Runtime* pRuntime,
                                              v8::Local<v8::Value> vp,
                                              const ByteString& propName) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_Dictionary* pDictionary = m_pFormFillEnv->GetPDFDocument()->GetInfo();
   if (!pDictionary)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!m_pFormFillEnv->GetPermissions(FPDFPERM_MODIFY))
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
 
   WideString csProperty = pRuntime->ToWideString(vp);
   pDictionary->SetNewFor<CPDF_String>(propName, PDF_EncodeText(csProperty),
                                       false);
   m_pFormFillEnv->SetChangeMark();
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_creation_date(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_creation_date(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "CreationDate");
 }
 
-CJS_Return CJS_Document::set_creation_date(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_creation_date(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "CreationDate");
 }
 
-CJS_Return CJS_Document::get_creator(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_creator(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "Creator");
 }
 
-CJS_Return CJS_Document::set_creator(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_creator(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "Creator");
 }
 
-CJS_Return CJS_Document::get_delay(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_delay(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success(pRuntime->NewBoolean(m_bDelay));
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success(pRuntime->NewBoolean(m_bDelay));
 }
 
-CJS_Return CJS_Document::set_delay(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_delay(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_pFormFillEnv->GetPermissions(FPDFPERM_MODIFY))
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
 
   m_bDelay = pRuntime->ToBoolean(vp);
   if (m_bDelay) {
     m_DelayData.clear();
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   std::list<std::unique_ptr<CJS_DelayData>> DelayDataToProcess;
@@ -781,151 +781,151 @@
   for (const auto& pData : DelayDataToProcess)
     CJS_Field::DoDelay(m_pFormFillEnv.Get(), pData.get());
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_keywords(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_keywords(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "Keywords");
 }
 
-CJS_Return CJS_Document::set_keywords(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_keywords(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "Keywords");
 }
 
-CJS_Return CJS_Document::get_mod_date(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_mod_date(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "ModDate");
 }
 
-CJS_Return CJS_Document::set_mod_date(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_mod_date(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "ModDate");
 }
 
-CJS_Return CJS_Document::get_producer(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_producer(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "Producer");
 }
 
-CJS_Return CJS_Document::set_producer(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_producer(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "Producer");
 }
 
-CJS_Return CJS_Document::get_subject(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_subject(CJS_Runtime* pRuntime) {
   return getPropertyInternal(pRuntime, "Subject");
 }
 
-CJS_Return CJS_Document::set_subject(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_subject(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   return setPropertyInternal(pRuntime, vp, "Subject");
 }
 
-CJS_Return CJS_Document::get_title(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_title(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv || !m_pFormFillEnv->GetPDFDocument())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   return getPropertyInternal(pRuntime, "Title");
 }
 
-CJS_Return CJS_Document::set_title(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_title(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   if (!m_pFormFillEnv || !m_pFormFillEnv->GetPDFDocument())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   return setPropertyInternal(pRuntime, vp, "Title");
 }
 
-CJS_Return CJS_Document::get_num_pages(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_num_pages(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success(
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success(
       pRuntime->NewNumber(m_pFormFillEnv->GetPageCount()));
 }
 
-CJS_Return CJS_Document::set_num_pages(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_num_pages(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::get_external(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_external(CJS_Runtime* pRuntime) {
   // In Chrome case, should always return true.
-  return CJS_Return::Success(pRuntime->NewBoolean(true));
+  return CJS_Result::Success(pRuntime->NewBoolean(true));
 }
 
-CJS_Return CJS_Document::set_external(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_external(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_filesize(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewNumber(0));
+CJS_Result CJS_Document::get_filesize(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewNumber(0));
 }
 
-CJS_Return CJS_Document::set_filesize(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_filesize(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::get_mouse_x(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_mouse_x(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_mouse_x(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_mouse_x(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_mouse_y(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_mouse_y(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_mouse_y(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_mouse_y(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_URL(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_URL(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success(
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success(
       pRuntime->NewString(m_pFormFillEnv->JS_docGetFilePath().AsStringView()));
 }
 
-CJS_Return CJS_Document::set_URL(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_URL(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::get_base_URL(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewString(m_cwBaseURL.AsStringView()));
+CJS_Result CJS_Document::get_base_URL(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewString(m_cwBaseURL.AsStringView()));
 }
 
-CJS_Return CJS_Document::set_base_URL(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_base_URL(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   m_cwBaseURL = pRuntime->ToWideString(vp);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_calculate(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_calculate(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(!!pInterForm->IsCalculateEnabled()));
 }
 
-CJS_Return CJS_Document::set_calculate(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_calculate(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   pInterForm->EnableCalculate(pRuntime->ToBoolean(vp));
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_document_file_name(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_document_file_name(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString wsFilePath = m_pFormFillEnv->JS_docGetFilePath();
   size_t i = wsFilePath.GetLength();
@@ -934,78 +934,78 @@
       break;
   }
   if (i > 0 && i < wsFilePath.GetLength())
-    return CJS_Return::Success(pRuntime->NewString(wsFilePath.c_str() + i));
+    return CJS_Result::Success(pRuntime->NewString(wsFilePath.c_str() + i));
 
-  return CJS_Return::Success(pRuntime->NewString(L""));
+  return CJS_Result::Success(pRuntime->NewString(L""));
 }
 
-CJS_Return CJS_Document::set_document_file_name(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_document_file_name(CJS_Runtime* pRuntime,
                                                 v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::get_path(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_path(CJS_Runtime* pRuntime) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success(pRuntime->NewString(
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success(pRuntime->NewString(
       CJS_App::SysPathToPDFPath(m_pFormFillEnv->JS_docGetFilePath())
           .AsStringView()));
 }
 
-CJS_Return CJS_Document::set_path(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_path(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::get_page_window_rect(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_page_window_rect(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_page_window_rect(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_page_window_rect(CJS_Runtime* pRuntime,
                                               v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_layout(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_layout(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_layout(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_layout(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::addLink(
+CJS_Result CJS_Document::addLink(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::closeDoc(
+CJS_Result CJS_Document::closeDoc(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getPageBox(
+CJS_Result CJS_Document::getPageBox(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getAnnot(
+CJS_Result CJS_Document::getAnnot(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int nPageNo = pRuntime->ToInt32(params[0]);
   WideString swAnnotName = pRuntime->ToWideString(params[1]);
   CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(nPageNo);
   if (!pPageView)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_AnnotIteration annotIteration(pPageView, false);
   CPDFSDK_BAAnnot* pSDKBAAnnot = nullptr;
@@ -1017,27 +1017,27 @@
     }
   }
   if (!pSDKBAAnnot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   v8::Local<v8::Object> pObj = pRuntime->NewFXJSBoundObject(
       CJS_Annot::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto* pJS_Annot =
       static_cast<CJS_Annot*>(CFXJS_Engine::GetObjectPrivate(pObj));
   if (!pJS_Annot)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   pJS_Annot->SetSDKAnnot(pSDKBAAnnot);
-  return CJS_Return::Success(pJS_Annot->ToV8Object());
+  return CJS_Result::Success(pJS_Annot->ToV8Object());
 }
 
-CJS_Return CJS_Document::getAnnots(
+CJS_Result CJS_Document::getAnnots(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   // TODO(tonikitoo): Add support supported parameters as per
   // the PDF spec.
@@ -1047,17 +1047,17 @@
   for (int i = 0; i < nPageNo; ++i) {
     CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(i);
     if (!pPageView)
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
 
     CPDFSDK_AnnotIteration annotIteration(pPageView, false);
     for (const auto& pSDKAnnotCur : annotIteration) {
       if (!pSDKAnnotCur)
-        return CJS_Return::Failure(JSMessage::kBadObjectError);
+        return CJS_Result::Failure(JSMessage::kBadObjectError);
 
       v8::Local<v8::Object> pObj = pRuntime->NewFXJSBoundObject(
           CJS_Annot::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
       if (pObj.IsEmpty())
-        return CJS_Return::Failure(JSMessage::kBadObjectError);
+        return CJS_Result::Failure(JSMessage::kBadObjectError);
 
       auto* pJS_Annot =
           static_cast<CJS_Annot*>(CFXJS_Engine::GetObjectPrivate(pObj));
@@ -1068,31 +1068,31 @@
                     : v8::Local<v8::Value>());
     }
   }
-  return CJS_Return::Success(annots);
+  return CJS_Result::Success(annots);
 }
 
-CJS_Return CJS_Document::getAnnot3D(
+CJS_Result CJS_Document::getAnnot3D(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success(pRuntime->NewUndefined());
+  return CJS_Result::Success(pRuntime->NewUndefined());
 }
 
-CJS_Return CJS_Document::getAnnots3D(
+CJS_Result CJS_Document::getAnnots3D(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getOCGs(
+CJS_Result CJS_Document::getOCGs(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getLinks(
+CJS_Result CJS_Document::getLinks(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 bool CJS_Document::IsEnclosedInRect(CFX_FloatRect rect,
@@ -1101,27 +1101,27 @@
           rect.right >= LinkRect.right && rect.bottom >= LinkRect.bottom);
 }
 
-CJS_Return CJS_Document::addIcon(
+CJS_Result CJS_Document::addIcon(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if (!params[1]->IsObject())
-    return CJS_Return::Failure(JSMessage::kTypeError);
+    return CJS_Result::Failure(JSMessage::kTypeError);
 
   v8::Local<v8::Object> pObj = pRuntime->ToObject(params[1]);
   if (!JSGetObject<CJS_Icon>(pObj))
-    return CJS_Return::Failure(JSMessage::kTypeError);
+    return CJS_Result::Failure(JSMessage::kTypeError);
 
   WideString swIconName = pRuntime->ToWideString(params[0]);
   m_IconNames.push_back(swIconName);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_icons(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Document::get_icons(CJS_Runtime* pRuntime) {
   if (m_IconNames.empty())
-    return CJS_Return::Success(pRuntime->NewUndefined());
+    return CJS_Result::Success(pRuntime->NewUndefined());
 
   v8::Local<v8::Array> Icons = pRuntime->NewArray();
   int i = 0;
@@ -1129,7 +1129,7 @@
     v8::Local<v8::Object> pObj = pRuntime->NewFXJSBoundObject(
         CJS_Icon::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
     if (pObj.IsEmpty())
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
 
     auto* pJS_Icon =
         static_cast<CJS_Icon*>(CFXJS_Engine::GetObjectPrivate(pObj));
@@ -1139,93 +1139,93 @@
                                   ? v8::Local<v8::Value>(pJS_Icon->ToV8Object())
                                   : v8::Local<v8::Value>());
   }
-  return CJS_Return::Success(Icons);
+  return CJS_Result::Success(Icons);
 }
 
-CJS_Return CJS_Document::set_icons(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_icons(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Document::getIcon(
+CJS_Result CJS_Document::getIcon(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString swIconName = pRuntime->ToWideString(params[0]);
   auto it = std::find(m_IconNames.begin(), m_IconNames.end(), swIconName);
   if (it == m_IconNames.end())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   v8::Local<v8::Object> pObj = pRuntime->NewFXJSBoundObject(
       CJS_Icon::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto* pJSIcon = static_cast<CJS_Icon*>(CFXJS_Engine::GetObjectPrivate(pObj));
   if (!pJSIcon)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   pJSIcon->SetIconName(*it);
-  return CJS_Return::Success(pJSIcon->ToV8Object());
+  return CJS_Result::Success(pJSIcon->ToV8Object());
 }
 
-CJS_Return CJS_Document::removeIcon(
+CJS_Result CJS_Document::removeIcon(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, no supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::createDataObject(
+CJS_Result CJS_Document::createDataObject(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not implemented.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_media(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_media(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_media(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_media(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::calculateNow(
+CJS_Result CJS_Document::calculateNow(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!(m_pFormFillEnv->GetPermissions(FPDFPERM_MODIFY) ||
         m_pFormFillEnv->GetPermissions(FPDFPERM_ANNOT_FORM) ||
         m_pFormFillEnv->GetPermissions(FPDFPERM_FILL_FORM))) {
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
   }
 
   m_pFormFillEnv->GetInterForm()->OnCalculate(nullptr);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_collab(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_collab(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_collab(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_collab(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getPageNthWord(
+CJS_Result CJS_Document::getPageNthWord(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_pFormFillEnv->GetPermissions(FPDFPERM_EXTRACT_ACCESS))
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
 
   // TODO(tsepez): check maximum allowable params.
 
@@ -1235,14 +1235,14 @@
 
   CPDF_Document* pDocument = m_pFormFillEnv->GetPDFDocument();
   if (!pDocument)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   CPDF_Dictionary* pPageDict = pDocument->GetPageDictionary(nPageNo);
   if (!pPageDict)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto page = pdfium::MakeRetain<CPDF_Page>(pDocument, pPageDict, true);
   page->ParseContent();
@@ -1263,35 +1263,35 @@
 
   if (bStrip)
     swRet.Trim();
-  return CJS_Return::Success(pRuntime->NewString(swRet.AsStringView()));
+  return CJS_Result::Success(pRuntime->NewString(swRet.AsStringView()));
 }
 
-CJS_Return CJS_Document::getPageNthWordQuads(
+CJS_Result CJS_Document::getPageNthWordQuads(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_pFormFillEnv->GetPermissions(FPDFPERM_EXTRACT_ACCESS))
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Document::getPageNumWords(
+CJS_Result CJS_Document::getPageNumWords(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_pFormFillEnv->GetPermissions(FPDFPERM_EXTRACT_ACCESS))
-    return CJS_Return::Failure(JSMessage::kPermissionError);
+    return CJS_Result::Failure(JSMessage::kPermissionError);
 
   int nPageNo = params.size() > 0 ? pRuntime->ToInt32(params[0]) : 0;
   CPDF_Document* pDocument = m_pFormFillEnv->GetPDFDocument();
   if (nPageNo < 0 || nPageNo >= pDocument->GetPageCount())
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   CPDF_Dictionary* pPageDict = pDocument->GetPageDictionary(nPageNo);
   if (!pPageDict)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto page = pdfium::MakeRetain<CPDF_Page>(pDocument, pPageDict, true);
   page->ParseContent();
@@ -1302,17 +1302,17 @@
       nWords += CountWords(pPageObj->AsText());
   }
 
-  return CJS_Return::Success(pRuntime->NewNumber(nWords));
+  return CJS_Result::Success(pRuntime->NewNumber(nWords));
 }
 
-CJS_Return CJS_Document::getPrintParams(
+CJS_Result CJS_Document::getPrintParams(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   v8::Local<v8::Object> pRetObj = pRuntime->NewFXJSBoundObject(
       CJS_PrintParamsObj::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pRetObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
 #define ISLATINWORD(u) (u != 0x20 && u <= 0x28FF)
@@ -1385,77 +1385,77 @@
   return swRet;
 }
 
-CJS_Return CJS_Document::get_zoom(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_zoom(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_zoom(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_zoom(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::get_zoom_type(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Document::get_zoom_type(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::set_zoom_type(CJS_Runtime* pRuntime,
+CJS_Result CJS_Document::set_zoom_type(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::deletePages(
+CJS_Result CJS_Document::deletePages(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::extractPages(
+CJS_Result CJS_Document::extractPages(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::insertPages(
+CJS_Result CJS_Document::insertPages(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::replacePages(
+CJS_Result CJS_Document::replacePages(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::getURL(
+CJS_Result CJS_Document::getURL(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Document::gotoNamedDest(
+CJS_Result CJS_Document::gotoNamedDest(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if (!m_pFormFillEnv)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_Document* pDocument = m_pFormFillEnv->GetPDFDocument();
   if (!pDocument)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_NameTree nameTree(pDocument, "Dests");
   CPDF_Array* destArray =
       nameTree.LookupNamedDest(pDocument, pRuntime->ToWideString(params[0]));
   if (!destArray)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_Dest dest(destArray);
   const CPDF_Array* arrayObject = ToArray(dest.GetObject());
@@ -1469,7 +1469,7 @@
                                dest.GetZoomMode(), scrollPositionArray.data(),
                                scrollPositionArray.size());
   pRuntime->EndBlock();
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJS_Document::AddDelayData(std::unique_ptr<CJS_DelayData> pData) {
diff --git a/fxjs/cjs_document.h b/fxjs/cjs_document.h
index 2af617f..69a0b65 100644
--- a/fxjs/cjs_document.h
+++ b/fxjs/cjs_document.h
@@ -114,197 +114,197 @@
   static const JSPropertySpec PropertySpecs[];
   static const JSMethodSpec MethodSpecs[];
 
-  CJS_Return get_ADBE(CJS_Runtime* pRuntime);
-  CJS_Return set_ADBE(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_ADBE(CJS_Runtime* pRuntime);
+  CJS_Result set_ADBE(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_author(CJS_Runtime* pRuntime);
-  CJS_Return set_author(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_author(CJS_Runtime* pRuntime);
+  CJS_Result set_author(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_base_URL(CJS_Runtime* pRuntime);
-  CJS_Return set_base_URL(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_base_URL(CJS_Runtime* pRuntime);
+  CJS_Result set_base_URL(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_bookmark_root(CJS_Runtime* pRuntime);
-  CJS_Return set_bookmark_root(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_bookmark_root(CJS_Runtime* pRuntime);
+  CJS_Result set_bookmark_root(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_calculate(CJS_Runtime* pRuntime);
-  CJS_Return set_calculate(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_calculate(CJS_Runtime* pRuntime);
+  CJS_Result set_calculate(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_collab(CJS_Runtime* pRuntime);
-  CJS_Return set_collab(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_collab(CJS_Runtime* pRuntime);
+  CJS_Result set_collab(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_creation_date(CJS_Runtime* pRuntime);
-  CJS_Return set_creation_date(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_creation_date(CJS_Runtime* pRuntime);
+  CJS_Result set_creation_date(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_creator(CJS_Runtime* pRuntime);
-  CJS_Return set_creator(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_creator(CJS_Runtime* pRuntime);
+  CJS_Result set_creator(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_delay(CJS_Runtime* pRuntime);
-  CJS_Return set_delay(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_delay(CJS_Runtime* pRuntime);
+  CJS_Result set_delay(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_dirty(CJS_Runtime* pRuntime);
-  CJS_Return set_dirty(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_dirty(CJS_Runtime* pRuntime);
+  CJS_Result set_dirty(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_document_file_name(CJS_Runtime* pRuntime);
-  CJS_Return set_document_file_name(CJS_Runtime* pRuntime,
+  CJS_Result get_document_file_name(CJS_Runtime* pRuntime);
+  CJS_Result set_document_file_name(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp);
 
-  CJS_Return get_external(CJS_Runtime* pRuntime);
-  CJS_Return set_external(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_external(CJS_Runtime* pRuntime);
+  CJS_Result set_external(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_filesize(CJS_Runtime* pRuntime);
-  CJS_Return set_filesize(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_filesize(CJS_Runtime* pRuntime);
+  CJS_Result set_filesize(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_icons(CJS_Runtime* pRuntime);
-  CJS_Return set_icons(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_icons(CJS_Runtime* pRuntime);
+  CJS_Result set_icons(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_info(CJS_Runtime* pRuntime);
-  CJS_Return set_info(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_info(CJS_Runtime* pRuntime);
+  CJS_Result set_info(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_keywords(CJS_Runtime* pRuntime);
-  CJS_Return set_keywords(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_keywords(CJS_Runtime* pRuntime);
+  CJS_Result set_keywords(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_layout(CJS_Runtime* pRuntime);
-  CJS_Return set_layout(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_layout(CJS_Runtime* pRuntime);
+  CJS_Result set_layout(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_media(CJS_Runtime* pRuntime);
-  CJS_Return set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_media(CJS_Runtime* pRuntime);
+  CJS_Result set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_mod_date(CJS_Runtime* pRuntime);
-  CJS_Return set_mod_date(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_mod_date(CJS_Runtime* pRuntime);
+  CJS_Result set_mod_date(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_mouse_x(CJS_Runtime* pRuntime);
-  CJS_Return set_mouse_x(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_mouse_x(CJS_Runtime* pRuntime);
+  CJS_Result set_mouse_x(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_mouse_y(CJS_Runtime* pRuntime);
-  CJS_Return set_mouse_y(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_mouse_y(CJS_Runtime* pRuntime);
+  CJS_Result set_mouse_y(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_num_fields(CJS_Runtime* pRuntime);
-  CJS_Return set_num_fields(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_num_fields(CJS_Runtime* pRuntime);
+  CJS_Result set_num_fields(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_num_pages(CJS_Runtime* pRuntime);
-  CJS_Return set_num_pages(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_num_pages(CJS_Runtime* pRuntime);
+  CJS_Result set_num_pages(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_page_num(CJS_Runtime* pRuntime);
-  CJS_Return set_page_num(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_page_num(CJS_Runtime* pRuntime);
+  CJS_Result set_page_num(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_page_window_rect(CJS_Runtime* pRuntime);
-  CJS_Return set_page_window_rect(CJS_Runtime* pRuntime,
+  CJS_Result get_page_window_rect(CJS_Runtime* pRuntime);
+  CJS_Result set_page_window_rect(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp);
 
-  CJS_Return get_path(CJS_Runtime* pRuntime);
-  CJS_Return set_path(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_path(CJS_Runtime* pRuntime);
+  CJS_Result set_path(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_producer(CJS_Runtime* pRuntime);
-  CJS_Return set_producer(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_producer(CJS_Runtime* pRuntime);
+  CJS_Result set_producer(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_subject(CJS_Runtime* pRuntime);
-  CJS_Return set_subject(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_subject(CJS_Runtime* pRuntime);
+  CJS_Result set_subject(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_title(CJS_Runtime* pRuntime);
-  CJS_Return set_title(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_title(CJS_Runtime* pRuntime);
+  CJS_Result set_title(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_zoom(CJS_Runtime* pRuntime);
-  CJS_Return set_zoom(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_zoom(CJS_Runtime* pRuntime);
+  CJS_Result set_zoom(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_zoom_type(CJS_Runtime* pRuntime);
-  CJS_Return set_zoom_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_zoom_type(CJS_Runtime* pRuntime);
+  CJS_Result set_zoom_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_URL(CJS_Runtime* pRuntime);
-  CJS_Return set_URL(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_URL(CJS_Runtime* pRuntime);
+  CJS_Result set_URL(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return addAnnot(CJS_Runtime* pRuntime,
+  CJS_Result addAnnot(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return addField(CJS_Runtime* pRuntime,
+  CJS_Result addField(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return addLink(CJS_Runtime* pRuntime,
+  CJS_Result addLink(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return addIcon(CJS_Runtime* pRuntime,
+  CJS_Result addIcon(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return calculateNow(CJS_Runtime* pRuntime,
+  CJS_Result calculateNow(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return closeDoc(CJS_Runtime* pRuntime,
+  CJS_Result closeDoc(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return createDataObject(CJS_Runtime* pRuntime,
+  CJS_Result createDataObject(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return deletePages(CJS_Runtime* pRuntime,
+  CJS_Result deletePages(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return exportAsText(CJS_Runtime* pRuntime,
+  CJS_Result exportAsText(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return exportAsFDF(CJS_Runtime* pRuntime,
+  CJS_Result exportAsFDF(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return exportAsXFDF(CJS_Runtime* pRuntime,
+  CJS_Result exportAsXFDF(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return extractPages(CJS_Runtime* pRuntime,
+  CJS_Result extractPages(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getAnnot(CJS_Runtime* pRuntime,
+  CJS_Result getAnnot(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getAnnots(CJS_Runtime* pRuntime,
+  CJS_Result getAnnots(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getAnnot3D(CJS_Runtime* pRuntime,
+  CJS_Result getAnnot3D(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getAnnots3D(CJS_Runtime* pRuntime,
+  CJS_Result getAnnots3D(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getField(CJS_Runtime* pRuntime,
+  CJS_Result getField(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getIcon(CJS_Runtime* pRuntime,
+  CJS_Result getIcon(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getLinks(CJS_Runtime* pRuntime,
+  CJS_Result getLinks(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getNthFieldName(CJS_Runtime* pRuntime,
+  CJS_Result getNthFieldName(CJS_Runtime* pRuntime,
                              const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getOCGs(CJS_Runtime* pRuntime,
+  CJS_Result getOCGs(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getPageBox(CJS_Runtime* pRuntime,
+  CJS_Result getPageBox(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getPageNthWord(CJS_Runtime* pRuntime,
+  CJS_Result getPageNthWord(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getPageNthWordQuads(
+  CJS_Result getPageNthWordQuads(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getPageNumWords(CJS_Runtime* pRuntime,
+  CJS_Result getPageNumWords(CJS_Runtime* pRuntime,
                              const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getPrintParams(CJS_Runtime* pRuntime,
+  CJS_Result getPrintParams(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getURL(CJS_Runtime* pRuntime,
+  CJS_Result getURL(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return gotoNamedDest(CJS_Runtime* pRuntime,
+  CJS_Result gotoNamedDest(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return importAnFDF(CJS_Runtime* pRuntime,
+  CJS_Result importAnFDF(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return importAnXFDF(CJS_Runtime* pRuntime,
+  CJS_Result importAnXFDF(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return importTextData(CJS_Runtime* pRuntime,
+  CJS_Result importTextData(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return insertPages(CJS_Runtime* pRuntime,
+  CJS_Result insertPages(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return mailForm(CJS_Runtime* pRuntime,
+  CJS_Result mailForm(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return print(CJS_Runtime* pRuntime,
+  CJS_Result print(CJS_Runtime* pRuntime,
                    const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return removeField(CJS_Runtime* pRuntime,
+  CJS_Result removeField(CJS_Runtime* pRuntime,
                          const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return replacePages(CJS_Runtime* pRuntime,
+  CJS_Result replacePages(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return resetForm(CJS_Runtime* pRuntime,
+  CJS_Result resetForm(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return saveAs(CJS_Runtime* pRuntime,
+  CJS_Result saveAs(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return submitForm(CJS_Runtime* pRuntime,
+  CJS_Result submitForm(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return syncAnnotScan(CJS_Runtime* pRuntime,
+  CJS_Result syncAnnotScan(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return mailDoc(CJS_Runtime* pRuntime,
+  CJS_Result mailDoc(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return removeIcon(CJS_Runtime* pRuntime,
+  CJS_Result removeIcon(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
 
   bool IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect);
   int CountWords(CPDF_TextObject* pTextObj);
   WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex);
 
-  CJS_Return getPropertyInternal(CJS_Runtime* pRuntime,
+  CJS_Result getPropertyInternal(CJS_Runtime* pRuntime,
                                  const ByteString& propName);
-  CJS_Return setPropertyInternal(CJS_Runtime* pRuntime,
+  CJS_Result setPropertyInternal(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp,
                                  const ByteString& propName);
 
diff --git a/fxjs/cjs_event.cpp b/fxjs/cjs_event.cpp
index f00f07c..0895d9c 100644
--- a/fxjs/cjs_event.cpp
+++ b/fxjs/cjs_event.cpp
@@ -54,14 +54,14 @@
 
 CJS_Event::~CJS_Event() = default;
 
-CJS_Return CJS_Event::get_change(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_change(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pEvent->Change().AsStringView()));
 }
 
-CJS_Return CJS_Event::set_change(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_change(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
   ASSERT(pRuntime->GetCurrentEventContext());
 
@@ -72,129 +72,129 @@
     WideString& wChange = pEvent->Change();
     wChange = pRuntime->ToWideString(vp);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_change_ex(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_change_ex(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pEvent->ChangeEx().AsStringView()));
 }
 
-CJS_Return CJS_Event::set_change_ex(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_change_ex(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_commit_key(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_commit_key(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewNumber(pEvent->CommitKey()));
+  return CJS_Result::Success(pRuntime->NewNumber(pEvent->CommitKey()));
 }
 
-CJS_Return CJS_Event::set_commit_key(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_commit_key(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_field_full(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_field_full(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
   if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0)
-    return CJS_Return::Failure(L"unrecognized event");
+    return CJS_Result::Failure(L"unrecognized event");
 
-  return CJS_Return::Success(pRuntime->NewBoolean(pEvent->FieldFull()));
+  return CJS_Result::Success(pRuntime->NewBoolean(pEvent->FieldFull()));
 }
 
-CJS_Return CJS_Event::set_field_full(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_field_full(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_key_down(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_key_down(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewBoolean(pEvent->KeyDown()));
+  return CJS_Result::Success(pRuntime->NewBoolean(pEvent->KeyDown()));
 }
 
-CJS_Return CJS_Event::set_key_down(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_key_down(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_modifier(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_modifier(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewBoolean(pEvent->Modifier()));
+  return CJS_Result::Success(pRuntime->NewBoolean(pEvent->Modifier()));
 }
 
-CJS_Return CJS_Event::set_modifier(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_modifier(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_name(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_name(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewString(pEvent->Name()));
+  return CJS_Result::Success(pRuntime->NewString(pEvent->Name()));
 }
 
-CJS_Return CJS_Event::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Event::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_rc(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_rc(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewBoolean(pEvent->Rc()));
+  return CJS_Result::Success(pRuntime->NewBoolean(pEvent->Rc()));
 }
 
-CJS_Return CJS_Event::set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Event::set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
   pEvent->Rc() = pRuntime->ToBoolean(vp);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_rich_change(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Event::get_rich_change(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::set_rich_change(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_rich_change(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_rich_change_ex(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Event::get_rich_change_ex(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::set_rich_change_ex(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_rich_change_ex(CJS_Runtime* pRuntime,
                                          v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_rich_value(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Event::get_rich_value(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::set_rich_value(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_rich_value(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_sel_end(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_sel_end(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
 
   if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
-  return CJS_Return::Success(pRuntime->NewNumber(pEvent->SelEnd()));
+  return CJS_Result::Success(pRuntime->NewNumber(pEvent->SelEnd()));
 }
 
-CJS_Return CJS_Event::set_sel_end(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_sel_end(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
@@ -202,20 +202,20 @@
   if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") == 0)
     pEvent->SetSelEnd(pRuntime->ToInt32(vp));
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_sel_start(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_sel_start(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
 
   if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") != 0)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
-  return CJS_Return::Success(pRuntime->NewNumber(pEvent->SelStart()));
+  return CJS_Result::Success(pRuntime->NewNumber(pEvent->SelStart()));
 }
 
-CJS_Return CJS_Event::set_sel_start(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_sel_start(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
@@ -223,81 +223,81 @@
   if (wcscmp((const wchar_t*)pEvent->Name(), L"Keystroke") == 0)
     pEvent->SetSelStart(pRuntime->ToInt32(vp));
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_shift(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_shift(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewBoolean(pEvent->Shift()));
+  return CJS_Result::Success(pRuntime->NewBoolean(pEvent->Shift()));
 }
 
-CJS_Return CJS_Event::set_shift(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_shift(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_source(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_source(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pEvent->Source()->ToV8Object());
+  return CJS_Result::Success(pEvent->Source()->ToV8Object());
 }
 
-CJS_Return CJS_Event::set_source(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_source(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_target(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_target(CJS_Runtime* pRuntime) {
   ASSERT(pRuntime->GetCurrentEventContext());
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pEvent->Target_Field()->ToV8Object());
+  return CJS_Result::Success(pEvent->Target_Field()->ToV8Object());
 }
 
-CJS_Return CJS_Event::set_target(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_target(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_target_name(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_target_name(CJS_Runtime* pRuntime) {
   ASSERT(pRuntime->GetCurrentEventContext());
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pEvent->TargetName().AsStringView()));
 }
 
-CJS_Return CJS_Event::set_target_name(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_target_name(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_type(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_type(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewString(pEvent->Type()));
+  return CJS_Result::Success(pRuntime->NewString(pEvent->Type()));
 }
 
-CJS_Return CJS_Event::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Event::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Event::get_value(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_value(CJS_Runtime* pRuntime) {
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
 
   if (wcscmp((const wchar_t*)pEvent->Type(), L"Field") != 0)
-    return CJS_Return::Failure(L"Bad event type.");
+    return CJS_Result::Failure(L"Bad event type.");
 
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pEvent->Value().AsStringView()));
 }
 
-CJS_Return CJS_Event::set_value(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_value(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   ASSERT(pRuntime->GetCurrentEventContext());
 
@@ -305,24 +305,24 @@
       pRuntime->GetCurrentEventContext()->GetEventHandler();
 
   if (wcscmp((const wchar_t*)pEvent->Type(), L"Field") != 0)
-    return CJS_Return::Failure(L"Bad event type.");
+    return CJS_Result::Failure(L"Bad event type.");
 
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   pEvent->Value() = pRuntime->ToWideString(vp);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Event::get_will_commit(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Event::get_will_commit(CJS_Runtime* pRuntime) {
   ASSERT(pRuntime->GetCurrentEventContext());
 
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
-  return CJS_Return::Success(pRuntime->NewBoolean(pEvent->WillCommit()));
+  return CJS_Result::Success(pRuntime->NewBoolean(pEvent->WillCommit()));
 }
 
-CJS_Return CJS_Event::set_will_commit(CJS_Runtime* pRuntime,
+CJS_Result CJS_Event::set_will_commit(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
diff --git a/fxjs/cjs_event.h b/fxjs/cjs_event.h
index 804c6f6..67bd3f5 100644
--- a/fxjs/cjs_event.h
+++ b/fxjs/cjs_event.h
@@ -43,65 +43,65 @@
   static const char kName[];
   static const JSPropertySpec PropertySpecs[];
 
-  CJS_Return get_change(CJS_Runtime* pRuntime);
-  CJS_Return set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_change(CJS_Runtime* pRuntime);
+  CJS_Result set_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_change_ex(CJS_Runtime* pRuntime);
-  CJS_Return set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_change_ex(CJS_Runtime* pRuntime);
+  CJS_Result set_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_commit_key(CJS_Runtime* pRuntime);
-  CJS_Return set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_commit_key(CJS_Runtime* pRuntime);
+  CJS_Result set_commit_key(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_field_full(CJS_Runtime* pRuntime);
-  CJS_Return set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_field_full(CJS_Runtime* pRuntime);
+  CJS_Result set_field_full(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_key_down(CJS_Runtime* pRuntime);
-  CJS_Return set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_key_down(CJS_Runtime* pRuntime);
+  CJS_Result set_key_down(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_modifier(CJS_Runtime* pRuntime);
-  CJS_Return set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_modifier(CJS_Runtime* pRuntime);
+  CJS_Result set_modifier(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_name(CJS_Runtime* pRuntime);
-  CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_name(CJS_Runtime* pRuntime);
+  CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rc(CJS_Runtime* pRuntime);
-  CJS_Return set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rc(CJS_Runtime* pRuntime);
+  CJS_Result set_rc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rich_change(CJS_Runtime* pRuntime);
-  CJS_Return set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rich_change(CJS_Runtime* pRuntime);
+  CJS_Result set_rich_change(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rich_change_ex(CJS_Runtime* pRuntime);
-  CJS_Return set_rich_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rich_change_ex(CJS_Runtime* pRuntime);
+  CJS_Result set_rich_change_ex(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rich_value(CJS_Runtime* pRuntime);
-  CJS_Return set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rich_value(CJS_Runtime* pRuntime);
+  CJS_Result set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_sel_end(CJS_Runtime* pRuntime);
-  CJS_Return set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_sel_end(CJS_Runtime* pRuntime);
+  CJS_Result set_sel_end(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_sel_start(CJS_Runtime* pRuntime);
-  CJS_Return set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_sel_start(CJS_Runtime* pRuntime);
+  CJS_Result set_sel_start(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_shift(CJS_Runtime* pRuntime);
-  CJS_Return set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_shift(CJS_Runtime* pRuntime);
+  CJS_Result set_shift(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_source(CJS_Runtime* pRuntime);
-  CJS_Return set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_source(CJS_Runtime* pRuntime);
+  CJS_Result set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_target(CJS_Runtime* pRuntime);
-  CJS_Return set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_target(CJS_Runtime* pRuntime);
+  CJS_Result set_target(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_target_name(CJS_Runtime* pRuntime);
-  CJS_Return set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_target_name(CJS_Runtime* pRuntime);
+  CJS_Result set_target_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_type(CJS_Runtime* pRuntime);
-  CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_type(CJS_Runtime* pRuntime);
+  CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_value(CJS_Runtime* pRuntime);
-  CJS_Return set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_value(CJS_Runtime* pRuntime);
+  CJS_Result set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_will_commit(CJS_Runtime* pRuntime);
-  CJS_Return set_will_commit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_will_commit(CJS_Runtime* pRuntime);
+  CJS_Result set_will_commit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 };
 
 #endif  // FXJS_CJS_EVENT_H_
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 4e7baf4..1f39051 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -665,72 +665,72 @@
   return pFormField->GetControl(m_nFormControlIndex);
 }
 
-CJS_Return CJS_Field::get_alignment(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_alignment(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   switch (pFormControl->GetControlAlignment()) {
     case 0:
-      return CJS_Return::Success(pRuntime->NewString(L"left"));
+      return CJS_Result::Success(pRuntime->NewString(L"left"));
     case 1:
-      return CJS_Return::Success(pRuntime->NewString(L"center"));
+      return CJS_Result::Success(pRuntime->NewString(L"center"));
     case 2:
-      return CJS_Return::Success(pRuntime->NewString(L"right"));
+      return CJS_Result::Success(pRuntime->NewString(L"right"));
   }
-  return CJS_Return::Success(pRuntime->NewString(L""));
+  return CJS_Result::Success(pRuntime->NewString(L""));
 }
 
-CJS_Return CJS_Field::set_alignment(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_alignment(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_border_style(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_border_style(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_Widget* pWidget =
       GetWidget(m_pFormFillEnv.Get(), GetSmartFieldControl(pFormField));
   if (!pWidget)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   switch (pWidget->GetBorderStyle()) {
     case BorderStyle::SOLID:
-      return CJS_Return::Success(pRuntime->NewString(L"solid"));
+      return CJS_Result::Success(pRuntime->NewString(L"solid"));
     case BorderStyle::DASH:
-      return CJS_Return::Success(pRuntime->NewString(L"dashed"));
+      return CJS_Result::Success(pRuntime->NewString(L"dashed"));
     case BorderStyle::BEVELED:
-      return CJS_Return::Success(pRuntime->NewString(L"beveled"));
+      return CJS_Result::Success(pRuntime->NewString(L"beveled"));
     case BorderStyle::INSET:
-      return CJS_Return::Success(pRuntime->NewString(L"inset"));
+      return CJS_Result::Success(pRuntime->NewString(L"inset"));
     case BorderStyle::UNDERLINE:
-      return CJS_Return::Success(pRuntime->NewString(L"underline"));
+      return CJS_Result::Success(pRuntime->NewString(L"underline"));
   }
-  return CJS_Return::Success(pRuntime->NewString(L""));
+  return CJS_Result::Success(pRuntime->NewString(L""));
 }
 
-CJS_Return CJS_Field::set_border_style(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_border_style(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   ByteString byte_str = pRuntime->ToWideString(vp).ToDefANSI();
   if (m_bDelay) {
@@ -739,52 +739,52 @@
     SetBorderStyle(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
                    byte_str);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_button_align_x(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_button_align_x(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_IconFit IconFit = pFormControl->GetIconFit();
 
   float fLeft;
   float fBottom;
   IconFit.GetIconPosition(fLeft, fBottom);
-  return CJS_Return::Success(pRuntime->NewNumber(static_cast<int32_t>(fLeft)));
+  return CJS_Result::Success(pRuntime->NewNumber(static_cast<int32_t>(fLeft)));
 }
 
-CJS_Return CJS_Field::set_button_align_x(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_button_align_x(CJS_Runtime* pRuntime,
                                          v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_button_align_y(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_button_align_y(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_IconFit IconFit = pFormControl->GetIconFit();
 
@@ -792,238 +792,238 @@
   float fBottom;
   IconFit.GetIconPosition(fLeft, fBottom);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewNumber(static_cast<int32_t>(fBottom)));
 }
 
-CJS_Return CJS_Field::set_button_align_y(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_button_align_y(CJS_Runtime* pRuntime,
                                          v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_button_fit_bounds(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_button_fit_bounds(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(pFormControl->GetIconFit().GetFittingBounds()));
 }
 
-CJS_Return CJS_Field::set_button_fit_bounds(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_button_fit_bounds(CJS_Runtime* pRuntime,
                                             v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_button_position(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_button_position(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewNumber(pFormControl->GetTextPosition()));
 }
 
-CJS_Return CJS_Field::set_button_position(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_button_position(CJS_Runtime* pRuntime,
                                           v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_button_scale_how(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_button_scale_how(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       pFormControl->GetIconFit().IsProportionalScale() ? 0 : 1));
 }
 
-CJS_Return CJS_Field::set_button_scale_how(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_button_scale_how(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_button_scale_when(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_button_scale_when(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_IconFit IconFit = pFormControl->GetIconFit();
   int ScaleM = IconFit.GetScaleMethod();
   switch (ScaleM) {
     case CPDF_IconFit::Always:
-      return CJS_Return::Success(
+      return CJS_Result::Success(
           pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Always)));
     case CPDF_IconFit::Bigger:
-      return CJS_Return::Success(
+      return CJS_Result::Success(
           pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Bigger)));
     case CPDF_IconFit::Never:
-      return CJS_Return::Success(
+      return CJS_Result::Success(
           pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Never)));
     case CPDF_IconFit::Smaller:
-      return CJS_Return::Success(
+      return CJS_Result::Success(
           pRuntime->NewNumber(static_cast<int32_t>(CPDF_IconFit::Smaller)));
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::set_button_scale_when(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_button_scale_when(CJS_Runtime* pRuntime,
                                             v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_calc_order_index(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_calc_order_index(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsComboBoxOrTextField(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDFSDK_InterForm* pRDInterForm = m_pFormFillEnv->GetInterForm();
   CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
-  return CJS_Return::Success(pRuntime->NewNumber(static_cast<int32_t>(
+  return CJS_Result::Success(pRuntime->NewNumber(static_cast<int32_t>(
       pInterForm->FindFieldInCalculationOrder(pFormField))));
 }
 
-CJS_Return CJS_Field::set_calc_order_index(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_calc_order_index(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_char_limit(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_char_limit(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
-  return CJS_Return::Success(
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
+  return CJS_Result::Success(
       pRuntime->NewNumber(static_cast<int32_t>(pFormField->GetMaxLen())));
 }
 
-CJS_Return CJS_Field::set_char_limit(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_char_limit(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_comb(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_comb(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(!!(pFormField->GetFieldFlags() & FIELDFLAG_COMB)));
 }
 
-CJS_Return CJS_Field::set_comb(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Field::set_comb(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_commit_on_sel_change(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_commit_on_sel_change(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsComboBoxOrListBox(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_COMMITONSELCHANGE)));
 }
 
-CJS_Return CJS_Field::set_commit_on_sel_change(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_commit_on_sel_change(CJS_Runtime* pRuntime,
                                                v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_current_value_indices(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_current_value_indices(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsComboBoxOrListBox(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   int count = pFormField->CountSelectedItems();
   if (count <= 0)
-    return CJS_Return::Success(pRuntime->NewNumber(-1));
+    return CJS_Result::Success(pRuntime->NewNumber(-1));
   if (count == 1)
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         pRuntime->NewNumber(pFormField->GetSelectedIndex(0)));
 
   v8::Local<v8::Array> SelArray = pRuntime->NewArray();
@@ -1032,14 +1032,14 @@
         SelArray, i, pRuntime->NewNumber(pFormField->GetSelectedIndex(i)));
   }
   if (SelArray.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewArray());
-  return CJS_Return::Success(SelArray);
+    return CJS_Result::Success(pRuntime->NewArray());
+  return CJS_Result::Success(SelArray);
 }
 
-CJS_Return CJS_Field::set_current_value_indices(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_current_value_indices(CJS_Runtime* pRuntime,
                                                 v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   std::vector<uint32_t> array;
   if (vp->IsNumber()) {
@@ -1058,84 +1058,84 @@
     SetCurrentValueIndices(m_pFormFillEnv.Get(), m_FieldName,
                            m_nFormControlIndex, array);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_default_style(CJS_Runtime* pRuntime) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Field::get_default_style(CJS_Runtime* pRuntime) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::set_default_style(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_default_style(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::get_default_value(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_default_value(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() == FormFieldType::kPushButton ||
       pFormField->GetFieldType() == FormFieldType::kSignature) {
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
   }
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pFormField->GetDefaultValue().AsStringView()));
 }
 
-CJS_Return CJS_Field::set_default_value(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_default_value(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_do_not_scroll(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_do_not_scroll(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_DONOTSCROLL)));
 }
 
-CJS_Return CJS_Field::set_do_not_scroll(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_do_not_scroll(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_do_not_spell_check(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_do_not_spell_check(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsComboBoxOrTextField(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_DONOTSPELLCHECK)));
 }
 
-CJS_Return CJS_Field::set_do_not_spell_check(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_do_not_spell_check(CJS_Runtime* pRuntime,
                                              v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
 void CJS_Field::SetDelay(bool bDelay) {
@@ -1147,46 +1147,46 @@
     m_pJSDoc->DoFieldDelay(m_FieldName, m_nFormControlIndex);
 }
 
-CJS_Return CJS_Field::get_delay(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewBoolean(m_bDelay));
+CJS_Result CJS_Field::get_delay(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewBoolean(m_bDelay));
 }
 
-CJS_Return CJS_Field::set_delay(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_delay(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   SetDelay(pRuntime->ToBoolean(vp));
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_display(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_display(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDFSDK_Widget* pWidget =
       pInterForm->GetWidget(GetSmartFieldControl(pFormField));
   if (!pWidget)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   uint32_t dwFlag = pWidget->GetFlags();
   if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag)
-    return CJS_Return::Success(pRuntime->NewNumber(1));
+    return CJS_Result::Success(pRuntime->NewNumber(1));
 
   if (ANNOTFLAG_PRINT & dwFlag) {
     if (ANNOTFLAG_NOVIEW & dwFlag)
-      return CJS_Return::Success(pRuntime->NewNumber(3));
-    return CJS_Return::Success(pRuntime->NewNumber(0));
+      return CJS_Result::Success(pRuntime->NewNumber(3));
+    return CJS_Result::Success(pRuntime->NewNumber(0));
   }
-  return CJS_Return::Success(pRuntime->NewNumber(2));
+  return CJS_Result::Success(pRuntime->NewNumber(2));
 }
 
-CJS_Return CJS_Field::set_display(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_display(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   if (m_bDelay) {
     AddDelay_Int(FP_DISPLAY, pRuntime->ToInt32(vp));
@@ -1194,43 +1194,43 @@
     SetDisplay(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
                pRuntime->ToInt32(vp));
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_doc(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(m_pJSDoc->ToV8Object());
+CJS_Result CJS_Field::get_doc(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(m_pJSDoc->ToV8Object());
 }
 
-CJS_Return CJS_Field::set_doc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Field::set_doc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::get_editable(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_editable(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kComboBox)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(!!(pFormField->GetFieldFlags() & FIELDFLAG_EDIT)));
 }
 
-CJS_Return CJS_Field::set_editable(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_editable(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_export_values(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_export_values(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsCheckBoxOrRadioButton(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   v8::Local<v8::Array> ExportValuesArray = pRuntime->NewArray();
   if (m_nFormControlIndex < 0) {
@@ -1242,73 +1242,73 @@
     }
   } else {
     if (m_nFormControlIndex >= pFormField->CountControls())
-      return CJS_Return::Failure(JSMessage::kValueError);
+      return CJS_Result::Failure(JSMessage::kValueError);
 
     CPDF_FormControl* pFormControl =
         pFormField->GetControl(m_nFormControlIndex);
     if (!pFormControl)
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
 
     pRuntime->PutArrayElement(
         ExportValuesArray, 0,
         pRuntime->NewString(pFormControl->GetExportValue().AsStringView()));
   }
-  return CJS_Return::Success(ExportValuesArray);
+  return CJS_Result::Success(ExportValuesArray);
 }
 
-CJS_Return CJS_Field::set_export_values(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_export_values(CJS_Runtime* pRuntime,
                                         v8::Local<v8::Value> vp) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsCheckBoxOrRadioButton(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   if (vp.IsEmpty() || !vp->IsArray())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_file_select(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_file_select(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT)));
 }
 
-CJS_Return CJS_Field::set_file_select(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_file_select(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_fill_color(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_fill_color(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int iColorType;
   pFormControl->GetBackgroundColor(iColorType);
@@ -1331,48 +1331,48 @@
                   pFormControl->GetOriginalBackgroundColor(2),
                   pFormControl->GetOriginalBackgroundColor(3));
   } else {
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
   }
 
   v8::Local<v8::Value> array =
       CJS_Color::ConvertPWLColorToArray(pRuntime, color);
   if (array.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewArray());
-  return CJS_Return::Success(array);
+    return CJS_Result::Success(pRuntime->NewArray());
+  return CJS_Result::Success(array);
 }
 
-CJS_Return CJS_Field::set_fill_color(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_fill_color(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
   if (vp.IsEmpty() || !vp->IsArray())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_hidden(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_hidden(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDFSDK_Widget* pWidget =
       pInterForm->GetWidget(GetSmartFieldControl(pFormField));
   if (!pWidget)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   uint32_t dwFlags = pWidget->GetFlags();
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags));
 }
 
-CJS_Return CJS_Field::set_hidden(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_hidden(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   if (m_bDelay) {
     AddDelay_Bool(FP_HIDDEN, pRuntime->ToBoolean(vp));
@@ -1380,71 +1380,71 @@
     SetHidden(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
               pRuntime->ToBoolean(vp));
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_highlight(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_highlight(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int eHM = pFormControl->GetHighlightingMode();
   switch (eHM) {
     case CPDF_FormControl::None:
-      return CJS_Return::Success(pRuntime->NewString(L"none"));
+      return CJS_Result::Success(pRuntime->NewString(L"none"));
     case CPDF_FormControl::Push:
-      return CJS_Return::Success(pRuntime->NewString(L"push"));
+      return CJS_Result::Success(pRuntime->NewString(L"push"));
     case CPDF_FormControl::Invert:
-      return CJS_Return::Success(pRuntime->NewString(L"invert"));
+      return CJS_Result::Success(pRuntime->NewString(L"invert"));
     case CPDF_FormControl::Outline:
-      return CJS_Return::Success(pRuntime->NewString(L"outline"));
+      return CJS_Result::Success(pRuntime->NewString(L"outline"));
     case CPDF_FormControl::Toggle:
-      return CJS_Return::Success(pRuntime->NewString(L"toggle"));
+      return CJS_Result::Success(pRuntime->NewString(L"toggle"));
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::set_highlight(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_highlight(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_line_width(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_line_width(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   if (!pFormField->CountControls())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
   if (!pWidget)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewNumber(pWidget->GetBorderWidth()));
+  return CJS_Result::Success(pRuntime->NewNumber(pWidget->GetBorderWidth()));
 }
 
-CJS_Return CJS_Field::set_line_width(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_line_width(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   if (m_bDelay) {
     AddDelay_Int(FP_LINEWIDTH, pRuntime->ToInt32(vp));
@@ -1452,159 +1452,159 @@
     SetLineWidth(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
                  pRuntime->ToInt32(vp));
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_multiline(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_multiline(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_MULTILINE)));
 }
 
-CJS_Return CJS_Field::set_multiline(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_multiline(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_multiple_selection(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_multiple_selection(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kListBox)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_MULTISELECT)));
 }
 
-CJS_Return CJS_Field::set_multiple_selection(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_multiple_selection(CJS_Runtime* pRuntime,
                                              v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_name(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_name(CJS_Runtime* pRuntime) {
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewString(m_FieldName.AsStringView()));
+  return CJS_Result::Success(pRuntime->NewString(m_FieldName.AsStringView()));
 }
 
-CJS_Return CJS_Field::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Field::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::get_num_items(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_num_items(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsComboBoxOrListBox(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewNumber(pFormField->CountOptions()));
+  return CJS_Result::Success(pRuntime->NewNumber(pFormField->CountOptions()));
 }
 
-CJS_Return CJS_Field::set_num_items(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_num_items(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::get_page(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_page(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   std::vector<CPDFSDK_Annot::ObservedPtr> widgets;
   m_pFormFillEnv->GetInterForm()->GetWidgets(pFormField, &widgets);
   if (widgets.empty())
-    return CJS_Return::Success(pRuntime->NewNumber(-1));
+    return CJS_Result::Success(pRuntime->NewNumber(-1));
 
   v8::Local<v8::Array> PageArray = pRuntime->NewArray();
   int i = 0;
   for (const auto& pObserved : widgets) {
     if (!pObserved)
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
 
     auto* pWidget = ToCPDFSDKWidget(pObserved.Get());
     CPDFSDK_PageView* pPageView = pWidget->GetPageView();
     if (!pPageView)
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
 
     pRuntime->PutArrayElement(
         PageArray, i,
         pRuntime->NewNumber(static_cast<int32_t>(pPageView->GetPageIndex())));
     ++i;
   }
-  return CJS_Return::Success(PageArray);
+  return CJS_Result::Success(PageArray);
 }
 
-CJS_Return CJS_Field::set_page(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kReadOnlyError);
+CJS_Result CJS_Field::set_page(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kReadOnlyError);
 }
 
-CJS_Return CJS_Field::get_password(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_password(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_PASSWORD)));
 }
 
-CJS_Return CJS_Field::set_password(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_password(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_print(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_print(CJS_Runtime* pRuntime) {
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_Widget* pWidget =
       pInterForm->GetWidget(GetSmartFieldControl(pFormField));
   if (!pWidget)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(!!(pWidget->GetFlags() & ANNOTFLAG_PRINT)));
 }
 
-CJS_Return CJS_Field::set_print(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_print(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   for (CPDF_FormField* pFormField : FieldArray) {
     if (m_nFormControlIndex < 0) {
@@ -1632,7 +1632,7 @@
     }
 
     if (m_nFormControlIndex >= pFormField->CountControls())
-      return CJS_Return::Failure(JSMessage::kValueError);
+      return CJS_Result::Failure(JSMessage::kValueError);
 
     if (CPDF_FormControl* pFormControl =
             pFormField->GetControl(m_nFormControlIndex)) {
@@ -1652,60 +1652,60 @@
       }
     }
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_radios_in_unison(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_radios_in_unison(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kRadioButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)));
 }
 
-CJS_Return CJS_Field::set_radios_in_unison(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_radios_in_unison(CJS_Runtime* pRuntime,
                                            v8::Local<v8::Value> vp) {
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_readonly(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_readonly(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_READONLY)));
 }
 
-CJS_Return CJS_Field::set_readonly(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_readonly(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_rect(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_rect(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDFSDK_Widget* pWidget =
       pInterForm->GetWidget(GetSmartFieldControl(pFormField));
   if (!pWidget)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CFX_FloatRect crRect = pWidget->GetRect();
   v8::Local<v8::Array> rcArray = pRuntime->NewArray();
@@ -1718,18 +1718,18 @@
   pRuntime->PutArrayElement(
       rcArray, 3, pRuntime->NewNumber(static_cast<int32_t>(crRect.bottom)));
 
-  return CJS_Return::Success(rcArray);
+  return CJS_Result::Success(rcArray);
 }
 
-CJS_Return CJS_Field::set_rect(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+CJS_Result CJS_Field::set_rect(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
   if (vp.IsEmpty() || !vp->IsArray())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   v8::Local<v8::Array> rcArray = pRuntime->ToArray(vp);
   if (pRuntime->GetArrayLength(rcArray) < 4)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   float pArray[4];
   pArray[0] = static_cast<float>(
@@ -1747,92 +1747,92 @@
   } else {
     SetRect(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex, crRect);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_required(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_required(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() == FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)));
 }
 
-CJS_Return CJS_Field::set_required(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_required(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_rich_text(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_rich_text(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kTextField)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       !!(pFormField->GetFieldFlags() & FIELDFLAG_RICHTEXT)));
 }
 
-CJS_Return CJS_Field::set_rich_text(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_rich_text(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_rich_value(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Field::get_rich_value(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::set_rich_value(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_rich_value(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_rotation(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_rotation(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewNumber(pFormControl->GetRotation()));
+  return CJS_Result::Success(pRuntime->NewNumber(pFormControl->GetRotation()));
 }
 
-CJS_Return CJS_Field::set_rotation(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_rotation(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_stroke_color(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_stroke_color(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int iColorType;
   pFormControl->GetBorderColor(iColorType);
@@ -1853,38 +1853,38 @@
                       pFormControl->GetOriginalBorderColor(2),
                       pFormControl->GetOriginalBorderColor(3));
   } else {
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
   }
 
   v8::Local<v8::Value> array =
       CJS_Color::ConvertPWLColorToArray(pRuntime, color);
   if (array.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewArray());
-  return CJS_Return::Success(array);
+    return CJS_Result::Success(pRuntime->NewArray());
+  return CJS_Result::Success(array);
 }
 
-CJS_Return CJS_Field::set_stroke_color(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_stroke_color(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
   if (vp.IsEmpty() || !vp->IsArray())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_style(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_style(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsCheckBoxOrRadioButton(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString csWCaption = pFormControl->GetNormalCaption();
   ByteString csBCaption;
@@ -1909,35 +1909,35 @@
       csBCaption = "check";
       break;
   }
-  return CJS_Return::Success(pRuntime->NewString(
+  return CJS_Result::Success(pRuntime->NewString(
       WideString::FromLocal(csBCaption.AsStringView()).AsStringView()));
 }
 
-CJS_Return CJS_Field::set_style(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_style(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_submit_name(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Field::get_submit_name(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::set_submit_name(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_submit_name(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_text_color(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_text_color(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   Optional<CFX_Color::Type> iColorType;
   FX_ARGB color;
@@ -1959,142 +1959,142 @@
   v8::Local<v8::Value> array =
       CJS_Color::ConvertPWLColorToArray(pRuntime, crRet);
   if (array.IsEmpty())
-    return CJS_Return::Success(pRuntime->NewArray());
-  return CJS_Return::Success(array);
+    return CJS_Result::Success(pRuntime->NewArray());
+  return CJS_Result::Success(array);
 }
 
-CJS_Return CJS_Field::set_text_color(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_text_color(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
   if (vp.IsEmpty() || !vp->IsArray())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_text_font(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_text_font(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   FormFieldType fieldType = pFormField->GetFieldType();
   if (fieldType != FormFieldType::kPushButton &&
       fieldType != FormFieldType::kComboBox &&
       fieldType != FormFieldType::kListBox &&
       fieldType != FormFieldType::kTextField) {
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
   }
 
   CPDF_Font* pFont = pFormControl->GetDefaultControlFont();
   if (!pFont)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(pRuntime->NewString(
+  return CJS_Result::Success(pRuntime->NewString(
       WideString::FromLocal(pFont->GetBaseFont().AsStringView())
           .AsStringView()));
 }
 
-CJS_Return CJS_Field::set_text_font(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_text_font(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
 
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
   if (pRuntime->ToWideString(vp).ToDefANSI().IsEmpty())
-    return CJS_Return::Failure(JSMessage::kValueError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kValueError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_text_size(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_text_size(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   float fFontSize;
   CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
   FieldAppearance.GetFont(&fFontSize);
-  return CJS_Return::Success(pRuntime->NewNumber(static_cast<int>(fFontSize)));
+  return CJS_Result::Success(pRuntime->NewNumber(static_cast<int>(fFontSize)));
 }
 
-CJS_Return CJS_Field::set_text_size(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_text_size(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_type(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_type(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   switch (pFormField->GetFieldType()) {
     case FormFieldType::kUnknown:
-      return CJS_Return::Success(pRuntime->NewString(L"unknown"));
+      return CJS_Result::Success(pRuntime->NewString(L"unknown"));
     case FormFieldType::kPushButton:
-      return CJS_Return::Success(pRuntime->NewString(L"button"));
+      return CJS_Result::Success(pRuntime->NewString(L"button"));
     case FormFieldType::kCheckBox:
-      return CJS_Return::Success(pRuntime->NewString(L"checkbox"));
+      return CJS_Result::Success(pRuntime->NewString(L"checkbox"));
     case FormFieldType::kRadioButton:
-      return CJS_Return::Success(pRuntime->NewString(L"radiobutton"));
+      return CJS_Result::Success(pRuntime->NewString(L"radiobutton"));
     case FormFieldType::kComboBox:
-      return CJS_Return::Success(pRuntime->NewString(L"combobox"));
+      return CJS_Result::Success(pRuntime->NewString(L"combobox"));
     case FormFieldType::kListBox:
-      return CJS_Return::Success(pRuntime->NewString(L"listbox"));
+      return CJS_Result::Success(pRuntime->NewString(L"listbox"));
     case FormFieldType::kTextField:
-      return CJS_Return::Success(pRuntime->NewString(L"text"));
+      return CJS_Result::Success(pRuntime->NewString(L"text"));
     case FormFieldType::kSignature:
-      return CJS_Return::Success(pRuntime->NewString(L"signature"));
+      return CJS_Result::Success(pRuntime->NewString(L"signature"));
     default:
-      return CJS_Return::Success(pRuntime->NewString(L"unknown"));
+      return CJS_Result::Success(pRuntime->NewString(L"unknown"));
   }
 }
 
-CJS_Return CJS_Field::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Field::set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::get_user_name(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_user_name(CJS_Runtime* pRuntime) {
   ASSERT(m_pFormFillEnv);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pFormField->GetAlternateName().AsStringView()));
 }
 
-CJS_Return CJS_Field::set_user_name(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_user_name(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {
   ASSERT(m_pFormFillEnv);
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_value(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_value(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   v8::Local<v8::Value> ret;
   switch (pFormField->GetFieldType()) {
     case FormFieldType::kPushButton:
-      return CJS_Return::Failure(JSMessage::kObjectTypeError);
+      return CJS_Result::Failure(JSMessage::kObjectTypeError);
     case FormFieldType::kComboBox:
     case FormFieldType::kTextField:
       ret = pRuntime->NewString(pFormField->GetValue().AsStringView());
@@ -2140,13 +2140,13 @@
       ret = pRuntime->NewString(pFormField->GetValue().AsStringView());
       break;
   }
-  return CJS_Return::Success(pRuntime->MaybeCoerceToNumber(ret));
+  return CJS_Result::Success(pRuntime->MaybeCoerceToNumber(ret));
 }
 
-CJS_Return CJS_Field::set_value(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_value(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   std::vector<WideString> strArray;
   if (!vp.IsEmpty() && vp->IsArray()) {
@@ -2164,21 +2164,21 @@
   } else {
     SetValue(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex, strArray);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::get_value_as_string(CJS_Runtime* pRuntime) {
+CJS_Result CJS_Field::get_value_as_string(CJS_Runtime* pRuntime) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() == FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   if (pFormField->GetFieldType() == FormFieldType::kCheckBox) {
     if (!pFormField->CountControls())
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
-    return CJS_Return::Success(pRuntime->NewString(
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Success(pRuntime->NewString(
         pFormField->GetControl(0)->IsChecked() ? L"Yes" : L"Off"));
   }
 
@@ -2186,32 +2186,32 @@
       !(pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)) {
     for (int i = 0, sz = pFormField->CountControls(); i < sz; i++) {
       if (pFormField->GetControl(i)->IsChecked()) {
-        return CJS_Return::Success(pRuntime->NewString(
+        return CJS_Result::Success(pRuntime->NewString(
             pFormField->GetControl(i)->GetExportValue().AsStringView()));
       }
     }
-    return CJS_Return::Success(pRuntime->NewString(L"Off"));
+    return CJS_Result::Success(pRuntime->NewString(L"Off"));
   }
 
   if (pFormField->GetFieldType() == FormFieldType::kListBox &&
       (pFormField->CountSelectedItems() > 1)) {
-    return CJS_Return::Success(pRuntime->NewString(L""));
+    return CJS_Result::Success(pRuntime->NewString(L""));
   }
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(pFormField->GetValue().AsStringView()));
 }
 
-CJS_Return CJS_Field::set_value_as_string(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_value_as_string(CJS_Runtime* pRuntime,
                                           v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::browseForFileToSubmit(
+CJS_Result CJS_Field::browseForFileToSubmit(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
       (pFormField->GetFieldType() == FormFieldType::kTextField)) {
@@ -2220,12 +2220,12 @@
       pFormField->SetValue(wsFileName, NotificationOption::kDoNotNotify);
       UpdateFormField(m_pFormFillEnv.Get(), pFormField, true, true, true);
     }
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
-  return CJS_Return::Failure(JSMessage::kObjectTypeError);
+  return CJS_Result::Failure(JSMessage::kObjectTypeError);
 }
 
-CJS_Return CJS_Field::buttonGetCaption(
+CJS_Result CJS_Field::buttonGetCaption(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   int nface = 0;
@@ -2235,87 +2235,87 @@
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (nface == 0) {
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         pRuntime->NewString(pFormControl->GetNormalCaption().AsStringView()));
   }
   if (nface == 1) {
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         pRuntime->NewString(pFormControl->GetDownCaption().AsStringView()));
   }
   if (nface == 2) {
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         pRuntime->NewString(pFormControl->GetRolloverCaption().AsStringView()));
   }
-  return CJS_Return::Failure(JSMessage::kValueError);
+  return CJS_Result::Failure(JSMessage::kValueError);
 }
 
-CJS_Return CJS_Field::buttonGetIcon(
+CJS_Result CJS_Field::buttonGetIcon(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() >= 1) {
     int nFace = pRuntime->ToInt32(params[0]);
     if (nFace < 0 || nFace > 2)
-      return CJS_Return::Failure(JSMessage::kValueError);
+      return CJS_Result::Failure(JSMessage::kValueError);
   }
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pFormField->GetFieldType() != FormFieldType::kPushButton)
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
   if (!pFormControl)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   v8::Local<v8::Object> pObj = pRuntime->NewFXJSBoundObject(
       CJS_Icon::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
   if (pObj.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   auto* pJS_Icon = static_cast<CJS_Icon*>(CFXJS_Engine::GetObjectPrivate(pObj));
-  return pJS_Icon ? CJS_Return::Success(pJS_Icon->ToV8Object())
-                  : CJS_Return::Failure(JSMessage::kBadObjectError);
+  return pJS_Icon ? CJS_Result::Success(pJS_Icon->ToV8Object())
+                  : CJS_Result::Failure(JSMessage::kBadObjectError);
 }
 
-CJS_Return CJS_Field::buttonImportIcon(
+CJS_Result CJS_Field::buttonImportIcon(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::buttonSetCaption(
+CJS_Result CJS_Field::buttonSetCaption(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::buttonSetIcon(
+CJS_Result CJS_Field::buttonSetIcon(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::checkThisBox(
+CJS_Result CJS_Field::checkThisBox(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   int iSize = params.size();
   if (iSize < 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   int nWidget = pRuntime->ToInt32(params[0]);
   bool bCheckit = true;
@@ -2324,61 +2324,61 @@
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsCheckBoxOrRadioButton(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   if (nWidget < 0 || nWidget >= pFormField->CountControls())
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   // TODO(weili): Check whether anything special needed for radio button.
   // (When pFormField->GetFieldType() == FormFieldType::kRadioButton.)
   pFormField->CheckControl(nWidget, bCheckit, NotificationOption::kNotify);
   UpdateFormField(m_pFormFillEnv.Get(), pFormField, true, true, true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::clearItems(
+CJS_Result CJS_Field::clearItems(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::defaultIsChecked(
+CJS_Result CJS_Field::defaultIsChecked(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!m_bCanSet)
-    return CJS_Return::Failure(JSMessage::kReadOnlyError);
+    return CJS_Result::Failure(JSMessage::kReadOnlyError);
 
   int iSize = params.size();
   if (iSize < 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int nWidget = pRuntime->ToInt32(params[0]);
   if (nWidget < 0 || nWidget >= pFormField->CountControls())
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean(IsCheckBoxOrRadioButton(pFormField)));
 }
 
-CJS_Return CJS_Field::deleteItemAt(
+CJS_Result CJS_Field::deleteItemAt(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::getArray(
+CJS_Result CJS_Field::getArray(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   std::vector<CPDF_FormField*> FieldArray = GetFormFields();
   if (FieldArray.empty())
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   std::vector<std::unique_ptr<WideString>> swSort;
   for (CPDF_FormField* pFormField : FieldArray) {
@@ -2395,7 +2395,7 @@
     v8::Local<v8::Object> pObj = pRuntime->NewFXJSBoundObject(
         CJS_Field::GetObjDefnID(), FXJSOBJTYPE_DYNAMIC);
     if (pObj.IsEmpty())
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
 
     auto* pJSField =
         static_cast<CJS_Field*>(CFXJS_Engine::GetObjectPrivate(pObj));
@@ -2405,10 +2405,10 @@
                                   ? v8::Local<v8::Value>(pJSField->ToV8Object())
                                   : v8::Local<v8::Value>());
   }
-  return CJS_Return::Success(FormFieldArray);
+  return CJS_Result::Success(FormFieldArray);
 }
 
-CJS_Return CJS_Field::getItemAt(
+CJS_Result CJS_Field::getItemAt(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   int iSize = params.size();
@@ -2422,38 +2422,38 @@
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (!IsComboBoxOrListBox(pFormField))
-    return CJS_Return::Failure(JSMessage::kObjectTypeError);
+    return CJS_Result::Failure(JSMessage::kObjectTypeError);
 
   if (nIdx == -1 || nIdx > pFormField->CountOptions())
     nIdx = pFormField->CountOptions() - 1;
   if (!bExport) {
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         pRuntime->NewString(pFormField->GetOptionLabel(nIdx).AsStringView()));
   }
 
   WideString strval = pFormField->GetOptionValue(nIdx);
   if (strval.IsEmpty()) {
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         pRuntime->NewString(pFormField->GetOptionLabel(nIdx).AsStringView()));
   }
-  return CJS_Return::Success(pRuntime->NewString(strval.AsStringView()));
+  return CJS_Result::Success(pRuntime->NewString(strval.AsStringView()));
 }
 
-CJS_Return CJS_Field::getLock(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::getLock(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::insertItemAt(
+CJS_Result CJS_Field::insertItemAt(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::isBoxChecked(
+CJS_Result CJS_Field::isBoxChecked(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   int nIndex = -1;
@@ -2462,17 +2462,17 @@
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (nIndex < 0 || nIndex >= pFormField->CountControls())
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewBoolean((IsCheckBoxOrRadioButton(pFormField) &&
                             pFormField->GetControl(nIndex)->IsChecked() != 0)));
 }
 
-CJS_Return CJS_Field::isDefaultChecked(
+CJS_Result CJS_Field::isDefaultChecked(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   int nIndex = -1;
@@ -2481,32 +2481,32 @@
 
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (nIndex < 0 || nIndex >= pFormField->CountControls())
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
-  return CJS_Return::Success(pRuntime->NewBoolean(
+  return CJS_Result::Success(pRuntime->NewBoolean(
       (IsCheckBoxOrRadioButton(pFormField) &&
        pFormField->GetControl(nIndex)->IsDefaultChecked() != 0)));
 }
 
-CJS_Return CJS_Field::setAction(
+CJS_Result CJS_Field::setAction(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::setFocus(
+CJS_Result CJS_Field::setFocus(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CPDF_FormField* pFormField = GetFirstFormField();
   if (!pFormField)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   int32_t nCount = pFormField->CountControls();
   if (nCount < 1)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   CPDFSDK_InterForm* pInterForm = m_pFormFillEnv->GetInterForm();
   CPDFSDK_Widget* pWidget = nullptr;
@@ -2515,7 +2515,7 @@
   } else {
     IPDF_Page* pPage = IPDFPageFromFPDFPage(m_pFormFillEnv->GetCurrentPage());
     if (!pPage)
-      return CJS_Return::Failure(JSMessage::kBadObjectError);
+      return CJS_Result::Failure(JSMessage::kBadObjectError);
     if (CPDFSDK_PageView* pCurPageView =
             m_pFormFillEnv->GetPageView(pPage, true)) {
       for (int32_t i = 0; i < nCount; i++) {
@@ -2535,63 +2535,63 @@
     m_pFormFillEnv->SetFocusAnnot(&pObserved);
   }
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::setItems(
+CJS_Result CJS_Field::setItems(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::setLock(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::setLock(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::signatureGetModifications(
+CJS_Result CJS_Field::signatureGetModifications(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::signatureGetSeedValue(
+CJS_Result CJS_Field::signatureGetSeedValue(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::signatureInfo(
+CJS_Result CJS_Field::signatureInfo(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::signatureSetSeedValue(
+CJS_Result CJS_Field::signatureSetSeedValue(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::signatureSign(
+CJS_Result CJS_Field::signatureSign(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::signatureValidate(
+CJS_Result CJS_Field::signatureValidate(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
 
-CJS_Return CJS_Field::get_source(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success();
+CJS_Result CJS_Field::get_source(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Field::set_source(CJS_Runtime* pRuntime,
+CJS_Result CJS_Field::set_source(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJS_Field::AddDelay_Int(FIELD_PROP prop, int32_t n) {
diff --git a/fxjs/cjs_field.h b/fxjs/cjs_field.h
index 75456b5..69d6c8e 100644
--- a/fxjs/cjs_field.h
+++ b/fxjs/cjs_field.h
@@ -119,8 +119,8 @@
   JS_STATIC_METHOD(signatureSign, CJS_Field);
   JS_STATIC_METHOD(signatureValidate, CJS_Field);
 
-  CJS_Return get_text_color(CJS_Runtime* pRuntime);
-  CJS_Return set_text_color(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_text_color(CJS_Runtime* pRuntime);
+  CJS_Result set_text_color(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
  private:
   static int ObjDefnID;
@@ -128,225 +128,225 @@
   static const JSPropertySpec PropertySpecs[];
   static const JSMethodSpec MethodSpecs[];
 
-  CJS_Return get_alignment(CJS_Runtime* pRuntime);
-  CJS_Return set_alignment(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_alignment(CJS_Runtime* pRuntime);
+  CJS_Result set_alignment(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_border_style(CJS_Runtime* pRuntime);
-  CJS_Return set_border_style(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_border_style(CJS_Runtime* pRuntime);
+  CJS_Result set_border_style(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_button_align_x(CJS_Runtime* pRuntime);
-  CJS_Return set_button_align_x(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_button_align_x(CJS_Runtime* pRuntime);
+  CJS_Result set_button_align_x(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_button_align_y(CJS_Runtime* pRuntime);
-  CJS_Return set_button_align_y(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_button_align_y(CJS_Runtime* pRuntime);
+  CJS_Result set_button_align_y(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_button_fit_bounds(CJS_Runtime* pRuntime);
-  CJS_Return set_button_fit_bounds(CJS_Runtime* pRuntime,
+  CJS_Result get_button_fit_bounds(CJS_Runtime* pRuntime);
+  CJS_Result set_button_fit_bounds(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp);
 
-  CJS_Return get_button_position(CJS_Runtime* pRuntime);
-  CJS_Return set_button_position(CJS_Runtime* pRuntime,
+  CJS_Result get_button_position(CJS_Runtime* pRuntime);
+  CJS_Result set_button_position(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp);
 
-  CJS_Return get_button_scale_how(CJS_Runtime* pRuntime);
-  CJS_Return set_button_scale_how(CJS_Runtime* pRuntime,
+  CJS_Result get_button_scale_how(CJS_Runtime* pRuntime);
+  CJS_Result set_button_scale_how(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp);
 
-  CJS_Return get_button_scale_when(CJS_Runtime* pRuntime);
-  CJS_Return set_button_scale_when(CJS_Runtime* pRuntime,
+  CJS_Result get_button_scale_when(CJS_Runtime* pRuntime);
+  CJS_Result set_button_scale_when(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp);
 
-  CJS_Return get_calc_order_index(CJS_Runtime* pRuntime);
-  CJS_Return set_calc_order_index(CJS_Runtime* pRuntime,
+  CJS_Result get_calc_order_index(CJS_Runtime* pRuntime);
+  CJS_Result set_calc_order_index(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp);
 
-  CJS_Return get_char_limit(CJS_Runtime* pRuntime);
-  CJS_Return set_char_limit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_char_limit(CJS_Runtime* pRuntime);
+  CJS_Result set_char_limit(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_comb(CJS_Runtime* pRuntime);
-  CJS_Return set_comb(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_comb(CJS_Runtime* pRuntime);
+  CJS_Result set_comb(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_commit_on_sel_change(CJS_Runtime* pRuntime);
-  CJS_Return set_commit_on_sel_change(CJS_Runtime* pRuntime,
+  CJS_Result get_commit_on_sel_change(CJS_Runtime* pRuntime);
+  CJS_Result set_commit_on_sel_change(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp);
 
-  CJS_Return get_current_value_indices(CJS_Runtime* pRuntime);
-  CJS_Return set_current_value_indices(CJS_Runtime* pRuntime,
+  CJS_Result get_current_value_indices(CJS_Runtime* pRuntime);
+  CJS_Result set_current_value_indices(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp);
 
-  CJS_Return get_default_style(CJS_Runtime* pRuntime);
-  CJS_Return set_default_style(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_default_style(CJS_Runtime* pRuntime);
+  CJS_Result set_default_style(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_default_value(CJS_Runtime* pRuntime);
-  CJS_Return set_default_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_default_value(CJS_Runtime* pRuntime);
+  CJS_Result set_default_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_do_not_scroll(CJS_Runtime* pRuntime);
-  CJS_Return set_do_not_scroll(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_do_not_scroll(CJS_Runtime* pRuntime);
+  CJS_Result set_do_not_scroll(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_do_not_spell_check(CJS_Runtime* pRuntime);
-  CJS_Return set_do_not_spell_check(CJS_Runtime* pRuntime,
+  CJS_Result get_do_not_spell_check(CJS_Runtime* pRuntime);
+  CJS_Result set_do_not_spell_check(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp);
 
-  CJS_Return get_delay(CJS_Runtime* pRuntime);
-  CJS_Return set_delay(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_delay(CJS_Runtime* pRuntime);
+  CJS_Result set_delay(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_display(CJS_Runtime* pRuntime);
-  CJS_Return set_display(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_display(CJS_Runtime* pRuntime);
+  CJS_Result set_display(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_doc(CJS_Runtime* pRuntime);
-  CJS_Return set_doc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_doc(CJS_Runtime* pRuntime);
+  CJS_Result set_doc(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_editable(CJS_Runtime* pRuntime);
-  CJS_Return set_editable(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_editable(CJS_Runtime* pRuntime);
+  CJS_Result set_editable(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_export_values(CJS_Runtime* pRuntime);
-  CJS_Return set_export_values(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_export_values(CJS_Runtime* pRuntime);
+  CJS_Result set_export_values(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_file_select(CJS_Runtime* pRuntime);
-  CJS_Return set_file_select(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_file_select(CJS_Runtime* pRuntime);
+  CJS_Result set_file_select(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_fill_color(CJS_Runtime* pRuntime);
-  CJS_Return set_fill_color(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_fill_color(CJS_Runtime* pRuntime);
+  CJS_Result set_fill_color(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_hidden(CJS_Runtime* pRuntime);
-  CJS_Return set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_hidden(CJS_Runtime* pRuntime);
+  CJS_Result set_hidden(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_highlight(CJS_Runtime* pRuntime);
-  CJS_Return set_highlight(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_highlight(CJS_Runtime* pRuntime);
+  CJS_Result set_highlight(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_line_width(CJS_Runtime* pRuntime);
-  CJS_Return set_line_width(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_line_width(CJS_Runtime* pRuntime);
+  CJS_Result set_line_width(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_multiline(CJS_Runtime* pRuntime);
-  CJS_Return set_multiline(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_multiline(CJS_Runtime* pRuntime);
+  CJS_Result set_multiline(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_multiple_selection(CJS_Runtime* pRuntime);
-  CJS_Return set_multiple_selection(CJS_Runtime* pRuntime,
+  CJS_Result get_multiple_selection(CJS_Runtime* pRuntime);
+  CJS_Result set_multiple_selection(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp);
 
-  CJS_Return get_name(CJS_Runtime* pRuntime);
-  CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_name(CJS_Runtime* pRuntime);
+  CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_num_items(CJS_Runtime* pRuntime);
-  CJS_Return set_num_items(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_num_items(CJS_Runtime* pRuntime);
+  CJS_Result set_num_items(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_page(CJS_Runtime* pRuntime);
-  CJS_Return set_page(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_page(CJS_Runtime* pRuntime);
+  CJS_Result set_page(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_password(CJS_Runtime* pRuntime);
-  CJS_Return set_password(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_password(CJS_Runtime* pRuntime);
+  CJS_Result set_password(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_print(CJS_Runtime* pRuntime);
-  CJS_Return set_print(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_print(CJS_Runtime* pRuntime);
+  CJS_Result set_print(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_radios_in_unison(CJS_Runtime* pRuntime);
-  CJS_Return set_radios_in_unison(CJS_Runtime* pRuntime,
+  CJS_Result get_radios_in_unison(CJS_Runtime* pRuntime);
+  CJS_Result set_radios_in_unison(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp);
 
-  CJS_Return get_readonly(CJS_Runtime* pRuntime);
-  CJS_Return set_readonly(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_readonly(CJS_Runtime* pRuntime);
+  CJS_Result set_readonly(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rect(CJS_Runtime* pRuntime);
-  CJS_Return set_rect(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rect(CJS_Runtime* pRuntime);
+  CJS_Result set_rect(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_required(CJS_Runtime* pRuntime);
-  CJS_Return set_required(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_required(CJS_Runtime* pRuntime);
+  CJS_Result set_required(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rich_text(CJS_Runtime* pRuntime);
-  CJS_Return set_rich_text(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rich_text(CJS_Runtime* pRuntime);
+  CJS_Result set_rich_text(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rich_value(CJS_Runtime* pRuntime);
-  CJS_Return set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rich_value(CJS_Runtime* pRuntime);
+  CJS_Result set_rich_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_rotation(CJS_Runtime* pRuntime);
-  CJS_Return set_rotation(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_rotation(CJS_Runtime* pRuntime);
+  CJS_Result set_rotation(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_stroke_color(CJS_Runtime* pRuntime);
-  CJS_Return set_stroke_color(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_stroke_color(CJS_Runtime* pRuntime);
+  CJS_Result set_stroke_color(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_style(CJS_Runtime* pRuntime);
-  CJS_Return set_style(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_style(CJS_Runtime* pRuntime);
+  CJS_Result set_style(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_submit_name(CJS_Runtime* pRuntime);
-  CJS_Return set_submit_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_submit_name(CJS_Runtime* pRuntime);
+  CJS_Result set_submit_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_text_font(CJS_Runtime* pRuntime);
-  CJS_Return set_text_font(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_text_font(CJS_Runtime* pRuntime);
+  CJS_Result set_text_font(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_text_size(CJS_Runtime* pRuntime);
-  CJS_Return set_text_size(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_text_size(CJS_Runtime* pRuntime);
+  CJS_Result set_text_size(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_type(CJS_Runtime* pRuntime);
-  CJS_Return set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_type(CJS_Runtime* pRuntime);
+  CJS_Result set_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_user_name(CJS_Runtime* pRuntime);
-  CJS_Return set_user_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_user_name(CJS_Runtime* pRuntime);
+  CJS_Result set_user_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_value(CJS_Runtime* pRuntime);
-  CJS_Return set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_value(CJS_Runtime* pRuntime);
+  CJS_Result set_value(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return get_value_as_string(CJS_Runtime* pRuntime);
-  CJS_Return set_value_as_string(CJS_Runtime* pRuntime,
+  CJS_Result get_value_as_string(CJS_Runtime* pRuntime);
+  CJS_Result set_value_as_string(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp);
 
-  CJS_Return get_source(CJS_Runtime* pRuntime);
-  CJS_Return set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_source(CJS_Runtime* pRuntime);
+  CJS_Result set_source(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
-  CJS_Return browseForFileToSubmit(
+  CJS_Result browseForFileToSubmit(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return buttonGetCaption(CJS_Runtime* pRuntime,
+  CJS_Result buttonGetCaption(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return buttonGetIcon(CJS_Runtime* pRuntime,
+  CJS_Result buttonGetIcon(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return buttonImportIcon(CJS_Runtime* pRuntime,
+  CJS_Result buttonImportIcon(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return buttonSetCaption(CJS_Runtime* pRuntime,
+  CJS_Result buttonSetCaption(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return buttonSetIcon(CJS_Runtime* pRuntime,
+  CJS_Result buttonSetIcon(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return checkThisBox(CJS_Runtime* pRuntime,
+  CJS_Result checkThisBox(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return clearItems(CJS_Runtime* pRuntime,
+  CJS_Result clearItems(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return defaultIsChecked(CJS_Runtime* pRuntime,
+  CJS_Result defaultIsChecked(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return deleteItemAt(CJS_Runtime* pRuntime,
+  CJS_Result deleteItemAt(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getArray(CJS_Runtime* pRuntime,
+  CJS_Result getArray(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getItemAt(CJS_Runtime* pRuntime,
+  CJS_Result getItemAt(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return getLock(CJS_Runtime* pRuntime,
+  CJS_Result getLock(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return insertItemAt(CJS_Runtime* pRuntime,
+  CJS_Result insertItemAt(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return isBoxChecked(CJS_Runtime* pRuntime,
+  CJS_Result isBoxChecked(CJS_Runtime* pRuntime,
                           const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return isDefaultChecked(CJS_Runtime* pRuntime,
+  CJS_Result isDefaultChecked(CJS_Runtime* pRuntime,
                               const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return setAction(CJS_Runtime* pRuntime,
+  CJS_Result setAction(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return setFocus(CJS_Runtime* pRuntime,
+  CJS_Result setFocus(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return setItems(CJS_Runtime* pRuntime,
+  CJS_Result setItems(CJS_Runtime* pRuntime,
                       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return setLock(CJS_Runtime* pRuntime,
+  CJS_Result setLock(CJS_Runtime* pRuntime,
                      const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return signatureGetModifications(
+  CJS_Result signatureGetModifications(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return signatureGetSeedValue(
+  CJS_Result signatureGetSeedValue(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return signatureInfo(CJS_Runtime* pRuntime,
+  CJS_Result signatureInfo(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return signatureSetSeedValue(
+  CJS_Result signatureSetSeedValue(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return signatureSign(CJS_Runtime* pRuntime,
+  CJS_Result signatureSign(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return signatureValidate(CJS_Runtime* pRuntime,
+  CJS_Result signatureValidate(CJS_Runtime* pRuntime,
                                const std::vector<v8::Local<v8::Value>>& params);
 
   void SetDelay(bool bDelay);
diff --git a/fxjs/cjs_global.cpp b/fxjs/cjs_global.cpp
index e747d62..ea8694f 100644
--- a/fxjs/cjs_global.cpp
+++ b/fxjs/cjs_global.cpp
@@ -40,7 +40,7 @@
   if (!pRuntime)
     return;
 
-  CJS_Return result =
+  CJS_Result result =
       pObj->QueryProperty(PropFromV8Prop(info.GetIsolate(), property).c_str());
 
   info.GetReturnValue().Set(!result.HasError() ? 4 : 0);
@@ -58,7 +58,7 @@
   if (!pRuntime)
     return;
 
-  CJS_Return result = pObj->GetProperty(
+  CJS_Result result = pObj->GetProperty(
       pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
 
   if (result.HasError()) {
@@ -83,7 +83,7 @@
   if (!pRuntime)
     return;
 
-  CJS_Return result = pObj->SetProperty(
+  CJS_Result result = pObj->SetProperty(
       pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str(), value);
 
   if (result.HasError()) {
@@ -104,7 +104,7 @@
   if (!pRuntime)
     return;
 
-  CJS_Return result = pObj->DelProperty(
+  CJS_Result result = pObj->DelProperty(
       pRuntime, PropFromV8Prop(info.GetIsolate(), property).c_str());
   if (result.HasError()) {
     // TODO(dsinclair): Should this set the pRuntime->Error result?
@@ -224,52 +224,52 @@
   UpdateGlobalPersistentVariables();
 }
 
-CJS_Return CJS_Global::QueryProperty(const wchar_t* propname) {
+CJS_Result CJS_Global::QueryProperty(const wchar_t* propname) {
   if (WideString(propname) != L"setPersistent")
-    return CJS_Return::Failure(JSMessage::kUnknownProperty);
-  return CJS_Return::Success();
+    return CJS_Result::Failure(JSMessage::kUnknownProperty);
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Global::DelProperty(CJS_Runtime* pRuntime,
+CJS_Result CJS_Global::DelProperty(CJS_Runtime* pRuntime,
                                    const wchar_t* propname) {
   auto it = m_MapGlobal.find(WideString(propname).ToDefANSI());
   if (it == m_MapGlobal.end())
-    return CJS_Return::Failure(JSMessage::kUnknownProperty);
+    return CJS_Result::Failure(JSMessage::kUnknownProperty);
 
   it->second->bDeleted = true;
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Global::GetProperty(CJS_Runtime* pRuntime,
+CJS_Result CJS_Global::GetProperty(CJS_Runtime* pRuntime,
                                    const wchar_t* propname) {
   auto it = m_MapGlobal.find(WideString(propname).ToDefANSI());
   if (it == m_MapGlobal.end())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   JSGlobalData* pData = it->second.get();
   if (pData->bDeleted)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   switch (pData->nType) {
     case JS_GlobalDataType::NUMBER:
-      return CJS_Return::Success(pRuntime->NewNumber(pData->dData));
+      return CJS_Result::Success(pRuntime->NewNumber(pData->dData));
     case JS_GlobalDataType::BOOLEAN:
-      return CJS_Return::Success(pRuntime->NewBoolean(pData->bData));
+      return CJS_Result::Success(pRuntime->NewBoolean(pData->bData));
     case JS_GlobalDataType::STRING:
-      return CJS_Return::Success(pRuntime->NewString(
+      return CJS_Result::Success(pRuntime->NewString(
           WideString::FromLocal(pData->sData.AsStringView()).AsStringView()));
     case JS_GlobalDataType::OBJECT:
-      return CJS_Return::Success(
+      return CJS_Result::Success(
           v8::Local<v8::Object>::New(pRuntime->GetIsolate(), pData->pData));
     case JS_GlobalDataType::NULLOBJ:
-      return CJS_Return::Success(pRuntime->NewNull());
+      return CJS_Result::Success(pRuntime->NewNull());
     default:
       break;
   }
-  return CJS_Return::Failure(JSMessage::kObjectTypeError);
+  return CJS_Result::Failure(JSMessage::kObjectTypeError);
 }
 
-CJS_Return CJS_Global::SetProperty(CJS_Runtime* pRuntime,
+CJS_Result CJS_Global::SetProperty(CJS_Runtime* pRuntime,
                                    const wchar_t* propname,
                                    v8::Local<v8::Value> vp) {
   ByteString sPropName = WideString(propname).ToDefANSI();
@@ -298,23 +298,23 @@
   }
   if (vp->IsUndefined()) {
     DelProperty(pRuntime, propname);
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
-  return CJS_Return::Failure(JSMessage::kObjectTypeError);
+  return CJS_Result::Failure(JSMessage::kObjectTypeError);
 }
 
-CJS_Return CJS_Global::setPersistent(
+CJS_Result CJS_Global::setPersistent(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   auto it = m_MapGlobal.find(pRuntime->ToWideString(params[0]).ToDefANSI());
   if (it == m_MapGlobal.end() || it->second->bDeleted)
-    return CJS_Return::Failure(JSMessage::kGlobalNotFoundError);
+    return CJS_Result::Failure(JSMessage::kGlobalNotFoundError);
 
   it->second->bPersistent = pRuntime->ToBoolean(params[1]);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJS_Global::UpdateGlobalPersistentVariables() {
@@ -497,7 +497,7 @@
   m_MapGlobal.clear();
 }
 
-CJS_Return CJS_Global::SetGlobalVariables(const ByteString& propname,
+CJS_Result CJS_Global::SetGlobalVariables(const ByteString& propname,
                                           JS_GlobalDataType nType,
                                           double dData,
                                           bool bData,
@@ -505,7 +505,7 @@
                                           v8::Local<v8::Object> pData,
                                           bool bDefaultPersistent) {
   if (propname.IsEmpty())
-    return CJS_Return::Failure(JSMessage::kUnknownProperty);
+    return CJS_Result::Failure(JSMessage::kUnknownProperty);
 
   auto it = m_MapGlobal.find(propname);
   if (it != m_MapGlobal.end()) {
@@ -533,9 +533,9 @@
       case JS_GlobalDataType::NULLOBJ:
         break;
       default:
-        return CJS_Return::Failure(JSMessage::kObjectTypeError);
+        return CJS_Result::Failure(JSMessage::kObjectTypeError);
     }
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   auto pNewData = pdfium::MakeUnique<JSGlobalData>();
@@ -565,8 +565,8 @@
       pNewData->bPersistent = bDefaultPersistent;
       break;
     default:
-      return CJS_Return::Failure(JSMessage::kObjectTypeError);
+      return CJS_Result::Failure(JSMessage::kObjectTypeError);
   }
   m_MapGlobal[propname] = std::move(pNewData);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
diff --git a/fxjs/cjs_global.h b/fxjs/cjs_global.h
index 51f872a..491897a 100644
--- a/fxjs/cjs_global.h
+++ b/fxjs/cjs_global.h
@@ -39,14 +39,14 @@
   CJS_Global(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime);
   ~CJS_Global() override;
 
-  CJS_Return DelProperty(CJS_Runtime* pRuntime, const wchar_t* propname);
+  CJS_Result DelProperty(CJS_Runtime* pRuntime, const wchar_t* propname);
   void Initial(CPDFSDK_FormFillEnvironment* pFormFillEnv);
 
-  CJS_Return setPersistent(CJS_Runtime* pRuntime,
+  CJS_Result setPersistent(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return QueryProperty(const wchar_t* propname);
-  CJS_Return GetProperty(CJS_Runtime* pRuntime, const wchar_t* propname);
-  CJS_Return SetProperty(CJS_Runtime* pRuntime,
+  CJS_Result QueryProperty(const wchar_t* propname);
+  CJS_Result GetProperty(CJS_Runtime* pRuntime, const wchar_t* propname);
+  CJS_Result SetProperty(CJS_Runtime* pRuntime,
                          const wchar_t* propname,
                          v8::Local<v8::Value> vp);
 
@@ -70,7 +70,7 @@
   void UpdateGlobalPersistentVariables();
   void CommitGlobalPersisitentVariables(CJS_Runtime* pRuntime);
   void DestroyGlobalPersisitentVariables();
-  CJS_Return SetGlobalVariables(const ByteString& propname,
+  CJS_Result SetGlobalVariables(const ByteString& propname,
                                 JS_GlobalDataType nType,
                                 double dData,
                                 bool bData,
diff --git a/fxjs/cjs_icon.cpp b/fxjs/cjs_icon.cpp
index dca9eaf..29fde8a 100644
--- a/fxjs/cjs_icon.cpp
+++ b/fxjs/cjs_icon.cpp
@@ -29,10 +29,10 @@
 
 CJS_Icon::~CJS_Icon() = default;
 
-CJS_Return CJS_Icon::get_name(CJS_Runtime* pRuntime) {
-  return CJS_Return::Success(pRuntime->NewString(m_swIconName.AsStringView()));
+CJS_Result CJS_Icon::get_name(CJS_Runtime* pRuntime) {
+  return CJS_Result::Success(pRuntime->NewString(m_swIconName.AsStringView()));
 }
 
-CJS_Return CJS_Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
-  return CJS_Return::Failure(JSMessage::kNotSupportedError);
+CJS_Result CJS_Icon::set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp) {
+  return CJS_Result::Failure(JSMessage::kNotSupportedError);
 }
diff --git a/fxjs/cjs_icon.h b/fxjs/cjs_icon.h
index 05fa430..6df671b 100644
--- a/fxjs/cjs_icon.h
+++ b/fxjs/cjs_icon.h
@@ -27,8 +27,8 @@
   static const char kName[];
   static const JSPropertySpec PropertySpecs[];
 
-  CJS_Return get_name(CJS_Runtime* pRuntime);
-  CJS_Return set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
+  CJS_Result get_name(CJS_Runtime* pRuntime);
+  CJS_Result set_name(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp);
 
   WideString m_swIconName;
 };
diff --git a/fxjs/cjs_publicmethods.cpp b/fxjs/cjs_publicmethods.cpp
index 86a2a77..3cf70cc 100644
--- a/fxjs/cjs_publicmethods.cpp
+++ b/fxjs/cjs_publicmethods.cpp
@@ -118,7 +118,7 @@
   return prefix + change + postfix;
 }
 
-template <CJS_Return (*F)(CJS_Runtime*,
+template <CJS_Result (*F)(CJS_Runtime*,
                           const std::vector<v8::Local<v8::Value>>&)>
 void JSGlobalFunc(const char* func_name_string,
                   const v8::FunctionCallbackInfo<v8::Value>& info) {
@@ -134,7 +134,7 @@
   for (int i = 0; i < info.Length(); ++i)
     parameters.push_back(info[i]);
 
-  CJS_Return result = (*F)(pRuntime, parameters);
+  CJS_Result result = (*F)(pRuntime, parameters);
   if (result.HasError()) {
     pRuntime->Error(
         JSFormatErrorString(func_name_string, nullptr, result.Error()));
@@ -869,22 +869,22 @@
 
 // function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency,
 // bCurrencyPrepend)
-CJS_Return CJS_PublicMethods::AFNumber_Format(
+CJS_Result CJS_PublicMethods::AFNumber_Format(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
 #if _FX_OS_ != _FX_OS_ANDROID_
   if (params.size() != 6)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(L"No event handler");
+    return CJS_Result::Failure(L"No event handler");
 
   WideString& Value = pEvent->Value();
   ByteString strValue = StrTrim(Value.ToDefANSI());
   if (strValue.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   int iDec = abs(pRuntime->ToInt32(params[0]));
   int iSepStyle = ValidStyleOrZero(pRuntime->ToInt32(params[1]));
@@ -961,7 +961,7 @@
         pRuntime->PutArrayElement(arColor, 2, pRuntime->NewNumber(0));
         pRuntime->PutArrayElement(arColor, 3, pRuntime->NewNumber(0));
 
-        CJS_Return result = fTarget->get_text_color(pRuntime);
+        CJS_Result result = fTarget->get_text_color(pRuntime);
         CFX_Color crProp = CJS_Color::ConvertArrayToPWLColor(
             pRuntime, pRuntime->ToArray(result.Return()));
         CFX_Color crColor =
@@ -972,21 +972,21 @@
     }
   }
 #endif
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // function AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency,
 // bCurrencyPrepend)
-CJS_Return CJS_PublicMethods::AFNumber_Keystroke(
+CJS_Result CJS_PublicMethods::AFNumber_Keystroke(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventContext* pContext = pRuntime->GetCurrentEventContext();
   CJS_EventHandler* pEvent = pContext->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString& val = pEvent->Value();
   WideString& wstrChange = pEvent->Change();
@@ -995,17 +995,17 @@
   if (pEvent->WillCommit()) {
     WideString swTemp = StrTrim(wstrValue);
     if (swTemp.IsEmpty())
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     NormalizeDecimalMarkW(&swTemp);
     if (!IsNumber(swTemp)) {
       pEvent->Rc() = false;
       WideString sError = JSGetStringFromID(JSMessage::kInvalidInputError);
       AlertIfPossible(pContext, sError);
-      return CJS_Return::Failure(sError);
+      return CJS_Result::Failure(sError);
     }
     // It happens after the last keystroke and before validating,
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   WideString wstrSelected;
@@ -1019,7 +1019,7 @@
     // can't insert "change" in front of sign position.
     if (!wstrSelected.IsEmpty() && pEvent->SelStart() == 0) {
       pEvent->Rc() = false;
-      return CJS_Return::Success();
+      return CJS_Result::Success();
     }
   }
 
@@ -1031,7 +1031,7 @@
     if (wstrChange[i] == cSep) {
       if (bHasSep) {
         pEvent->Rc() = false;
-        return CJS_Return::Success();
+        return CJS_Result::Success();
       }
       bHasSep = true;
       continue;
@@ -1039,16 +1039,16 @@
     if (wstrChange[i] == L'-') {
       if (bHasSign) {
         pEvent->Rc() = false;
-        return CJS_Return::Success();
+        return CJS_Result::Success();
       }
       // sign's position is not correct
       if (i != 0) {
         pEvent->Rc() = false;
-        return CJS_Return::Success();
+        return CJS_Result::Success();
       }
       if (pEvent->SelStart() != 0) {
         pEvent->Rc() = false;
-        return CJS_Return::Success();
+        return CJS_Result::Success();
       }
       bHasSign = true;
       continue;
@@ -1056,31 +1056,31 @@
 
     if (!std::iswdigit(wstrChange[i])) {
       pEvent->Rc() = false;
-      return CJS_Return::Success();
+      return CJS_Result::Success();
     }
   }
 
   val = CalcMergedString(pEvent, wstrValue, wstrChange);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // function AFPercent_Format(nDec, sepStyle)
-CJS_Return CJS_PublicMethods::AFPercent_Format(
+CJS_Result CJS_PublicMethods::AFPercent_Format(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
 #if _FX_OS_ != _FX_OS_ANDROID_
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString& Value = pEvent->Value();
   ByteString strValue = StrTrim(Value.ToDefANSI());
   if (strValue.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   int iDec = abs(pRuntime->ToInt32(params[0]));
   int iSepStyle = ValidStyleOrZero(pRuntime->ToInt32(params[1]));
@@ -1141,32 +1141,32 @@
   strValue += '%';
   Value = WideString::FromLocal(strValue.AsStringView());
 #endif
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // AFPercent_Keystroke(nDec, sepStyle)
-CJS_Return CJS_PublicMethods::AFPercent_Keystroke(
+CJS_Result CJS_PublicMethods::AFPercent_Keystroke(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return AFNumber_Keystroke(pRuntime, params);
 }
 
 // function AFDate_FormatEx(cFormat)
-CJS_Return CJS_PublicMethods::AFDate_FormatEx(
+CJS_Result CJS_PublicMethods::AFDate_FormatEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventContext* pContext = pRuntime->GetCurrentEventContext();
   CJS_EventHandler* pEvent = pContext->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   WideString& val = pEvent->Value();
   WideString strValue = val;
   if (strValue.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString sFormat = pRuntime->ToWideString(params[0]);
   double dDate;
@@ -1182,11 +1182,11 @@
     WideString swMsg = WideString::Format(
         JSGetStringFromID(JSMessage::kParseDateError).c_str(), sFormat.c_str());
     AlertIfPossible(pContext, swMsg);
-    return CJS_Return::Failure(JSMessage::kParseDateError);
+    return CJS_Result::Failure(JSMessage::kParseDateError);
   }
 
   val = MakeFormatDate(dDate, sFormat);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 double CJS_PublicMethods::MakeInterDate(const WideString& strValue) {
@@ -1226,25 +1226,25 @@
 }
 
 // AFDate_KeystrokeEx(cFormat)
-CJS_Return CJS_PublicMethods::AFDate_KeystrokeEx(
+CJS_Result CJS_PublicMethods::AFDate_KeystrokeEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1) {
-    return CJS_Return::Failure(
+    return CJS_Result::Failure(
         WideString(L"AFDate_KeystrokeEx's parameter size not correct"));
   }
 
   CJS_EventContext* pContext = pRuntime->GetCurrentEventContext();
   CJS_EventHandler* pEvent = pContext->GetEventHandler();
   if (!pEvent->WillCommit())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   const WideString& strValue = pEvent->Value();
   if (strValue.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString sFormat = pRuntime->ToWideString(params[0]);
   bool bWrongFormat = false;
@@ -1255,14 +1255,14 @@
     AlertIfPossible(pContext, swMsg);
     pEvent->Rc() = false;
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_PublicMethods::AFDate_Format(
+CJS_Result CJS_PublicMethods::AFDate_Format(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   static constexpr const wchar_t* cFormats[] = {L"m/d",
                                                 L"m/d/yy",
@@ -1287,11 +1287,11 @@
 }
 
 // AFDate_KeystrokeEx(cFormat)
-CJS_Return CJS_PublicMethods::AFDate_Keystroke(
+CJS_Result CJS_PublicMethods::AFDate_Keystroke(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   static constexpr const wchar_t* cFormats[] = {L"m/d",
                                                 L"m/d/yy",
@@ -1316,11 +1316,11 @@
 }
 
 // function AFTime_Format(ptf)
-CJS_Return CJS_PublicMethods::AFTime_Format(
+CJS_Result CJS_PublicMethods::AFTime_Format(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   static constexpr const wchar_t* cFormats[] = {L"HH:MM", L"h:MM tt",
                                                 L"HH:MM:ss", L"h:MM:ss tt"};
@@ -1332,11 +1332,11 @@
   return AFDate_FormatEx(pRuntime, newParams);
 }
 
-CJS_Return CJS_PublicMethods::AFTime_Keystroke(
+CJS_Result CJS_PublicMethods::AFTime_Keystroke(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   static constexpr const wchar_t* cFormats[] = {L"HH:MM", L"h:MM tt",
                                                 L"HH:MM:ss", L"h:MM:ss tt"};
@@ -1348,29 +1348,29 @@
   return AFDate_KeystrokeEx(pRuntime, newParams);
 }
 
-CJS_Return CJS_PublicMethods::AFTime_FormatEx(
+CJS_Result CJS_PublicMethods::AFTime_FormatEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return AFDate_FormatEx(pRuntime, params);
 }
 
-CJS_Return CJS_PublicMethods::AFTime_KeystrokeEx(
+CJS_Result CJS_PublicMethods::AFTime_KeystrokeEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return AFDate_KeystrokeEx(pRuntime, params);
 }
 
 // function AFSpecial_Format(psf)
-CJS_Return CJS_PublicMethods::AFSpecial_Format(
+CJS_Result CJS_PublicMethods::AFSpecial_Format(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   const WideString& wsSource = pEvent->Value();
   WideString wsFormat;
@@ -1393,29 +1393,29 @@
   }
 
   pEvent->Value() = CJS_Util::printx(wsFormat, wsSource);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // function AFSpecial_KeystrokeEx(mask)
-CJS_Return CJS_PublicMethods::AFSpecial_KeystrokeEx(
+CJS_Result CJS_PublicMethods::AFSpecial_KeystrokeEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventContext* pContext = pRuntime->GetCurrentEventContext();
   CJS_EventHandler* pEvent = pContext->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   const WideString& valEvent = pEvent->Value();
   WideString wstrMask = pRuntime->ToWideString(params[0]);
   if (wstrMask.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (pEvent->WillCommit()) {
     if (valEvent.IsEmpty())
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     size_t iIndexMask = 0;
     for (; iIndexMask < valEvent.GetLength(); ++iIndexMask) {
@@ -1428,12 +1428,12 @@
                       JSGetStringFromID(JSMessage::kInvalidInputError));
       pEvent->Rc() = false;
     }
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   WideString& wideChange = pEvent->Change();
   if (wideChange.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString wChange = wideChange;
   size_t iIndexMask = pEvent->SelStart();
@@ -1442,13 +1442,13 @@
   if (combined_len > wstrMask.GetLength()) {
     AlertIfPossible(pContext, JSGetStringFromID(JSMessage::kParamTooLongError));
     pEvent->Rc() = false;
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   if (iIndexMask >= wstrMask.GetLength() && !wChange.IsEmpty()) {
     AlertIfPossible(pContext, JSGetStringFromID(JSMessage::kParamTooLongError));
     pEvent->Rc() = false;
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   for (size_t i = 0; i < wChange.GetLength(); ++i) {
@@ -1456,7 +1456,7 @@
       AlertIfPossible(pContext,
                       JSGetStringFromID(JSMessage::kParamTooLongError));
       pEvent->Rc() = false;
-      return CJS_Return::Success();
+      return CJS_Result::Success();
     }
     wchar_t wMask = wstrMask[iIndexMask];
     if (!IsReservedMaskChar(wMask))
@@ -1464,25 +1464,25 @@
 
     if (!MaskSatisfied(wChange[i], wMask)) {
       pEvent->Rc() = false;
-      return CJS_Return::Success();
+      return CJS_Result::Success();
     }
     iIndexMask++;
   }
   wideChange = std::move(wChange);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // function AFSpecial_Keystroke(psf)
-CJS_Return CJS_PublicMethods::AFSpecial_Keystroke(
+CJS_Result CJS_PublicMethods::AFSpecial_Keystroke(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventHandler* pEvent =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   const char* cFormat = "";
   switch (pRuntime->ToInt32(params[0])) {
@@ -1508,11 +1508,11 @@
   return AFSpecial_KeystrokeEx(pRuntime, params2);
 }
 
-CJS_Return CJS_PublicMethods::AFMergeChange(
+CJS_Result CJS_PublicMethods::AFMergeChange(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventHandler* pEventHandler =
       pRuntime->GetCurrentEventContext()->GetEventHandler();
@@ -1522,18 +1522,18 @@
     swValue = pEventHandler->Value();
 
   if (pEventHandler->WillCommit())
-    return CJS_Return::Success(pRuntime->NewString(swValue.AsStringView()));
+    return CJS_Result::Success(pRuntime->NewString(swValue.AsStringView()));
 
-  return CJS_Return::Success(pRuntime->NewString(
+  return CJS_Result::Success(pRuntime->NewString(
       CalcMergedString(pEventHandler, swValue, pEventHandler->Change())
           .AsStringView()));
 }
 
-CJS_Return CJS_PublicMethods::AFParseDateEx(
+CJS_Result CJS_PublicMethods::AFParseDateEx(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString sValue = pRuntime->ToWideString(params[0]);
   WideString sFormat = pRuntime->ToWideString(params[1]);
@@ -1542,27 +1542,27 @@
     WideString swMsg = WideString::Format(
         JSGetStringFromID(JSMessage::kParseDateError).c_str(), sFormat.c_str());
     AlertIfPossible(pRuntime->GetCurrentEventContext(), swMsg);
-    return CJS_Return::Failure(JSMessage::kParseDateError);
+    return CJS_Result::Failure(JSMessage::kParseDateError);
   }
-  return CJS_Return::Success(pRuntime->NewNumber(dDate));
+  return CJS_Result::Success(pRuntime->NewNumber(dDate));
 }
 
-CJS_Return CJS_PublicMethods::AFSimple(
+CJS_Result CJS_PublicMethods::AFSimple(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(pRuntime->NewNumber(static_cast<double>(AF_Simple(
+  return CJS_Result::Success(pRuntime->NewNumber(static_cast<double>(AF_Simple(
       pRuntime->ToWideString(params[0]).c_str(), pRuntime->ToDouble(params[1]),
       pRuntime->ToDouble(params[2])))));
 }
 
-CJS_Return CJS_PublicMethods::AFMakeNumber(
+CJS_Result CJS_PublicMethods::AFMakeNumber(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString ws = pRuntime->ToWideString(params[0]);
   NormalizeDecimalMarkW(&ws);
@@ -1570,19 +1570,19 @@
   v8::Local<v8::Value> val =
       pRuntime->MaybeCoerceToNumber(pRuntime->NewString(ws.AsStringView()));
   if (!val->IsNumber())
-    return CJS_Return::Success(pRuntime->NewNumber(0));
+    return CJS_Result::Success(pRuntime->NewNumber(0));
 
-  return CJS_Return::Success(val);
+  return CJS_Result::Success(val);
 }
 
-CJS_Return CJS_PublicMethods::AFSimple_Calculate(
+CJS_Result CJS_PublicMethods::AFSimple_Calculate(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if ((params[1].IsEmpty() || !params[1]->IsArray()) && !params[1]->IsString())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CPDFSDK_InterForm* pReaderInterForm =
       pRuntime->GetFormFillEnv()->GetInterForm();
@@ -1663,24 +1663,24 @@
         pRuntime->ToWideString(pRuntime->NewNumber(dValue));
   }
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 // This function validates the current event to ensure that its value is
 // within the specified range.
-CJS_Return CJS_PublicMethods::AFRange_Validate(
+CJS_Result CJS_PublicMethods::AFRange_Validate(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 4)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CJS_EventContext* pContext = pRuntime->GetCurrentEventContext();
   CJS_EventHandler* pEvent = pContext->GetEventHandler();
   if (!pEvent->m_pValue)
-    return CJS_Return::Failure(JSMessage::kBadObjectError);
+    return CJS_Result::Failure(JSMessage::kBadObjectError);
 
   if (pEvent->Value().IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   double dEentValue = atof(pEvent->Value().ToDefANSI().c_str());
   bool bGreaterThan = pRuntime->ToBoolean(params[0]);
@@ -1711,14 +1711,14 @@
     AlertIfPossible(pContext, swMsg);
     pEvent->Rc() = false;
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_PublicMethods::AFExtractNums(
+CJS_Result CJS_PublicMethods::AFExtractNums(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString str = pRuntime->ToWideString(params[0]);
   if (str.GetLength() > 0 && IsDigitSeparatorOrDecimalMark(str[0]))
@@ -1742,7 +1742,7 @@
                               pRuntime->NewString(sPart.AsStringView()));
   }
   if (pRuntime->GetArrayLength(nums) > 0)
-    return CJS_Return::Success(nums);
+    return CJS_Result::Success(nums);
 
-  return CJS_Return::Success(pRuntime->NewUndefined());
+  return CJS_Result::Success(pRuntime->NewUndefined());
 }
diff --git a/fxjs/cjs_publicmethods.h b/fxjs/cjs_publicmethods.h
index 89603ca..8ec3562 100644
--- a/fxjs/cjs_publicmethods.h
+++ b/fxjs/cjs_publicmethods.h
@@ -26,69 +26,69 @@
   static WideString MakeFormatDate(double dDate, const WideString& format);
   static bool IsNumber(const WideString& str);
 
-  static CJS_Return AFNumber_Format(
+  static CJS_Result AFNumber_Format(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFNumber_Keystroke(
+  static CJS_Result AFNumber_Keystroke(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFPercent_Format(
+  static CJS_Result AFPercent_Format(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFPercent_Keystroke(
+  static CJS_Result AFPercent_Keystroke(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFDate_FormatEx(
+  static CJS_Result AFDate_FormatEx(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFDate_KeystrokeEx(
+  static CJS_Result AFDate_KeystrokeEx(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFDate_Format(
+  static CJS_Result AFDate_Format(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFDate_Keystroke(
+  static CJS_Result AFDate_Keystroke(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFTime_FormatEx(
+  static CJS_Result AFTime_FormatEx(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFTime_KeystrokeEx(
+  static CJS_Result AFTime_KeystrokeEx(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFTime_Format(
+  static CJS_Result AFTime_Format(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFTime_Keystroke(
+  static CJS_Result AFTime_Keystroke(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFSpecial_Format(
+  static CJS_Result AFSpecial_Format(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFSpecial_Keystroke(
+  static CJS_Result AFSpecial_Keystroke(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFSpecial_KeystrokeEx(
+  static CJS_Result AFSpecial_KeystrokeEx(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFSimple(CJS_Runtime* pRuntime,
+  static CJS_Result AFSimple(CJS_Runtime* pRuntime,
                              const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFMakeNumber(
+  static CJS_Result AFMakeNumber(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFSimple_Calculate(
+  static CJS_Result AFSimple_Calculate(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFRange_Validate(
+  static CJS_Result AFRange_Validate(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFMergeChange(
+  static CJS_Result AFMergeChange(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFParseDateEx(
+  static CJS_Result AFParseDateEx(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
-  static CJS_Return AFExtractNums(
+  static CJS_Result AFExtractNums(
       CJS_Runtime* pRuntime,
       const std::vector<v8::Local<v8::Value>>& params);
 
diff --git a/fxjs/cjs_publicmethods_embeddertest.cpp b/fxjs/cjs_publicmethods_embeddertest.cpp
index 623ce68..5f241f3 100644
--- a/fxjs/cjs_publicmethods_embeddertest.cpp
+++ b/fxjs/cjs_publicmethods_embeddertest.cpp
@@ -196,7 +196,7 @@
   params.push_back(runtime.NewString("SUM"));
   params.push_back(ary);
 
-  CJS_Return ret = CJS_PublicMethods::AFSimple_Calculate(&runtime, params);
+  CJS_Result ret = CJS_PublicMethods::AFSimple_Calculate(&runtime, params);
   UnloadPage(page);
 
   runtime.GetCurrentEventContext()->GetEventHandler()->m_pValue = nullptr;
@@ -237,7 +237,7 @@
   params.push_back(runtime.NewString(L"-10"));
   params.push_back(runtime.NewString(L""));
 
-  CJS_Return ret = CJS_PublicMethods::AFNumber_Keystroke(&runtime, params);
+  CJS_Result ret = CJS_PublicMethods::AFNumber_Keystroke(&runtime, params);
   EXPECT_TRUE(valid);
   EXPECT_TRUE(!ret.HasError());
   EXPECT_TRUE(!ret.HasReturn());
diff --git a/fxjs/cjs_report.cpp b/fxjs/cjs_report.cpp
index aa4ef02..1cebefe 100644
--- a/fxjs/cjs_report.cpp
+++ b/fxjs/cjs_report.cpp
@@ -35,15 +35,15 @@
 
 CJS_Report::~CJS_Report() = default;
 
-CJS_Return CJS_Report::writeText(
+CJS_Result CJS_Report::writeText(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJS_Report::save(CJS_Runtime* pRuntime,
+CJS_Result CJS_Report::save(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   // Unsafe, not supported, but do not return error.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
diff --git a/fxjs/cjs_report.h b/fxjs/cjs_report.h
index f9d1dc8..a969b41 100644
--- a/fxjs/cjs_report.h
+++ b/fxjs/cjs_report.h
@@ -27,9 +27,9 @@
   static const char kName[];
   static const JSMethodSpec MethodSpecs[];
 
-  CJS_Return save(CJS_Runtime* pRuntime,
+  CJS_Result save(CJS_Runtime* pRuntime,
                   const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return writeText(CJS_Runtime* pRuntime,
+  CJS_Result writeText(CJS_Runtime* pRuntime,
                        const std::vector<v8::Local<v8::Value>>& params);
 };
 
diff --git a/fxjs/cjs_result.cpp b/fxjs/cjs_result.cpp
new file mode 100644
index 0000000..92f2b0b
--- /dev/null
+++ b/fxjs/cjs_result.cpp
@@ -0,0 +1,19 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fxjs/cjs_result.h"
+
+CJS_Result::CJS_Result() {}
+
+CJS_Result::CJS_Result(v8::Local<v8::Value> ret) : return_(ret) {}
+
+CJS_Result::CJS_Result(const WideString& err) : error_(err) {}
+
+CJS_Result::CJS_Result(JSMessage id) : CJS_Result(JSGetStringFromID(id)) {}
+
+CJS_Result::CJS_Result(const CJS_Result&) = default;
+
+CJS_Result::~CJS_Result() = default;
diff --git a/fxjs/cjs_result.h b/fxjs/cjs_result.h
new file mode 100644
index 0000000..dc65d18
--- /dev/null
+++ b/fxjs/cjs_result.h
@@ -0,0 +1,57 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef FXJS_CJS_RESULT_H_
+#define FXJS_CJS_RESULT_H_
+
+#include "fxjs/cfxjs_engine.h"
+#include "fxjs/js_resources.h"
+#include "third_party/base/optional.h"
+
+class CJS_Result {
+ public:
+  // Wrap constructors with static methods so we can apply WARN_UNUSED_RESULT,
+  // otherwise we can't catch places where someone mistakenly writes:
+  //
+  //     if (error)
+  //       CJS_Result(JS_ERROR_CODE);
+  //
+  // instead of
+  //
+  //     if (error)
+  //       return CJS_Result(JS_ERROR_CODE);
+  //
+  static CJS_Result Success() WARN_UNUSED_RESULT { return CJS_Result(); }
+  static CJS_Result Success(v8::Local<v8::Value> value) WARN_UNUSED_RESULT {
+    return CJS_Result(value);
+  }
+  static CJS_Result Failure(const WideString& str) WARN_UNUSED_RESULT {
+    return CJS_Result(str);
+  }
+  static CJS_Result Failure(JSMessage id) WARN_UNUSED_RESULT {
+    return CJS_Result(id);
+  }
+
+  CJS_Result(const CJS_Result&);
+  ~CJS_Result();
+
+  bool HasError() const { return error_.has_value(); }
+  WideString Error() const { return error_.value(); }
+
+  bool HasReturn() const { return !return_.IsEmpty(); }
+  v8::Local<v8::Value> Return() const { return return_; }
+
+ private:
+  CJS_Result();                               // Successful but empty return.
+  explicit CJS_Result(v8::Local<v8::Value>);  // Successful return with value.
+  explicit CJS_Result(const WideString&);     // Error with custom message.
+  explicit CJS_Result(JSMessage id);          // Error with stock message.
+
+  Optional<WideString> error_;
+  v8::Local<v8::Value> return_;
+};
+
+#endif  // FXJS_CJS_RESULT_H_
diff --git a/fxjs/cjs_return.cpp b/fxjs/cjs_return.cpp
deleted file mode 100644
index 49ad54a..0000000
--- a/fxjs/cjs_return.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2017 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "fxjs/cjs_return.h"
-
-CJS_Return::CJS_Return() {}
-
-CJS_Return::CJS_Return(v8::Local<v8::Value> ret) : return_(ret) {}
-
-CJS_Return::CJS_Return(const WideString& err) : error_(err) {}
-
-CJS_Return::CJS_Return(JSMessage id) : CJS_Return(JSGetStringFromID(id)) {}
-
-CJS_Return::CJS_Return(const CJS_Return&) = default;
-
-CJS_Return::~CJS_Return() = default;
diff --git a/fxjs/cjs_return.h b/fxjs/cjs_return.h
deleted file mode 100644
index 99a2af6..0000000
--- a/fxjs/cjs_return.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2017 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef FXJS_CJS_RETURN_H_
-#define FXJS_CJS_RETURN_H_
-
-#include "fxjs/cfxjs_engine.h"
-#include "fxjs/js_resources.h"
-#include "third_party/base/optional.h"
-
-class CJS_Return {
- public:
-  // Wrap constructors with static methods so we can apply WARN_UNUSED_RESULT,
-  // otherwise we can't catch places where someone mistakenly writes:
-  //
-  //     if (error)
-  //       CJS_Return(JS_ERROR_CODE);
-  //
-  // instead of
-  //
-  //     if (error)
-  //       return CJS_Return(JS_ERROR_CODE);
-  //
-  static CJS_Return Success() WARN_UNUSED_RESULT { return CJS_Return(); }
-  static CJS_Return Success(v8::Local<v8::Value> value) WARN_UNUSED_RESULT {
-    return CJS_Return(value);
-  }
-  static CJS_Return Failure(const WideString& str) WARN_UNUSED_RESULT {
-    return CJS_Return(str);
-  }
-  static CJS_Return Failure(JSMessage id) WARN_UNUSED_RESULT {
-    return CJS_Return(id);
-  }
-
-  CJS_Return(const CJS_Return&);
-  ~CJS_Return();
-
-  bool HasError() const { return error_.has_value(); }
-  WideString Error() const { return error_.value(); }
-
-  bool HasReturn() const { return !return_.IsEmpty(); }
-  v8::Local<v8::Value> Return() const { return return_; }
-
- private:
-  CJS_Return();                               // Successful but empty return.
-  explicit CJS_Return(v8::Local<v8::Value>);  // Successful return with value.
-  explicit CJS_Return(const WideString&);     // Error with custom message.
-  explicit CJS_Return(JSMessage id);          // Error with stock message.
-
-  Optional<WideString> error_;
-  v8::Local<v8::Value> return_;
-};
-
-#endif  // FXJS_CJS_RETURN_H_
diff --git a/fxjs/cjs_util.cpp b/fxjs/cjs_util.cpp
index 54a74f2..0c40b10 100644
--- a/fxjs/cjs_util.cpp
+++ b/fxjs/cjs_util.cpp
@@ -84,11 +84,11 @@
 
 CJS_Util::~CJS_Util() = default;
 
-CJS_Return CJS_Util::printf(CJS_Runtime* pRuntime,
+CJS_Result CJS_Util::printf(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   const size_t iSize = params.size();
   if (iSize < 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   std::wstring unsafe_fmt_string(pRuntime->ToWideString(params[0]).c_str());
   std::vector<std::wstring> unsafe_conversion_specifiers;
@@ -143,21 +143,21 @@
   }
 
   c_strResult.erase(c_strResult.begin());
-  return CJS_Return::Success(pRuntime->NewString(c_strResult.c_str()));
+  return CJS_Result::Success(pRuntime->NewString(c_strResult.c_str()));
 }
 
-CJS_Return CJS_Util::printd(CJS_Runtime* pRuntime,
+CJS_Result CJS_Util::printd(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   const size_t iSize = params.size();
   if (iSize < 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if (params[1].IsEmpty() || !params[1]->IsDate())
-    return CJS_Return::Failure(JSMessage::kSecondParamNotDateError);
+    return CJS_Result::Failure(JSMessage::kSecondParamNotDateError);
 
   v8::Local<v8::Date> v8_date = params[1].As<v8::Date>();
   if (v8_date.IsEmpty() || std::isnan(pRuntime->ToDouble(v8_date)))
-    return CJS_Return::Failure(JSMessage::kSecondParamInvalidDateError);
+    return CJS_Result::Failure(JSMessage::kSecondParamInvalidDateError);
 
   double date = JS_LocalTime(pRuntime->ToDouble(v8_date));
   int year = JS_GetYearFromTime(date);
@@ -183,18 +183,18 @@
                                       month, day, hour, min, sec);
         break;
       default:
-        return CJS_Return::Failure(JSMessage::kValueError);
+        return CJS_Result::Failure(JSMessage::kValueError);
     }
 
-    return CJS_Return::Success(pRuntime->NewString(swResult.AsStringView()));
+    return CJS_Result::Success(pRuntime->NewString(swResult.AsStringView()));
   }
 
   if (!params[0]->IsString())
-    return CJS_Return::Failure(JSMessage::kTypeError);
+    return CJS_Result::Failure(JSMessage::kTypeError);
 
   // We don't support XFAPicture at the moment.
   if (iSize > 2 && pRuntime->ToBoolean(params[2]))
-    return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kNotSupportedError);
 
   // Convert PDF-style format specifiers to wcsftime specifiers. Remove any
   // pre-existing %-directives before inserting our own.
@@ -214,7 +214,7 @@
     }
 
     if (year < 0)
-      return CJS_Return::Failure(JSMessage::kValueError);
+      return CJS_Result::Failure(JSMessage::kValueError);
 
     const TbConvertAdditional cTableAd[] = {
         {L"m", month}, {L"d", day},
@@ -249,15 +249,15 @@
     wchar_t buf[64] = {};
     FXSYS_wcsftime(buf, 64, cFormat.c_str(), &time);
     cFormat = buf;
-    return CJS_Return::Success(pRuntime->NewString(cFormat.c_str()));
+    return CJS_Result::Success(pRuntime->NewString(cFormat.c_str()));
 }
 
-CJS_Return CJS_Util::printx(CJS_Runtime* pRuntime,
+CJS_Result CJS_Util::printx(CJS_Runtime* pRuntime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pRuntime->NewString(printx(pRuntime->ToWideString(params[0]),
                                  pRuntime->ToWideString(params[1]))
                               .AsStringView()));
@@ -361,10 +361,10 @@
   return wsResult;
 }
 
-CJS_Return CJS_Util::scand(CJS_Runtime* pRuntime,
+CJS_Result CJS_Util::scand(CJS_Runtime* pRuntime,
                            const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString sFormat = pRuntime->ToWideString(params[0]);
   WideString sDate = pRuntime->ToWideString(params[1]);
@@ -372,23 +372,23 @@
   if (sDate.GetLength() > 0)
     dDate = CJS_PublicMethods::MakeRegularDate(sDate, sFormat, nullptr);
   if (std::isnan(dDate))
-    return CJS_Return::Success(pRuntime->NewUndefined());
+    return CJS_Result::Success(pRuntime->NewUndefined());
 
-  return CJS_Return::Success(pRuntime->NewDate(dDate));
+  return CJS_Result::Success(pRuntime->NewDate(dDate));
 }
 
-CJS_Return CJS_Util::byteToChar(
+CJS_Result CJS_Util::byteToChar(
     CJS_Runtime* pRuntime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int arg = pRuntime->ToInt32(params[0]);
   if (arg < 0 || arg > 255)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   WideString wStr(static_cast<wchar_t>(arg));
-  return CJS_Return::Success(pRuntime->NewString(wStr.AsStringView()));
+  return CJS_Result::Success(pRuntime->NewString(wStr.AsStringView()));
 }
 
 // Ensure that sFormat contains at most one well-understood printf formatting
diff --git a/fxjs/cjs_util.h b/fxjs/cjs_util.h
index 611443c..f948afb 100644
--- a/fxjs/cjs_util.h
+++ b/fxjs/cjs_util.h
@@ -43,15 +43,15 @@
 
   static int ParseDataType(std::wstring* sFormat);
 
-  CJS_Return printd(CJS_Runtime* pRuntime,
+  CJS_Result printd(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return printf(CJS_Runtime* pRuntime,
+  CJS_Result printf(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return printx(CJS_Runtime* pRuntime,
+  CJS_Result printx(CJS_Runtime* pRuntime,
                     const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return scand(CJS_Runtime* pRuntime,
+  CJS_Result scand(CJS_Runtime* pRuntime,
                    const std::vector<v8::Local<v8::Value>>& params);
-  CJS_Return byteToChar(CJS_Runtime* pRuntime,
+  CJS_Result byteToChar(CJS_Runtime* pRuntime,
                         const std::vector<v8::Local<v8::Value>>& params);
 };
 
diff --git a/fxjs/fxjse.h b/fxjs/fxjse.h
index c28cc6c..2171c23 100644
--- a/fxjs/fxjse.h
+++ b/fxjs/fxjse.h
@@ -23,7 +23,7 @@
 class CFXJSE_Arguments;
 class CFXJSE_FormCalcContext;
 class CFXJSE_Value;
-class CJS_Return;
+class CJS_Result;
 class CXFA_Object;
 
 // C++ object which is retrieved from v8 object's slot.
@@ -39,7 +39,7 @@
   CFXJSE_HostObject();
 };
 
-typedef CJS_Return (*FXJSE_MethodCallback)(
+typedef CJS_Result (*FXJSE_MethodCallback)(
     const v8::FunctionCallbackInfo<v8::Value>& info,
     const WideString& functionName);
 typedef void (*FXJSE_FuncCallback)(CFXJSE_Value* pThis,
diff --git a/fxjs/js_define.h b/fxjs/js_define.h
index ae1557e..0d8c43f 100644
--- a/fxjs/js_define.h
+++ b/fxjs/js_define.h
@@ -13,7 +13,7 @@
 #include "core/fxcrt/unowned_ptr.h"
 #include "fxjs/cfxjs_engine.h"
 #include "fxjs/cjs_object.h"
-#include "fxjs/cjs_return.h"
+#include "fxjs/cjs_result.h"
 #include "fxjs/js_resources.h"
 #include "third_party/base/ptr_util.h"
 
@@ -70,7 +70,7 @@
   return UnownedPtr<C>(static_cast<C*>(pJSObj));
 }
 
-template <class C, CJS_Return (C::*M)(CJS_Runtime*)>
+template <class C, CJS_Result (C::*M)(CJS_Runtime*)>
 void JSPropGetter(const char* prop_name_string,
                   const char* class_name_string,
                   v8::Local<v8::String> property,
@@ -83,7 +83,7 @@
   if (!pRuntime)
     return;
 
-  CJS_Return result = (pObj.Get()->*M)(pRuntime);
+  CJS_Result result = (pObj.Get()->*M)(pRuntime);
   if (result.HasError()) {
     pRuntime->Error(JSFormatErrorString(class_name_string, prop_name_string,
                                         result.Error()));
@@ -94,7 +94,7 @@
     info.GetReturnValue().Set(result.Return());
 }
 
-template <class C, CJS_Return (C::*M)(CJS_Runtime*, v8::Local<v8::Value>)>
+template <class C, CJS_Result (C::*M)(CJS_Runtime*, v8::Local<v8::Value>)>
 void JSPropSetter(const char* prop_name_string,
                   const char* class_name_string,
                   v8::Local<v8::String> property,
@@ -108,7 +108,7 @@
   if (!pRuntime)
     return;
 
-  CJS_Return result = (pObj.Get()->*M)(pRuntime, value);
+  CJS_Result result = (pObj.Get()->*M)(pRuntime, value);
   if (result.HasError()) {
     pRuntime->Error(JSFormatErrorString(class_name_string, prop_name_string,
                                         result.Error()));
@@ -116,7 +116,7 @@
 }
 
 template <class C,
-          CJS_Return (C::*M)(CJS_Runtime*,
+          CJS_Result (C::*M)(CJS_Runtime*,
                              const std::vector<v8::Local<v8::Value>>&)>
 void JSMethod(const char* method_name_string,
               const char* class_name_string,
@@ -133,7 +133,7 @@
   for (unsigned int i = 0; i < (unsigned int)info.Length(); i++)
     parameters.push_back(info[i]);
 
-  CJS_Return result = (pObj.Get()->*M)(pRuntime, parameters);
+  CJS_Result result = (pObj.Get()->*M)(pRuntime, parameters);
   if (result.HasError()) {
     pRuntime->Error(JSFormatErrorString(class_name_string, method_name_string,
                                         result.Error()));
diff --git a/fxjs/jse_define.h b/fxjs/jse_define.h
index ddc9d59..373917f 100644
--- a/fxjs/jse_define.h
+++ b/fxjs/jse_define.h
@@ -10,25 +10,25 @@
 #include <vector>
 
 #include "fxjs/cfx_v8.h"
-#include "fxjs/cjs_return.h"
+#include "fxjs/cjs_result.h"
 
 template <class C,
-          CJS_Return (C::*M)(CFX_V8* runtime,
+          CJS_Result (C::*M)(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params)>
-CJS_Return JSMethod(C* node,
+CJS_Result JSMethod(C* node,
                     CFX_V8* runtime,
                     const std::vector<v8::Local<v8::Value>>& params) {
   return (node->*M)(runtime, params);
 }
 
 #define JSE_METHOD(method_name, class_name)                \
-  static CJS_Return method_name##_static(                  \
+  static CJS_Result method_name##_static(                  \
       CJX_Object* node, CFX_V8* runtime,                   \
       const std::vector<v8::Local<v8::Value>>& params) {   \
     return JSMethod<class_name, &class_name::method_name>( \
         static_cast<class_name*>(node), runtime, params);  \
   }                                                        \
-  CJS_Return method_name(CFX_V8* runtime,                  \
+  CJS_Result method_name(CFX_V8* runtime,                  \
                          const std::vector<v8::Local<v8::Value>>& params)
 
 #define JSE_PROP(prop_name) \
diff --git a/fxjs/xfa/cjx_container.cpp b/fxjs/xfa/cjx_container.cpp
index ddf5ba1..6b0d488 100644
--- a/fxjs/xfa/cjx_container.cpp
+++ b/fxjs/xfa/cjx_container.cpp
@@ -24,17 +24,17 @@
 
 CJX_Container::~CJX_Container() {}
 
-CJS_Return CJX_Container::getDelta(
+CJS_Result CJX_Container::getDelta(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Container::getDeltas(
+CJS_Result CJX_Container::getDeltas(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   auto* pEngine = static_cast<CFXJSE_Engine*>(runtime);
-  return CJS_Return::Success(pEngine->NewXFAObject(
+  return CJS_Result::Success(pEngine->NewXFAObject(
       new CXFA_ArrayNodeList(GetDocument()),
       GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate()));
 }
diff --git a/fxjs/xfa/cjx_datawindow.cpp b/fxjs/xfa/cjx_datawindow.cpp
index b03e241..dbd672a 100644
--- a/fxjs/xfa/cjx_datawindow.cpp
+++ b/fxjs/xfa/cjx_datawindow.cpp
@@ -24,28 +24,28 @@
 
 CJX_DataWindow::~CJX_DataWindow() {}
 
-CJS_Return CJX_DataWindow::moveCurrentRecord(
+CJS_Result CJX_DataWindow::moveCurrentRecord(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_DataWindow::record(
+CJS_Result CJX_DataWindow::record(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_DataWindow::gotoRecord(
+CJS_Result CJX_DataWindow::gotoRecord(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_DataWindow::isRecordGroup(
+CJS_Result CJX_DataWindow::isRecordGroup(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJX_DataWindow::recordsBefore(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_delta.cpp b/fxjs/xfa/cjx_delta.cpp
index 791fd21..edf17b9 100644
--- a/fxjs/xfa/cjx_delta.cpp
+++ b/fxjs/xfa/cjx_delta.cpp
@@ -20,12 +20,12 @@
 
 CJX_Delta::~CJX_Delta() {}
 
-CJS_Return CJX_Delta::restore(CFX_V8* runtime,
+CJS_Result CJX_Delta::restore(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJX_Delta::currentValue(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_desc.cpp b/fxjs/xfa/cjx_desc.cpp
index 03379ce..004fa44 100644
--- a/fxjs/xfa/cjx_desc.cpp
+++ b/fxjs/xfa/cjx_desc.cpp
@@ -20,12 +20,12 @@
 
 CJX_Desc::~CJX_Desc() {}
 
-CJS_Return CJX_Desc::metadata(CFX_V8* runtime,
+CJS_Result CJX_Desc::metadata(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 0 && params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewString(""));
+  return CJS_Result::Success(runtime->NewString(""));
 }
 
 void CJX_Desc::use(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_eventpseudomodel.cpp b/fxjs/xfa/cjx_eventpseudomodel.cpp
index 3adf1e3..b80f8f3 100644
--- a/fxjs/xfa/cjx_eventpseudomodel.cpp
+++ b/fxjs/xfa/cjx_eventpseudomodel.cpp
@@ -169,41 +169,41 @@
   Property(pValue, XFA_Event::Target, bSetting);
 }
 
-CJS_Return CJX_EventPseudoModel::emit(
+CJS_Result CJX_EventPseudoModel::emit(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
   if (!pScriptContext)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_EventParam* pEventParam = pScriptContext->GetEventParam();
   if (!pEventParam)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFWidgetHandler* pWidgetHandler = pNotify->GetWidgetHandler();
   if (!pWidgetHandler)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   pWidgetHandler->ProcessEvent(pEventParam->m_pTarget.Get(), pEventParam);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_EventPseudoModel::reset(
+CJS_Result CJX_EventPseudoModel::reset(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
   if (!pScriptContext)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_EventParam* pEventParam = pScriptContext->GetEventParam();
   if (pEventParam)
     pEventParam->Reset();
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJX_EventPseudoModel::Property(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_exclgroup.cpp b/fxjs/xfa/cjx_exclgroup.cpp
index 3a7f9dd..a5ddc94 100644
--- a/fxjs/xfa/cjx_exclgroup.cpp
+++ b/fxjs/xfa/cjx_exclgroup.cpp
@@ -30,67 +30,67 @@
 
 CJX_ExclGroup::~CJX_ExclGroup() {}
 
-CJS_Return CJX_ExclGroup::execEvent(
+CJS_Result CJX_ExclGroup::execEvent(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   execSingleEventByName(runtime->ToWideString(params[0]).AsStringView(),
                         XFA_Element::ExclGroup);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_ExclGroup::execInitialize(
+CJS_Result CJX_ExclGroup::execInitialize(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify)
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Initialize, false,
                                   true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_ExclGroup::execCalculate(
+CJS_Result CJX_ExclGroup::execCalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify)
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false,
                                   true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_ExclGroup::execValidate(
+CJS_Result CJX_ExclGroup::execValidate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* notify = GetDocument()->GetNotify();
   if (!notify)
-    return CJS_Return::Success(runtime->NewBoolean(false));
+    return CJS_Result::Success(runtime->NewBoolean(false));
 
   int32_t iRet = notify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate,
                                               false, true);
-  return CJS_Return::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
+  return CJS_Result::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
 }
 
-CJS_Return CJX_ExclGroup::selectedMember(
+CJS_Result CJX_ExclGroup::selectedMember(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   CXFA_Node* pReturnNode = nullptr;
   if (params.empty()) {
@@ -100,14 +100,14 @@
         runtime->ToWideString(params[0]).AsStringView(), true);
   }
   if (!pReturnNode)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pReturnNode);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp
index c1210b9..bb84588 100644
--- a/fxjs/xfa/cjx_field.cpp
+++ b/fxjs/xfa/cjx_field.cpp
@@ -38,175 +38,175 @@
 
 CJX_Field::~CJX_Field() {}
 
-CJS_Return CJX_Field::clearItems(
+CJS_Result CJX_Field::clearItems(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Node* node = GetXFANode();
   if (node->IsWidgetReady())
     node->DeleteItem(-1, true, false);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Field::execEvent(
+CJS_Result CJX_Field::execEvent(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString eventString = runtime->ToWideString(params[0]);
   int32_t iRet =
       execSingleEventByName(eventString.AsStringView(), XFA_Element::Field);
   if (eventString != L"validate")
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
-  return CJS_Return::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
+  return CJS_Result::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
 }
 
-CJS_Return CJX_Field::execInitialize(
+CJS_Result CJX_Field::execInitialize(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify) {
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Initialize, false,
                                   false);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Field::deleteItem(
+CJS_Result CJX_Field::deleteItem(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   bool bValue = node->DeleteItem(runtime->ToInt32(params[0]), true, true);
-  return CJS_Return::Success(runtime->NewBoolean(bValue));
+  return CJS_Result::Success(runtime->NewBoolean(bValue));
 }
 
-CJS_Return CJX_Field::getSaveItem(
+CJS_Result CJX_Field::getSaveItem(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t iIndex = runtime->ToInt32(params[0]);
   if (iIndex < 0)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   Optional<WideString> value = node->GetChoiceListItem(iIndex, true);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewString(value->UTF8Encode().AsStringView()));
 }
 
-CJS_Return CJX_Field::boundItem(
+CJS_Result CJX_Field::boundItem(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString value = runtime->ToWideString(params[0]);
   WideString boundValue = node->GetItemValue(value.AsStringView());
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewString(boundValue.UTF8Encode().AsStringView()));
 }
 
-CJS_Return CJX_Field::getItemState(
+CJS_Result CJX_Field::getItemState(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   int32_t state = node->GetItemState(runtime->ToInt32(params[0]));
-  return CJS_Return::Success(runtime->NewBoolean(state != 0));
+  return CJS_Result::Success(runtime->NewBoolean(state != 0));
 }
 
-CJS_Return CJX_Field::execCalculate(
+CJS_Result CJX_Field::execCalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify) {
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false,
                                   false);
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Field::getDisplayItem(
+CJS_Result CJX_Field::getDisplayItem(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t iIndex = runtime->ToInt32(params[0]);
   if (iIndex < 0)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   Optional<WideString> value = node->GetChoiceListItem(iIndex, false);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewString(value->UTF8Encode().AsStringView()));
 }
 
-CJS_Return CJX_Field::setItemState(
+CJS_Result CJX_Field::setItemState(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   int32_t iIndex = runtime->ToInt32(params[0]);
   if (runtime->ToInt32(params[1]) != 0) {
     node->SetItemState(iIndex, true, true, true, true);
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
   if (node->GetItemState(iIndex))
     node->SetItemState(iIndex, false, true, true, true);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Field::addItem(CFX_V8* runtime,
+CJS_Result CJX_Field::addItem(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1 && params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* node = GetXFANode();
   if (!node->IsWidgetReady())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString label;
   if (params.size() >= 1)
@@ -217,22 +217,22 @@
     value = runtime->ToWideString(params[1]);
 
   node->InsertItem(label, value, true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Field::execValidate(
+CJS_Result CJX_Field::execValidate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success(runtime->NewBoolean(false));
+    return CJS_Result::Success(runtime->NewBoolean(false));
 
   int32_t iRet = pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate,
                                                false, false);
-  return CJS_Return::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
+  return CJS_Result::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
 }
 
 void CJX_Field::defaultValue(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_form.cpp b/fxjs/xfa/cjx_form.cpp
index 3bbdb72..a59edd0 100644
--- a/fxjs/xfa/cjx_form.cpp
+++ b/fxjs/xfa/cjx_form.cpp
@@ -31,16 +31,16 @@
 
 CJX_Form::~CJX_Form() {}
 
-CJS_Return CJX_Form::formNodes(
+CJS_Result CJX_Form::formNodes(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* pDataNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pDataNode)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   std::vector<CXFA_Node*> formItems;
   CXFA_ArrayNodeList* pFormNodes = new CXFA_ArrayNodeList(GetDocument());
@@ -49,79 +49,79 @@
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pFormNodes);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
-  return CJS_Return::Success(
+    return CJS_Result::Success(runtime->NewNull());
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_Form::remerge(CFX_V8* runtime,
+CJS_Result CJX_Form::remerge(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   GetDocument()->DoDataRemerge(true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Form::execInitialize(
+CJS_Result CJX_Form::execInitialize(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify)
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Initialize, false,
                                   true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Form::recalculate(
+CJS_Result CJX_Form::recalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_EventParam* pEventParam =
       GetDocument()->GetScriptContext()->GetEventParam();
   if (pEventParam->m_eType == XFA_EVENT_Calculate ||
       pEventParam->m_eType == XFA_EVENT_InitCalculate) {
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify || runtime->ToInt32(params[0]) != 0)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false, true);
   pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate, false, true);
   pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Ready, true, true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Form::execCalculate(
+CJS_Result CJX_Form::execCalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify)
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false,
                                   true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Form::execValidate(
+CJS_Result CJX_Form::execValidate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 0)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success(runtime->NewBoolean(false));
+    return CJS_Result::Success(runtime->NewBoolean(false));
 
   int32_t iRet = pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate,
                                                false, true);
-  return CJS_Return::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
+  return CJS_Result::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
 }
diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp
index 8cf82b3..748641a 100644
--- a/fxjs/xfa/cjx_hostpseudomodel.cpp
+++ b/fxjs/xfa/cjx_hostpseudomodel.cpp
@@ -239,37 +239,37 @@
       pNotify->GetAppProvider()->GetAppName().UTF8Encode().AsStringView());
 }
 
-CJS_Return CJX_HostPseudoModel::gotoURL(
+CJS_Result CJX_HostPseudoModel::gotoURL(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!GetDocument()->GetScriptContext()->IsRunAtClient())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFDoc* hDoc = pNotify->GetHDOC();
   WideString URL = runtime->ToWideString(params[0]);
   hDoc->GetDocEnvironment()->GotoURL(hDoc, URL);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::openList(
+CJS_Result CJX_HostPseudoModel::openList(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!GetDocument()->GetScriptContext()->IsRunAtClient())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_Node* pNode = nullptr;
   if (params[0]->IsObject()) {
@@ -278,11 +278,11 @@
   } else if (params[0]->IsString()) {
     CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
     if (!pScriptContext)
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     CXFA_Object* pObject = pScriptContext->GetThisObject();
     if (!pObject)
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
                       XFA_RESOLVENODE_Siblings;
@@ -291,35 +291,35 @@
         pObject, runtime->ToWideString(params[0]).AsStringView(),
         &resolveNodeRS, dwFlag, nullptr);
     if (!iRet || !resolveNodeRS.objects.front()->IsNode())
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     pNode = resolveNodeRS.objects.front()->AsNode();
   }
 
   CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetLayoutProcessor();
   if (!pDocLayout)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFWidget* hWidget =
       XFA_GetWidgetFromLayoutItem(pDocLayout->GetLayoutItem(pNode));
   if (!hWidget)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFDoc* hDoc = pNotify->GetHDOC();
   hDoc->GetDocEnvironment()->SetFocusWidget(hDoc, hWidget);
   pNotify->OpenDropDownList(hWidget);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::response(
+CJS_Result CJX_HostPseudoModel::response(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 4)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString question;
   if (params.size() >= 1)
@@ -339,25 +339,25 @@
 
   WideString answer =
       pNotify->GetAppProvider()->Response(question, title, defaultAnswer, mark);
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewString(answer.UTF8Encode().AsStringView()));
 }
 
-CJS_Return CJX_HostPseudoModel::documentInBatch(
+CJS_Result CJX_HostPseudoModel::documentInBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_HostPseudoModel::resetData(
+CJS_Result CJX_HostPseudoModel::resetData(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() > 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString expression;
   if (params.size() >= 1)
@@ -365,7 +365,7 @@
 
   if (expression.IsEmpty()) {
     pNotify->ResetData(nullptr);
-    return CJS_Return::Success();
+    return CJS_Result::Success();
   }
 
   int32_t iStart = 0;
@@ -376,11 +376,11 @@
     iStart = FilterName(expression.AsStringView(), iStart, wsName);
     CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
     if (!pScriptContext)
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     CXFA_Object* pObject = pScriptContext->GetThisObject();
     if (!pObject)
-      return CJS_Return::Success();
+      return CJS_Result::Success();
 
     uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
                       XFA_RESOLVENODE_Siblings;
@@ -396,42 +396,42 @@
   if (!pNode)
     pNotify->ResetData(nullptr);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::beep(
+CJS_Result CJX_HostPseudoModel::beep(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!GetDocument()->GetScriptContext()->IsRunAtClient())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (params.size() > 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   uint32_t dwType = 4;
   if (params.size() >= 1)
     dwType = runtime->ToInt32(params[0]);
 
   pNotify->GetAppProvider()->Beep(dwType);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::setFocus(
+CJS_Result CJX_HostPseudoModel::setFocus(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!GetDocument()->GetScriptContext()->IsRunAtClient())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_Node* pNode = nullptr;
   if (params.size() >= 1) {
@@ -441,11 +441,11 @@
     } else if (params[0]->IsString()) {
       CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
       if (!pScriptContext)
-        return CJS_Return::Success();
+        return CJS_Result::Success();
 
       CXFA_Object* pObject = pScriptContext->GetThisObject();
       if (!pObject)
-        return CJS_Return::Success();
+        return CJS_Result::Success();
 
       uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent |
                         XFA_RESOLVENODE_Siblings;
@@ -454,47 +454,47 @@
           pObject, runtime->ToWideString(params[0]).AsStringView(),
           &resolveNodeRS, dwFlag, nullptr);
       if (!iRet || !resolveNodeRS.objects.front()->IsNode())
-        return CJS_Return::Success();
+        return CJS_Result::Success();
 
       pNode = resolveNodeRS.objects.front()->AsNode();
     }
   }
   pNotify->SetFocusWidgetNode(pNode);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::getFocus(
+CJS_Result CJX_HostPseudoModel::getFocus(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_Node* pNode = pNotify->GetFocusWidgetNode();
   if (!pNode)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pNode);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_HostPseudoModel::messageBox(
+CJS_Result CJX_HostPseudoModel::messageBox(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!GetDocument()->GetScriptContext()->IsRunAtClient())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (params.empty() || params.size() > 4)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString message;
   if (params.size() >= 1)
@@ -520,27 +520,27 @@
 
   int32_t iValue = pNotify->GetAppProvider()->MsgBox(message, title,
                                                      messageType, buttonType);
-  return CJS_Return::Success(runtime->NewNumber(iValue));
+  return CJS_Result::Success(runtime->NewNumber(iValue));
 }
 
-CJS_Return CJX_HostPseudoModel::documentCountInBatch(
+CJS_Result CJX_HostPseudoModel::documentCountInBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_HostPseudoModel::print(
+CJS_Result CJX_HostPseudoModel::print(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!GetDocument()->GetScriptContext()->IsRunAtClient())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (params.size() != 8)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   uint32_t dwOptions = 0;
   if (runtime->ToBoolean(params[0]))
@@ -561,27 +561,27 @@
 
   CXFA_FFDoc* hDoc = pNotify->GetHDOC();
   hDoc->GetDocEnvironment()->Print(hDoc, nStartPage, nEndPage, dwOptions);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::importData(
+CJS_Result CJX_HostPseudoModel::importData(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::exportData(
+CJS_Result CJX_HostPseudoModel::exportData(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString filePath;
   if (params.size() >= 1)
@@ -593,39 +593,39 @@
 
   CXFA_FFDoc* hDoc = pNotify->GetHDOC();
   hDoc->GetDocEnvironment()->ExportData(hDoc, filePath, XDP);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::pageUp(
+CJS_Result CJX_HostPseudoModel::pageUp(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFDoc* hDoc = pNotify->GetHDOC();
   int32_t nCurPage = hDoc->GetDocEnvironment()->GetCurrentPage(hDoc);
   int32_t nNewPage = 0;
   if (nCurPage <= 1)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   nNewPage = nCurPage - 1;
   hDoc->GetDocEnvironment()->SetCurrentPage(hDoc, nNewPage);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_HostPseudoModel::pageDown(
+CJS_Result CJX_HostPseudoModel::pageDown(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_FFDoc* hDoc = pNotify->GetHDOC();
   int32_t nCurPage = hDoc->GetDocEnvironment()->GetCurrentPage(hDoc);
   int32_t nPageCount = hDoc->GetDocEnvironment()->CountPages(hDoc);
   if (!nPageCount || nCurPage == nPageCount)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   int32_t nNewPage = 0;
   if (nCurPage >= nPageCount)
@@ -634,5 +634,5 @@
     nNewPage = nCurPage + 1;
 
   hDoc->GetDocEnvironment()->SetCurrentPage(hDoc, nNewPage);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
diff --git a/fxjs/xfa/cjx_instancemanager.cpp b/fxjs/xfa/cjx_instancemanager.cpp
index ce00af1..b36fddc 100644
--- a/fxjs/xfa/cjx_instancemanager.cpp
+++ b/fxjs/xfa/cjx_instancemanager.cpp
@@ -133,15 +133,15 @@
   return 0;
 }
 
-CJS_Return CJX_InstanceManager::moveInstance(
+CJS_Result CJX_InstanceManager::moveInstance(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument();
   if (doc->GetFormType() != FormType::kXFAFull)
-    return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kNotSupportedError);
 
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t iFrom = runtime->ToInt32(params[0]);
   int32_t iTo = runtime->ToInt32(params[1]);
@@ -149,7 +149,7 @@
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_Node* pToInstance = GetXFANode()->GetItemIfExists(iTo);
   if (pToInstance && pToInstance->GetElementType() == XFA_Element::Subform)
@@ -161,32 +161,32 @@
     pNotify->RunSubformIndexChange(pFromInstance);
   }
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_InstanceManager::removeInstance(
+CJS_Result CJX_InstanceManager::removeInstance(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument();
   if (doc->GetFormType() != FormType::kXFAFull)
-    return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kNotSupportedError);
 
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t iIndex = runtime->ToInt32(params[0]);
   int32_t iCount = GetXFANode()->GetCount();
   if (iIndex < 0 || iIndex >= iCount)
-    return CJS_Return::Failure(JSMessage::kInvalidInputError);
+    return CJS_Result::Failure(JSMessage::kInvalidInputError);
 
   CXFA_Occur* occur = GetXFANode()->GetOccurIfExists();
   int32_t iMin = occur ? occur->GetMin() : CXFA_Occur::kDefaultMin;
   if (iCount - 1 < iMin)
-    return CJS_Return::Failure(JSMessage::kTooManyOccurances);
+    return CJS_Result::Failure(JSMessage::kTooManyOccurances);
 
   CXFA_Node* pRemoveInstance = GetXFANode()->GetItemIfExists(iIndex);
   if (!pRemoveInstance)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   GetXFANode()->RemoveItem(pRemoveInstance, true);
 
@@ -205,32 +205,32 @@
     pLayoutPro->AddChangedContainer(
         ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form)));
   }
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_InstanceManager::setInstances(
+CJS_Result CJX_InstanceManager::setInstances(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument();
   if (doc->GetFormType() != FormType::kXFAFull)
-    return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kNotSupportedError);
 
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   SetInstances(runtime->ToInt32(params[0]));
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_InstanceManager::addInstance(
+CJS_Result CJX_InstanceManager::addInstance(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument();
   if (doc->GetFormType() != FormType::kXFAFull)
-    return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kNotSupportedError);
 
   if (!params.empty() && params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   bool fFlags = true;
   if (params.size() == 1)
@@ -240,11 +240,11 @@
   CXFA_Occur* occur = GetXFANode()->GetOccurIfExists();
   int32_t iMax = occur ? occur->GetMax() : CXFA_Occur::kDefaultMax;
   if (iMax >= 0 && iCount >= iMax)
-    return CJS_Return::Failure(JSMessage::kTooManyOccurances);
+    return CJS_Result::Failure(JSMessage::kTooManyOccurances);
 
   CXFA_Node* pNewInstance = GetXFANode()->CreateInstanceIfPossible(fFlags);
   if (!pNewInstance)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   GetXFANode()->InsertItem(pNewInstance, iCount, iCount, false);
 
@@ -262,21 +262,21 @@
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pNewInstance);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_InstanceManager::insertInstance(
+CJS_Result CJX_InstanceManager::insertInstance(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Document* doc = static_cast<CFXJSE_Engine*>(runtime)->GetDocument();
   if (doc->GetFormType() != FormType::kXFAFull)
-    return CJS_Return::Failure(JSMessage::kNotSupportedError);
+    return CJS_Result::Failure(JSMessage::kNotSupportedError);
 
   if (params.size() != 1 && params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t iIndex = runtime->ToInt32(params[0]);
   bool bBind = false;
@@ -285,16 +285,16 @@
 
   int32_t iCount = GetXFANode()->GetCount();
   if (iIndex < 0 || iIndex > iCount)
-    return CJS_Return::Failure(JSMessage::kInvalidInputError);
+    return CJS_Result::Failure(JSMessage::kInvalidInputError);
 
   CXFA_Occur* occur = GetXFANode()->GetOccurIfExists();
   int32_t iMax = occur ? occur->GetMax() : CXFA_Occur::kDefaultMax;
   if (iMax >= 0 && iCount >= iMax)
-    return CJS_Return::Failure(JSMessage::kInvalidInputError);
+    return CJS_Result::Failure(JSMessage::kInvalidInputError);
 
   CXFA_Node* pNewInstance = GetXFANode()->CreateInstanceIfPossible(bBind);
   if (!pNewInstance)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   GetXFANode()->InsertItem(pNewInstance, iIndex, iCount, true);
 
@@ -311,9 +311,9 @@
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pNewInstance);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.cpp b/fxjs/xfa/cjx_layoutpseudomodel.cpp
index aa73135..6985c50 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.cpp
+++ b/fxjs/xfa/cjx_layoutpseudomodel.cpp
@@ -69,17 +69,17 @@
   pValue->SetBoolean(iStatus >= 2);
 }
 
-CJS_Return CJX_LayoutPseudoModel::HWXY(
+CJS_Result CJX_LayoutPseudoModel::HWXY(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params,
     XFA_LAYOUTMODEL_HWXY layoutModel) {
   if (params.empty() || params.size() > 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* pNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pNode)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   WideString unit(L"pt");
   if (params.size() >= 2) {
@@ -90,12 +90,12 @@
   int32_t iIndex = params.size() >= 3 ? runtime->ToInt32(params[2]) : 0;
   CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetLayoutProcessor();
   if (!pDocLayout)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_ContentLayoutItem* pLayoutItem =
       ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode));
   if (!pLayoutItem)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   while (iIndex > 0 && pLayoutItem) {
     pLayoutItem = pLayoutItem->GetNext();
@@ -103,7 +103,7 @@
   }
 
   if (!pLayoutItem)
-    return CJS_Return::Success(runtime->NewNumber(0.0));
+    return CJS_Result::Success(runtime->NewNumber(0.0));
 
   CXFA_Measurement measure;
   CFX_RectF rtRect = pLayoutItem->GetRect(true);
@@ -124,39 +124,39 @@
 
   float fValue =
       measure.ToUnit(CXFA_Measurement::GetUnitFromString(unit.AsStringView()));
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewNumber(FXSYS_round(fValue * 1000) / 1000.0f));
 }
 
-CJS_Return CJX_LayoutPseudoModel::h(
+CJS_Result CJX_LayoutPseudoModel::h(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return HWXY(runtime, params, XFA_LAYOUTMODEL_H);
 }
 
-CJS_Return CJX_LayoutPseudoModel::w(
+CJS_Result CJX_LayoutPseudoModel::w(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return HWXY(runtime, params, XFA_LAYOUTMODEL_W);
 }
 
-CJS_Return CJX_LayoutPseudoModel::x(
+CJS_Result CJX_LayoutPseudoModel::x(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return HWXY(runtime, params, XFA_LAYOUTMODEL_X);
 }
 
-CJS_Return CJX_LayoutPseudoModel::y(
+CJS_Result CJX_LayoutPseudoModel::y(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return HWXY(runtime, params, XFA_LAYOUTMODEL_Y);
 }
 
-CJS_Return CJX_LayoutPseudoModel::NumberedPageCount(CFX_V8* runtime,
+CJS_Result CJX_LayoutPseudoModel::NumberedPageCount(CFX_V8* runtime,
                                                     bool bNumbered) {
   CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetLayoutProcessor();
   if (!pDocLayout)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   int32_t iPageCount = 0;
   int32_t iPageNum = pDocLayout->CountPages();
@@ -173,42 +173,42 @@
   } else {
     iPageCount = iPageNum;
   }
-  return CJS_Return::Success(runtime->NewNumber(iPageCount));
+  return CJS_Result::Success(runtime->NewNumber(iPageCount));
 }
 
-CJS_Return CJX_LayoutPseudoModel::pageCount(
+CJS_Result CJX_LayoutPseudoModel::pageCount(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return NumberedPageCount(runtime, true);
 }
 
-CJS_Return CJX_LayoutPseudoModel::pageSpan(
+CJS_Result CJX_LayoutPseudoModel::pageSpan(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* pNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pNode)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetLayoutProcessor();
   if (!pDocLayout)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_ContentLayoutItem* pLayoutItem =
       ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode));
   if (!pLayoutItem)
-    return CJS_Return::Success(runtime->NewNumber(-1));
+    return CJS_Result::Success(runtime->NewNumber(-1));
 
   int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex();
   int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
   int32_t iPageSpan = iLast - iFirst + 1;
-  return CJS_Return::Success(runtime->NewNumber(iPageSpan));
+  return CJS_Result::Success(runtime->NewNumber(iPageSpan));
 }
 
-CJS_Return CJX_LayoutPseudoModel::page(
+CJS_Result CJX_LayoutPseudoModel::page(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return PageInternals(runtime, params, false);
@@ -345,11 +345,11 @@
   return retArray;
 }
 
-CJS_Return CJX_LayoutPseudoModel::pageContent(
+CJS_Result CJX_LayoutPseudoModel::pageContent(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t iIndex = 0;
   if (params.size() >= 1)
@@ -365,41 +365,41 @@
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetLayoutProcessor();
   if (!pDocLayout)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   auto pArrayNodeList = pdfium::MakeUnique<CXFA_ArrayNodeList>(GetDocument());
   pArrayNodeList->SetArrayNodeList(
       GetObjArray(pDocLayout, iIndex, wsType, bOnPageArea));
 
   // TODO(dsinclair): Who owns the array once we release it? Won't this leak?
-  return CJS_Return::Success(static_cast<CFXJSE_Engine*>(runtime)->NewXFAObject(
+  return CJS_Result::Success(static_cast<CFXJSE_Engine*>(runtime)->NewXFAObject(
       pArrayNodeList.release(),
       GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate()));
 }
 
-CJS_Return CJX_LayoutPseudoModel::absPageCount(
+CJS_Result CJX_LayoutPseudoModel::absPageCount(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return NumberedPageCount(runtime, false);
 }
 
-CJS_Return CJX_LayoutPseudoModel::absPageCountInBatch(
+CJS_Result CJX_LayoutPseudoModel::absPageCountInBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_LayoutPseudoModel::sheetCountInBatch(
+CJS_Result CJX_LayoutPseudoModel::sheetCountInBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_LayoutPseudoModel::relayout(
+CJS_Result CJX_LayoutPseudoModel::relayout(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   CXFA_Node* pRootNode = GetDocument()->GetRoot();
@@ -411,78 +411,78 @@
     pLayoutProcessor->AddChangedContainer(pContentRootNode);
 
   pLayoutProcessor->SetForceReLayout(true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_LayoutPseudoModel::absPageSpan(
+CJS_Result CJX_LayoutPseudoModel::absPageSpan(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return pageSpan(runtime, params);
 }
 
-CJS_Return CJX_LayoutPseudoModel::absPageInBatch(
+CJS_Result CJX_LayoutPseudoModel::absPageInBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_LayoutPseudoModel::sheetInBatch(
+CJS_Result CJX_LayoutPseudoModel::sheetInBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_LayoutPseudoModel::sheet(
+CJS_Result CJX_LayoutPseudoModel::sheet(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return PageInternals(runtime, params, true);
 }
 
-CJS_Return CJX_LayoutPseudoModel::relayoutPageArea(
+CJS_Result CJX_LayoutPseudoModel::relayoutPageArea(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_LayoutPseudoModel::sheetCount(
+CJS_Result CJX_LayoutPseudoModel::sheetCount(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return NumberedPageCount(runtime, false);
 }
 
-CJS_Return CJX_LayoutPseudoModel::absPage(
+CJS_Result CJX_LayoutPseudoModel::absPage(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   return PageInternals(runtime, params, true);
 }
 
-CJS_Return CJX_LayoutPseudoModel::PageInternals(
+CJS_Result CJX_LayoutPseudoModel::PageInternals(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params,
     bool bAbsPage) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* pNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pNode)
-    return CJS_Return::Success(runtime->NewNumber(0));
+    return CJS_Result::Success(runtime->NewNumber(0));
 
   CXFA_LayoutProcessor* pDocLayout = GetDocument()->GetLayoutProcessor();
   if (!pDocLayout)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_ContentLayoutItem* pLayoutItem =
       ToContentLayoutItem(pDocLayout->GetLayoutItem(pNode));
   if (!pLayoutItem)
-    return CJS_Return::Success(runtime->NewNumber(-1));
+    return CJS_Result::Success(runtime->NewNumber(-1));
 
   int32_t iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
-  return CJS_Return::Success(runtime->NewNumber(bAbsPage ? iPage : iPage + 1));
+  return CJS_Result::Success(runtime->NewNumber(bAbsPage ? iPage : iPage + 1));
 }
diff --git a/fxjs/xfa/cjx_layoutpseudomodel.h b/fxjs/xfa/cjx_layoutpseudomodel.h
index 3d14b85..3fd77ef 100644
--- a/fxjs/xfa/cjx_layoutpseudomodel.h
+++ b/fxjs/xfa/cjx_layoutpseudomodel.h
@@ -52,15 +52,15 @@
   JSE_PROP(ready);
 
  private:
-  CJS_Return NumberedPageCount(CFX_V8* runtime, bool bNumbered);
-  CJS_Return HWXY(CFX_V8* runtime,
+  CJS_Result NumberedPageCount(CFX_V8* runtime, bool bNumbered);
+  CJS_Result HWXY(CFX_V8* runtime,
                   const std::vector<v8::Local<v8::Value>>& params,
                   XFA_LAYOUTMODEL_HWXY layoutModel);
   std::vector<CXFA_Node*> GetObjArray(CXFA_LayoutProcessor* pDocLayout,
                                       int32_t iPageNo,
                                       const WideString& wsType,
                                       bool bOnPageArea);
-  CJS_Return PageInternals(CFX_V8* runtime,
+  CJS_Result PageInternals(CFX_V8* runtime,
                            const std::vector<v8::Local<v8::Value>>& params,
                            bool bAbsPage);
 
diff --git a/fxjs/xfa/cjx_list.cpp b/fxjs/xfa/cjx_list.cpp
index 89f483b..e86e1fa 100644
--- a/fxjs/xfa/cjx_list.cpp
+++ b/fxjs/xfa/cjx_list.cpp
@@ -31,61 +31,61 @@
   return ToList(GetXFAObject());
 }
 
-CJS_Return CJX_List::append(CFX_V8* runtime,
+CJS_Result CJX_List::append(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   auto* pNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pNode)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   GetXFAList()->Append(pNode);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_List::insert(CFX_V8* runtime,
+CJS_Result CJX_List::insert(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   auto* pNewNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pNewNode)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   auto* pBeforeNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[1]));
   GetXFAList()->Insert(pNewNode, pBeforeNode);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_List::remove(CFX_V8* runtime,
+CJS_Result CJX_List::remove(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   auto* pNode =
       ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
   if (!pNode)
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   GetXFAList()->Remove(pNode);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_List::item(CFX_V8* runtime,
+CJS_Result CJX_List::item(CFX_V8* runtime,
                           const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   int32_t index = runtime->ToInt32(params[0]);
   size_t cast_index = static_cast<size_t>(index);
   if (index < 0 || cast_index >= GetXFAList()->GetLength())
-    return CJS_Return::Failure(JSMessage::kInvalidInputError);
+    return CJS_Result::Failure(JSMessage::kInvalidInputError);
 
-  return CJS_Return::Success(static_cast<CFXJSE_Engine*>(runtime)->NewXFAObject(
+  return CJS_Result::Success(static_cast<CFXJSE_Engine*>(runtime)->NewXFAObject(
       GetXFAList()->Item(cast_index),
       GetDocument()->GetScriptContext()->GetJseNormalClass()->GetTemplate()));
 }
diff --git a/fxjs/xfa/cjx_logpseudomodel.cpp b/fxjs/xfa/cjx_logpseudomodel.cpp
index 49f3350..27d37ad 100644
--- a/fxjs/xfa/cjx_logpseudomodel.cpp
+++ b/fxjs/xfa/cjx_logpseudomodel.cpp
@@ -25,7 +25,7 @@
 
 CJX_LogPseudoModel::~CJX_LogPseudoModel() {}
 
-CJS_Return CJX_LogPseudoModel::message(
+CJS_Result CJX_LogPseudoModel::message(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // Uncomment to allow using xfa.log.message(""); from JS.
@@ -35,29 +35,29 @@
   //   fprintf(stderr, "  %ls\n", WideString::FromUTF8(*str).c_str());
   // }
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_LogPseudoModel::traceEnabled(
+CJS_Result CJX_LogPseudoModel::traceEnabled(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_LogPseudoModel::traceActivate(
+CJS_Result CJX_LogPseudoModel::traceActivate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_LogPseudoModel::traceDeactivate(
+CJS_Result CJX_LogPseudoModel::traceDeactivate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_LogPseudoModel::trace(
+CJS_Result CJX_LogPseudoModel::trace(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
diff --git a/fxjs/xfa/cjx_manifest.cpp b/fxjs/xfa/cjx_manifest.cpp
index 1ca86cc..b53c7ed 100644
--- a/fxjs/xfa/cjx_manifest.cpp
+++ b/fxjs/xfa/cjx_manifest.cpp
@@ -21,13 +21,13 @@
 
 CJX_Manifest::~CJX_Manifest() {}
 
-CJS_Return CJX_Manifest::evaluate(
+CJS_Result CJX_Manifest::evaluate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewBoolean(GetXFANode()->IsWidgetReady()));
 }
 
diff --git a/fxjs/xfa/cjx_model.cpp b/fxjs/xfa/cjx_model.cpp
index 97d2517..61004e2 100644
--- a/fxjs/xfa/cjx_model.cpp
+++ b/fxjs/xfa/cjx_model.cpp
@@ -25,17 +25,17 @@
 
 CJX_Model::~CJX_Model() {}
 
-CJS_Return CJX_Model::clearErrorList(
+CJS_Result CJX_Model::clearErrorList(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Model::createNode(
+CJS_Result CJX_Model::createNode(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString name;
   if (params.size() > 1)
@@ -49,11 +49,11 @@
   XFA_Element eType = CXFA_Node::NameToElement(tagName);
   CXFA_Node* pNewNode = GetXFANode()->CreateSamePacketNode(eType);
   if (!pNewNode)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   if (!name.IsEmpty()) {
     if (!pNewNode->HasAttribute(XFA_Attribute::Name))
-      return CJS_Return::Failure(JSMessage::kParamError);
+      return CJS_Result::Failure(JSMessage::kParamError);
 
     pNewNode->JSObject()->SetAttribute(XFA_Attribute::Name, name.AsStringView(),
                                        true);
@@ -64,23 +64,23 @@
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pNewNode);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_Model::isCompatibleNS(
+CJS_Result CJX_Model::isCompatibleNS(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString nameSpace;
   if (params.size() >= 1)
     nameSpace = runtime->ToWideString(params[0]);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewBoolean(TryNamespace().value_or(WideString()) == nameSpace));
 }
 
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index 9a85d94..fed9409 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -107,83 +107,83 @@
   return ToNode(GetXFAObject());
 }
 
-CJS_Return CJX_Node::applyXSL(CFX_V8* runtime,
+CJS_Result CJX_Node::applyXSL(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   // TODO(weili): check whether we need to implement this, pdfium:501.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Node::assignNode(
+CJS_Result CJX_Node::assignNode(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   // TODO(weili): check whether we need to implement this, pdfium:501.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Node::clone(CFX_V8* runtime,
+CJS_Result CJX_Node::clone(CFX_V8* runtime,
                            const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* pCloneNode = GetXFANode()->Clone(runtime->ToBoolean(params[0]));
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pCloneNode);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_Node::getAttribute(
+CJS_Result CJX_Node::getAttribute(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString expression = runtime->ToWideString(params[0]);
-  return CJS_Return::Success(runtime->NewString(
+  return CJS_Result::Success(runtime->NewString(
       GetAttribute(expression.AsStringView()).UTF8Encode().AsStringView()));
 }
 
-CJS_Return CJX_Node::getElement(
+CJS_Result CJX_Node::getElement(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString expression = runtime->ToWideString(params[0]);
   int32_t iValue = params.size() >= 2 ? runtime->ToInt32(params[1]) : 0;
   CXFA_Node* pNode = GetOrCreateProperty<CXFA_Node>(
       iValue, CXFA_Node::NameToElement(expression));
   if (!pNode)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pNode);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_Node::isPropertySpecified(
+CJS_Result CJX_Node::isPropertySpecified(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString expression = runtime->ToWideString(params[0]);
   XFA_Attribute attr = CXFA_Node::NameToAttribute(expression.AsStringView());
   if (attr != XFA_Attribute::Unknown && HasAttribute(attr))
-    return CJS_Return::Success(runtime->NewBoolean(true));
+    return CJS_Result::Success(runtime->NewBoolean(true));
 
   bool bParent = params.size() < 2 || runtime->ToBoolean(params[1]);
   int32_t iIndex = params.size() == 3 ? runtime->ToInt32(params[2]) : 0;
@@ -195,17 +195,17 @@
     bHas = jsnode->HasAttribute(attr) ||
            !!jsnode->GetOrCreateProperty<CXFA_Node>(iIndex, eType);
   }
-  return CJS_Return::Success(runtime->NewBoolean(bHas));
+  return CJS_Result::Success(runtime->NewBoolean(bHas));
 }
 
-CJS_Return CJX_Node::loadXML(CFX_V8* runtime,
+CJS_Result CJX_Node::loadXML(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 3)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   ByteString expression = runtime->ToByteString(params[0]);
   if (expression.IsEmpty())
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   bool bIgnoreRoot = true;
   if (params.size() >= 2)
@@ -218,7 +218,7 @@
   auto pParser = pdfium::MakeUnique<CXFA_DocumentParser>(GetDocument());
   CFX_XMLNode* pXMLNode = pParser->ParseXMLData(expression);
   if (!pXMLNode)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (bIgnoreRoot &&
       (pXMLNode->GetType() != FX_XMLNODE_Element ||
@@ -274,7 +274,7 @@
   pParser->ConstructXFANode(pFakeRoot, pFakeXMLRoot);
   pFakeRoot = pParser->GetRootNode();
   if (!pFakeRoot)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   if (bOverwrite) {
     CXFA_Node* pChild = GetXFANode()->GetFirstChild();
@@ -322,37 +322,37 @@
   }
   pFakeRoot->SetFlag(XFA_NodeFlag_HasRemovedChildren);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Node::saveFilteredXML(
+CJS_Result CJX_Node::saveFilteredXML(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   // TODO(weili): Check whether we need to implement this, pdfium:501.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Node::saveXML(CFX_V8* runtime,
+CJS_Result CJX_Node::saveXML(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() > 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   if (params.size() == 1 && runtime->ToWideString(params[0]) != L"pretty")
-    return CJS_Return::Failure(JSMessage::kValueError);
+    return CJS_Result::Failure(JSMessage::kValueError);
 
   // TODO(weili): Check whether we need to save pretty print XML, pdfium:501.
 
   ByteString bsXMLHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
   if (GetXFANode()->GetPacketType() != XFA_PacketType::Form &&
       GetXFANode()->GetPacketType() != XFA_PacketType::Datasets) {
-    return CJS_Return::Success(runtime->NewString(""));
+    return CJS_Result::Success(runtime->NewString(""));
   }
 
   CFX_XMLNode* pElement = nullptr;
   if (GetXFANode()->GetPacketType() == XFA_PacketType::Datasets) {
     pElement = GetXFANode()->GetXMLMappingNode();
     if (!pElement || pElement->GetType() != FX_XMLNODE_Element) {
-      return CJS_Return::Success(
+      return CJS_Result::Success(
           runtime->NewString(bsXMLHeader.AsStringView()));
     }
 
@@ -368,30 +368,30 @@
     pElement->Save(pMemoryStream);
   }
 
-  return CJS_Return::Success(runtime->NewString(
+  return CJS_Result::Success(runtime->NewString(
       ByteStringView(pMemoryStream->GetBuffer(), pMemoryStream->GetSize())));
 }
 
-CJS_Return CJX_Node::setAttribute(
+CJS_Result CJX_Node::setAttribute(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString attributeValue = runtime->ToWideString(params[0]);
   WideString attribute = runtime->ToWideString(params[1]);
   SetAttribute(attribute.AsStringView(), attributeValue.AsStringView(), true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Node::setElement(
+CJS_Result CJX_Node::setElement(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1 && params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   // TODO(weili): check whether we need to implement this, pdfium:501.
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJX_Node::id(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index be68795..27d1f15 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -13,7 +13,7 @@
 #include "core/fxcrt/xml/cfx_xmltext.h"
 #include "fxjs/cfxjse_engine.h"
 #include "fxjs/cfxjse_value.h"
-#include "fxjs/cjs_return.h"
+#include "fxjs/cjs_result.h"
 #include "fxjs/xfa/cjx_boolean.h"
 #include "fxjs/xfa/cjx_draw.h"
 #include "fxjs/xfa/cjx_field.h"
@@ -166,12 +166,12 @@
   return pdfium::ContainsKey(method_specs_, func.UTF8Encode());
 }
 
-CJS_Return CJX_Object::RunMethod(
+CJS_Result CJX_Object::RunMethod(
     const WideString& func,
     const std::vector<v8::Local<v8::Value>>& params) {
   auto it = method_specs_.find(func.UTF8Encode());
   if (it == method_specs_.end())
-    return CJS_Return::Failure(JSMessage::kUnknownMethod);
+    return CJS_Result::Failure(JSMessage::kUnknownMethod);
 
   return it->second(this, GetXFAObject()->GetDocument()->GetScriptContext(),
                     params);
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index 4116f37..a88900e 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -31,7 +31,7 @@
 class CXFA_Object;
 struct XFA_MAPMODULEDATA;
 
-typedef CJS_Return (*CJX_MethodCall)(
+typedef CJS_Result (*CJX_MethodCall)(
     CJX_Object* obj,
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params);
@@ -71,7 +71,7 @@
   CXFA_LayoutItem* GetLayoutItem() const { return layout_item_; }
 
   bool HasMethod(const WideString& func) const;
-  CJS_Return RunMethod(const WideString& func,
+  CJS_Result RunMethod(const WideString& func,
                        const std::vector<v8::Local<v8::Value>>& params);
 
   bool HasAttribute(XFA_Attribute eAttr);
diff --git a/fxjs/xfa/cjx_packet.cpp b/fxjs/xfa/cjx_packet.cpp
index ae706ce..5673f8a 100644
--- a/fxjs/xfa/cjx_packet.cpp
+++ b/fxjs/xfa/cjx_packet.cpp
@@ -28,40 +28,40 @@
 
 CJX_Packet::~CJX_Packet() {}
 
-CJS_Return CJX_Packet::getAttribute(
+CJS_Result CJX_Packet::getAttribute(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString attributeValue;
   CFX_XMLElement* element = ToXMLElement(GetXFANode()->GetXMLMappingNode());
   if (element)
     attributeValue = element->GetAttribute(runtime->ToWideString(params[0]));
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewString(attributeValue.UTF8Encode().AsStringView()));
 }
 
-CJS_Return CJX_Packet::setAttribute(
+CJS_Result CJX_Packet::setAttribute(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CFX_XMLElement* element = ToXMLElement(GetXFANode()->GetXMLMappingNode());
   if (element) {
     element->SetAttribute(runtime->ToWideString(params[1]),
                           runtime->ToWideString(params[0]));
   }
-  return CJS_Return::Success(runtime->NewNull());
+  return CJS_Result::Success(runtime->NewNull());
 }
 
-CJS_Return CJX_Packet::removeAttribute(
+CJS_Result CJX_Packet::removeAttribute(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CFX_XMLElement* pElement = ToXMLElement(GetXFANode()->GetXMLMappingNode());
   if (pElement) {
@@ -69,7 +69,7 @@
     if (pElement->HasAttribute(name))
       pElement->RemoveAttribute(name);
   }
-  return CJS_Return::Success(runtime->NewNull());
+  return CJS_Result::Success(runtime->NewNull());
 }
 
 void CJX_Packet::content(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_signaturepseudomodel.cpp b/fxjs/xfa/cjx_signaturepseudomodel.cpp
index 49a4f15..0a604a5 100644
--- a/fxjs/xfa/cjx_signaturepseudomodel.cpp
+++ b/fxjs/xfa/cjx_signaturepseudomodel.cpp
@@ -26,38 +26,38 @@
 
 CJX_SignaturePseudoModel::~CJX_SignaturePseudoModel() {}
 
-CJS_Return CJX_SignaturePseudoModel::verifySignature(
+CJS_Result CJX_SignaturePseudoModel::verifySignature(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 4)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewNumber(0));
+  return CJS_Result::Success(runtime->NewNumber(0));
 }
 
-CJS_Return CJX_SignaturePseudoModel::sign(
+CJS_Result CJX_SignaturePseudoModel::sign(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() < 3 || params.size() > 7)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewBoolean(false));
+  return CJS_Result::Success(runtime->NewBoolean(false));
 }
 
-CJS_Return CJX_SignaturePseudoModel::enumerate(
+CJS_Result CJX_SignaturePseudoModel::enumerate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_SignaturePseudoModel::clear(
+CJS_Result CJX_SignaturePseudoModel::clear(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.empty() || params.size() > 2)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewBoolean(false));
+  return CJS_Result::Success(runtime->NewBoolean(false));
 }
diff --git a/fxjs/xfa/cjx_source.cpp b/fxjs/xfa/cjx_source.cpp
index 0b24b8f..6a71095 100644
--- a/fxjs/xfa/cjx_source.cpp
+++ b/fxjs/xfa/cjx_source.cpp
@@ -37,146 +37,146 @@
 
 CJX_Source::~CJX_Source() {}
 
-CJS_Return CJX_Source::next(CFX_V8* runtime,
+CJS_Result CJX_Source::next(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::cancelBatch(
+CJS_Result CJX_Source::cancelBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::first(CFX_V8* runtime,
+CJS_Result CJX_Source::first(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::updateBatch(
+CJS_Result CJX_Source::updateBatch(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::previous(
+CJS_Result CJX_Source::previous(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::isBOF(CFX_V8* runtime,
+CJS_Result CJX_Source::isBOF(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::isEOF(CFX_V8* runtime,
+CJS_Result CJX_Source::isEOF(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::cancel(CFX_V8* runtime,
+CJS_Result CJX_Source::cancel(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::update(CFX_V8* runtime,
+CJS_Result CJX_Source::update(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::open(CFX_V8* runtime,
+CJS_Result CJX_Source::open(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::deleteItem(
+CJS_Result CJX_Source::deleteItem(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::addNew(CFX_V8* runtime,
+CJS_Result CJX_Source::addNew(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::requery(
+CJS_Result CJX_Source::requery(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::resync(CFX_V8* runtime,
+CJS_Result CJX_Source::resync(CFX_V8* runtime,
                               const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::close(CFX_V8* runtime,
+CJS_Result CJX_Source::close(CFX_V8* runtime,
                              const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::last(CFX_V8* runtime,
+CJS_Result CJX_Source::last(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Source::hasDataChanged(
+CJS_Result CJX_Source::hasDataChanged(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
 void CJX_Source::db(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_subform.cpp b/fxjs/xfa/cjx_subform.cpp
index c313cb4..c08d2e6 100644
--- a/fxjs/xfa/cjx_subform.cpp
+++ b/fxjs/xfa/cjx_subform.cpp
@@ -28,56 +28,56 @@
 
 CJX_Subform::~CJX_Subform() {}
 
-CJS_Return CJX_Subform::execEvent(
+CJS_Result CJX_Subform::execEvent(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   execSingleEventByName(runtime->ToWideString(params[0]).AsStringView(),
                         XFA_Element::Subform);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Subform::execInitialize(
+CJS_Result CJX_Subform::execInitialize(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify)
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Initialize, false,
                                   true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Subform::execCalculate(
+CJS_Result CJX_Subform::execCalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (pNotify)
     pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false,
                                   true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Subform::execValidate(
+CJS_Result CJX_Subform::execValidate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
   if (!pNotify)
-    return CJS_Return::Success(runtime->NewBoolean(false));
+    return CJS_Result::Success(runtime->NewBoolean(false));
 
   int32_t iRet = pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate,
                                                false, true);
-  return CJS_Return::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
+  return CJS_Result::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
 }
 
 void CJX_Subform::locale(CFXJSE_Value* pValue,
diff --git a/fxjs/xfa/cjx_template.cpp b/fxjs/xfa/cjx_template.cpp
index 8f27b64..b97d5e3 100644
--- a/fxjs/xfa/cjx_template.cpp
+++ b/fxjs/xfa/cjx_template.cpp
@@ -27,60 +27,60 @@
 
 CJX_Template::~CJX_Template() {}
 
-CJS_Return CJX_Template::formNodes(
+CJS_Result CJX_Template::formNodes(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewBoolean(true));
+  return CJS_Result::Success(runtime->NewBoolean(true));
 }
 
-CJS_Return CJX_Template::remerge(
+CJS_Result CJX_Template::remerge(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   GetDocument()->DoDataRemerge(true);
-  return CJS_Return::Success();
+  return CJS_Result::Success();
 }
 
-CJS_Return CJX_Template::execInitialize(
+CJS_Result CJX_Template::execInitialize(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewBoolean(GetXFANode()->IsWidgetReady()));
 }
 
-CJS_Return CJX_Template::recalculate(
+CJS_Result CJX_Template::recalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewBoolean(true));
+  return CJS_Result::Success(runtime->NewBoolean(true));
 }
 
-CJS_Return CJX_Template::execCalculate(
+CJS_Result CJX_Template::execCalculate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewBoolean(GetXFANode()->IsWidgetReady()));
 }
 
-CJS_Return CJX_Template::execValidate(
+CJS_Result CJX_Template::execValidate(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty())
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       runtime->NewBoolean(GetXFANode()->IsWidgetReady()));
 }
diff --git a/fxjs/xfa/cjx_tree.cpp b/fxjs/xfa/cjx_tree.cpp
index be74b44..9787b9b 100644
--- a/fxjs/xfa/cjx_tree.cpp
+++ b/fxjs/xfa/cjx_tree.cpp
@@ -29,16 +29,16 @@
 
 CJX_Tree::~CJX_Tree() {}
 
-CJS_Return CJX_Tree::resolveNode(
+CJS_Result CJX_Tree::resolveNode(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   WideString expression = runtime->ToWideString(params[0]);
   CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
   if (!pScriptContext)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CXFA_Object* refNode = GetXFAObject();
   if (refNode->GetElementType() == XFA_Element::Xfa)
@@ -51,7 +51,7 @@
   if (!pScriptContext->ResolveObjects(ToNode(refNode),
                                       expression.AsStringView(), &resolveNodeRS,
                                       dwFlag, nullptr)) {
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
   }
 
   if (resolveNodeRS.dwFlags == XFA_ResolveNode_RSType_Nodes) {
@@ -59,9 +59,9 @@
     CFXJSE_Value* value =
         GetDocument()->GetScriptContext()->GetJSValueFromMap(pObject);
     if (!value)
-      return CJS_Return::Success(runtime->NewNull());
+      return CJS_Result::Success(runtime->NewNull());
 
-    return CJS_Return::Success(
+    return CJS_Result::Success(
         value->DirectGetValue().Get(runtime->GetIsolate()));
   }
 
@@ -69,22 +69,22 @@
       resolveNodeRS.pScriptAttribute;
   if (!lpAttributeInfo ||
       lpAttributeInfo->eValueType != XFA_ScriptType::Object) {
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
   }
 
   auto pValue = pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetIsolate());
   CJX_Object* jsObject = resolveNodeRS.objects.front()->JSObject();
   (jsObject->*(lpAttributeInfo->callback))(pValue.get(), false,
                                            lpAttributeInfo->attribute);
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pValue->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
-CJS_Return CJX_Tree::resolveNodes(
+CJS_Result CJX_Tree::resolveNodes(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Object* refNode = GetXFAObject();
   if (refNode->GetElementType() == XFA_Element::Xfa)
@@ -92,7 +92,7 @@
 
   CFXJSE_Engine* pScriptContext = GetDocument()->GetScriptContext();
   if (!pScriptContext)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   auto pValue = pdfium::MakeUnique<CFXJSE_Value>(pScriptContext->GetIsolate());
   ResolveNodeList(pValue.get(), runtime->ToWideString(params[0]),
@@ -100,7 +100,7 @@
                       XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent |
                       XFA_RESOLVENODE_Siblings,
                   ToNode(refNode));
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       pValue->DirectGetValue().Get(runtime->GetIsolate()));
 }
 
diff --git a/fxjs/xfa/cjx_treelist.cpp b/fxjs/xfa/cjx_treelist.cpp
index 0c02300..acf5307 100644
--- a/fxjs/xfa/cjx_treelist.cpp
+++ b/fxjs/xfa/cjx_treelist.cpp
@@ -28,22 +28,22 @@
   return ToTreeList(GetXFAObject());
 }
 
-CJS_Return CJX_TreeList::namedItem(
+CJS_Result CJX_TreeList::namedItem(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
   CXFA_Node* pNode = GetXFATreeList()->NamedItem(
       runtime->ToWideString(params[0]).AsStringView());
   if (!pNode)
-    return CJS_Return::Success();
+    return CJS_Result::Success();
 
   CFXJSE_Value* value =
       GetDocument()->GetScriptContext()->GetJSValueFromMap(pNode);
   if (!value)
-    return CJS_Return::Success(runtime->NewNull());
+    return CJS_Result::Success(runtime->NewNull());
 
-  return CJS_Return::Success(
+  return CJS_Result::Success(
       value->DirectGetValue().Get(runtime->GetIsolate()));
 }
diff --git a/fxjs/xfa/cjx_wsdlconnection.cpp b/fxjs/xfa/cjx_wsdlconnection.cpp
index 198d4f2..dec20d7 100644
--- a/fxjs/xfa/cjx_wsdlconnection.cpp
+++ b/fxjs/xfa/cjx_wsdlconnection.cpp
@@ -22,13 +22,13 @@
 
 CJX_WsdlConnection::~CJX_WsdlConnection() {}
 
-CJS_Return CJX_WsdlConnection::execute(
+CJS_Result CJX_WsdlConnection::execute(
     CFX_V8* runtime,
     const std::vector<v8::Local<v8::Value>>& params) {
   if (!params.empty() && params.size() != 1)
-    return CJS_Return::Failure(JSMessage::kParamError);
+    return CJS_Result::Failure(JSMessage::kParamError);
 
-  return CJS_Return::Success(runtime->NewBoolean(false));
+  return CJS_Result::Success(runtime->NewBoolean(false));
 }
 
 void CJX_WsdlConnection::dataDescription(CFXJSE_Value* pValue,