[gjs/mozjs91] Fix cpplint



commit 88272eb0c695e576758d6538ee042625a15ff7a8
Author: Evan Welsh <contact evanwelsh com>
Date:   Sun Jul 18 13:31:07 2021 -0700

    Fix cpplint

 gi/gobject.cpp   | 24 +++++++++++++++---------
 gjs/context.cpp  |  2 +-
 gjs/internal.cpp |  2 +-
 gjs/module.cpp   |  2 +-
 4 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/gi/gobject.cpp b/gi/gobject.cpp
index feaacc96..b98af177 100644
--- a/gi/gobject.cpp
+++ b/gi/gobject.cpp
@@ -65,21 +65,27 @@ static bool jsobj_set_gproperty(JSContext* cx, JS::HandleObject object,
 
             // Ensure to call any associated setter method
             if (!g_str_equal(underscore_name.get(), pspec->name)) {
-                if (!JS_GetPropertyDescriptor(cx, object, underscore_name, &jsprop,
-                                          &holder))
+                if (!JS_GetPropertyDescriptor(cx, object, underscore_name,
+                                              &jsprop, &holder)) {
                     return false;
+                }
+
                 if (jsprop.isSome() && jsprop.value().setter() &&
-                 !JS_SetProperty(cx, object, underscore_name, jsvalue))
-                  return false;
-           }
+                    !JS_SetProperty(cx, object, underscore_name, jsvalue)) {
+                    return false;
+                }
+            }
 
            if (!g_str_equal(camel_name.get(), pspec->name)) {
                if (!JS_GetPropertyDescriptor(cx, object, camel_name, &jsprop,
-                                          &holder))
-                 return false;
-                if (jsprop.isSome() && jsprop.value().setter() &&
-                 !JS_SetProperty(cx, object, camel_name, jsvalue))
+                                             &holder)) {
+                   return false;
+               }
+
+               if (jsprop.isSome() && jsprop.value().setter() &&
+                   !JS_SetProperty(cx, object, camel_name, jsvalue)) {
                    return false;
+               }
          }
 
          if (!JS_GetPropertyDescriptor(cx, object, pspec->name, &jsprop,
diff --git a/gjs/context.cpp b/gjs/context.cpp
index 07a5f256..cc5b496a 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -1427,7 +1427,7 @@ bool GjsContextPrivate::eval_with_scope(JS::HandleObject scope_object,
     if (!script)
         return false;
 
-    // TODO -
+    // TODO(ewlsh): Investigate changes to script private API
     // 
https://github.com/mozilla/gecko-dev/commit/810f80185c290c08ef83d24daf8dfc64ef42e378#diff-35d2bbb110db1669ead652e8dd00f4abd7a25dd44d9b24fa26d6c86cde123cfd
     if (!JS::UpdateDebugMetadata(m_cx, script, options, privv, nullptr, nullptr,
                                  nullptr)) {
diff --git a/gjs/internal.cpp b/gjs/internal.cpp
index 5b390a50..32362204 100644
--- a/gjs/internal.cpp
+++ b/gjs/internal.cpp
@@ -102,7 +102,7 @@ bool gjs_load_internal_module(JSContext* cx, const char* identifier) {
 
     JS::RootedId key(cx, gjs_intern_string_to_id(cx, full_path));
 
-    // TODO: This is the value returned for TLA (top-level await)
+    // TODO(ewlsh): This is the value returned for TLA (top-level await)
     JS::RootedValue ignore(cx);
     if (!gjs_global_registry_set(cx, registry, key, module) ||
         !JS::ModuleInstantiate(cx, module) ||
diff --git a/gjs/module.cpp b/gjs/module.cpp
index 5d22d28a..0bce5025 100644
--- a/gjs/module.cpp
+++ b/gjs/module.cpp
@@ -127,7 +127,7 @@ class GjsScriptModule {
         if (!script)
             return false;
 
-        // TODO -
+        // TODO(ewlsh): Investigate changes to script private API
         // 
https://github.com/mozilla/gecko-dev/commit/810f80185c290c08ef83d24daf8dfc64ef42e378#diff-35d2bbb110db1669ead652e8dd00f4abd7a25dd44d9b24fa26d6c86cde123cfd
         if (!JS::UpdateDebugMetadata(cx, script, options, privv, nullptr,
                                      nullptr, nullptr)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]