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/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();
 }