Bug 1508097 - Remove clang-format off/on annotations for JSFunctionSpec arrays. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 28 Nov 2018 10:58:55 +0100
changeset 507947 2b3783d7fa5354130d452383dc9025d96326c97e
parent 507946 07b82a902b851e5161566c1b47c18eee772af2c7
child 507948 c0d6af045dff28630000382155d8c0632c7e1913
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1508097
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508097 - Remove clang-format off/on annotations for JSFunctionSpec arrays. r=tcampbell We have a lot of these arrays and some used clang-format off/on, some are formatted like a table, etc. We decided it's best to reformat and get rid of the tabular structure. Differential Revision: https://phabricator.services.mozilla.com/D13228
js/src/builtin/AtomicsObject.cpp
js/src/builtin/DataViewObject.cpp
js/src/builtin/JSON.cpp
js/src/builtin/MapObject.cpp
js/src/builtin/Object.cpp
js/src/builtin/String.cpp
js/src/builtin/WeakMapObject.cpp
js/src/builtin/WeakSetObject.cpp
js/src/jsdate.cpp
js/src/jsmath.cpp
js/src/jsnum.cpp
js/src/perf/jsperf.cpp
js/src/vm/JSFunction.cpp
js/src/vm/SelfHosting.cpp
--- a/js/src/builtin/AtomicsObject.cpp
+++ b/js/src/builtin/AtomicsObject.cpp
@@ -1011,32 +1011,30 @@ js::FutexThread::notify(NotifyReason rea
         break;
       default:
         MOZ_CRASH("bad NotifyReason in FutexThread::notify()");
     }
     cond_->notify_all();
 }
 
 const JSFunctionSpec AtomicsMethods[] = {
-    // clang-format off
     JS_INLINABLE_FN("compareExchange",    atomics_compareExchange,    4,0, AtomicsCompareExchange),
     JS_INLINABLE_FN("load",               atomics_load,               2,0, AtomicsLoad),
     JS_INLINABLE_FN("store",              atomics_store,              3,0, AtomicsStore),
     JS_INLINABLE_FN("exchange",           atomics_exchange,           3,0, AtomicsExchange),
     JS_INLINABLE_FN("add",                atomics_add,                3,0, AtomicsAdd),
     JS_INLINABLE_FN("sub",                atomics_sub,                3,0, AtomicsSub),
     JS_INLINABLE_FN("and",                atomics_and,                3,0, AtomicsAnd),
     JS_INLINABLE_FN("or",                 atomics_or,                 3,0, AtomicsOr),
     JS_INLINABLE_FN("xor",                atomics_xor,                3,0, AtomicsXor),
     JS_INLINABLE_FN("isLockFree",         atomics_isLockFree,         1,0, AtomicsIsLockFree),
     JS_FN("wait",                         atomics_wait,               4,0),
     JS_FN("notify",                       atomics_notify,             3,0),
     JS_FN("wake",                         atomics_notify,             3,0), // Legacy name
     JS_FS_END
-    // clang-format on
 };
 
 JSObject*
 AtomicsObject::initClass(JSContext* cx, Handle<GlobalObject*> global)
 {
     // Create Atomics Object.
     RootedObject objProto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
     if (!objProto) {
--- a/js/src/builtin/DataViewObject.cpp
+++ b/js/src/builtin/DataViewObject.cpp
@@ -923,17 +923,16 @@ const Class DataViewObject::class_ = {
 const Class DataViewObject::protoClass_ = {
     js_Object_str,
     JSCLASS_HAS_CACHED_PROTO(JSProto_DataView),
     JS_NULL_CLASS_OPS,
     &DataViewObject::classSpec_
 };
 
 const JSFunctionSpec DataViewObject::methods[] = {
-    // clang-format off
     JS_FN("getInt8",    DataViewObject::fun_getInt8,      1,0),
     JS_FN("getUint8",   DataViewObject::fun_getUint8,     1,0),
     JS_FN("getInt16",   DataViewObject::fun_getInt16,     1,0),
     JS_FN("getUint16",  DataViewObject::fun_getUint16,    1,0),
     JS_FN("getInt32",   DataViewObject::fun_getInt32,     1,0),
     JS_FN("getUint32",  DataViewObject::fun_getUint32,    1,0),
     JS_FN("getFloat32", DataViewObject::fun_getFloat32,   1,0),
     JS_FN("getFloat64", DataViewObject::fun_getFloat64,   1,0),
@@ -941,17 +940,16 @@ const JSFunctionSpec DataViewObject::met
     JS_FN("setUint8",   DataViewObject::fun_setUint8,     2,0),
     JS_FN("setInt16",   DataViewObject::fun_setInt16,     2,0),
     JS_FN("setUint16",  DataViewObject::fun_setUint16,    2,0),
     JS_FN("setInt32",   DataViewObject::fun_setInt32,     2,0),
     JS_FN("setUint32",  DataViewObject::fun_setUint32,    2,0),
     JS_FN("setFloat32", DataViewObject::fun_setFloat32,   2,0),
     JS_FN("setFloat64", DataViewObject::fun_setFloat64,   2,0),
     JS_FS_END
-    // clang-format on
 };
 
 const JSPropertySpec DataViewObject::properties[] = {
     JS_PSG("buffer", DataViewObject::bufferGetter, 0),
     JS_PSG("byteLength", DataViewObject::byteLengthGetter, 0),
     JS_PSG("byteOffset", DataViewObject::byteOffsetGetter, 0),
     JS_STRING_SYM_PS(toStringTag, "DataView", JSPROP_READONLY),
     JS_PS_END
--- a/js/src/builtin/JSON.cpp
+++ b/js/src/builtin/JSON.cpp
@@ -1100,22 +1100,20 @@ json_stringify(JSContext* cx, unsigned a
     } else {
         args.rval().setUndefined();
     }
 
     return true;
 }
 
 static const JSFunctionSpec json_static_methods[] = {
-    // clang-format off
     JS_FN(js_toSource_str,  json_toSource,      0, 0),
     JS_FN("parse",          json_parse,         2, 0),
     JS_FN("stringify",      json_stringify,     3, 0),
     JS_FS_END
-    // clang-format on
 };
 
 JSObject*
 js::InitJSONClass(JSContext* cx, Handle<GlobalObject*> global)
 {
     RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
     if (!proto) {
         return nullptr;
--- a/js/src/builtin/MapObject.cpp
+++ b/js/src/builtin/MapObject.cpp
@@ -455,31 +455,29 @@ const Class MapObject::protoClass_ = {
 
 const JSPropertySpec MapObject::properties[] = {
     JS_PSG("size", size, 0),
     JS_STRING_SYM_PS(toStringTag, "Map", JSPROP_READONLY),
     JS_PS_END
 };
 
 const JSFunctionSpec MapObject::methods[] = {
-    // clang-format off
     JS_FN("get", get, 1, 0),
     JS_FN("has", has, 1, 0),
     JS_FN("set", set, 2, 0),
     JS_FN("delete", delete_, 1, 0),
     JS_FN("keys", keys, 0, 0),
     JS_FN("values", values, 0, 0),
     JS_FN("clear", clear, 0, 0),
     JS_SELF_HOSTED_FN("forEach", "MapForEach", 2, 0),
     // MapEntries only exists to preseve the equal identity of
     // entries and @@iterator.
     JS_SELF_HOSTED_FN("entries", "MapEntries", 0, 0),
     JS_SELF_HOSTED_SYM_FN(iterator, "MapEntries", 0, 0),
     JS_FS_END
-    // clang-format on
 };
 
 const JSPropertySpec MapObject::staticProperties[] = {
     JS_SELF_HOSTED_SYM_GET(species, "MapSpecies", 0),
     JS_PS_END
 };
 
 template <class Range>
@@ -1313,30 +1311,28 @@ const Class SetObject::protoClass_ = {
 
 const JSPropertySpec SetObject::properties[] = {
     JS_PSG("size", size, 0),
     JS_STRING_SYM_PS(toStringTag, "Set", JSPROP_READONLY),
     JS_PS_END
 };
 
 const JSFunctionSpec SetObject::methods[] = {
-    // clang-format off
     JS_FN("has", has, 1, 0),
     JS_FN("add", add, 1, 0),
     JS_FN("delete", delete_, 1, 0),
     JS_FN("entries", entries, 0, 0),
     JS_FN("clear", clear, 0, 0),
     JS_SELF_HOSTED_FN("forEach", "SetForEach", 2, 0),
     // SetValues only exists to preseve the equal identity of
     // values, keys and @@iterator.
     JS_SELF_HOSTED_FN("values", "SetValues", 0, 0),
     JS_SELF_HOSTED_FN("keys", "SetValues", 0, 0),
     JS_SELF_HOSTED_SYM_FN(iterator, "SetValues", 0, 0),
     JS_FS_END
-    // clang-format on
 };
 
 const JSPropertySpec SetObject::staticProperties[] = {
     JS_SELF_HOSTED_SYM_GET(species, "SetSpecies", 0),
     JS_PS_END
 };
 
 bool
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -2113,41 +2113,36 @@ ProtoSetter(JSContext* cx, unsigned argc
         return false;
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 static const JSFunctionSpec object_methods[] = {
-    // clang-format off
     JS_FN(js_toSource_str,             obj_toSource,                0,0),
     JS_INLINABLE_FN(js_toString_str,   obj_toString,                0,0, ObjectToString),
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Object_toLocaleString", 0, 0),
     JS_SELF_HOSTED_FN(js_valueOf_str,  "Object_valueOf",            0,0),
     JS_SELF_HOSTED_FN(js_hasOwnProperty_str, "Object_hasOwnProperty", 1,0),
     JS_FN(js_isPrototypeOf_str,        obj_isPrototypeOf,           1,0),
     JS_FN(js_propertyIsEnumerable_str, obj_propertyIsEnumerable,    1,0),
     JS_SELF_HOSTED_FN(js_defineGetter_str, "ObjectDefineGetter",    2,0),
     JS_SELF_HOSTED_FN(js_defineSetter_str, "ObjectDefineSetter",    2,0),
     JS_SELF_HOSTED_FN(js_lookupGetter_str, "ObjectLookupGetter",    1,0),
     JS_SELF_HOSTED_FN(js_lookupSetter_str, "ObjectLookupSetter",    1,0),
     JS_FS_END
-    // clang-format on
 };
 
 static const JSPropertySpec object_properties[] = {
-    // clang-format off
     JS_PSGS("__proto__", ProtoGetter, ProtoSetter, 0),
     JS_PS_END
-    // clang-format on
 };
 
 static const JSFunctionSpec object_static_methods[] = {
-    // clang-format off
     JS_FN("assign",                    obj_assign,                  2, 0),
     JS_SELF_HOSTED_FN("getPrototypeOf", "ObjectGetPrototypeOf",     1, 0),
     JS_FN("setPrototypeOf",            obj_setPrototypeOf,          2, 0),
     JS_SELF_HOSTED_FN("getOwnPropertyDescriptor", "ObjectGetOwnPropertyDescriptor", 2, 0),
     JS_SELF_HOSTED_FN("getOwnPropertyDescriptors", "ObjectGetOwnPropertyDescriptors", 1, 0),
     JS_FN("keys",                      obj_keys,                    1, 0),
     JS_FN("values",                    obj_values,                  1, 0),
     JS_FN("entries",                   obj_entries,                 1, 0),
@@ -2160,17 +2155,16 @@ static const JSFunctionSpec object_stati
     JS_SELF_HOSTED_FN("isExtensible",  "ObjectIsExtensible",        1, 0),
     JS_FN("preventExtensions",         obj_preventExtensions,       1, 0),
     JS_FN("freeze",                    obj_freeze,                  1, 0),
     JS_FN("isFrozen",                  obj_isFrozen,                1, 0),
     JS_FN("seal",                      obj_seal,                    1, 0),
     JS_FN("isSealed",                  obj_isSealed,                1, 0),
     JS_SELF_HOSTED_FN("fromEntries",   "ObjectFromEntries",         1, 0),
     JS_FS_END
-    // clang-format on
 };
 
 static JSObject*
 CreateObjectConstructor(JSContext* cx, JSProtoKey key)
 {
     Rooted<GlobalObject*> self(cx, cx->global());
     if (!GlobalObject::ensureConstructor(cx, self, JSProto_Function)) {
         return nullptr;
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -380,27 +380,25 @@ str_uneval(JSContext* cx, unsigned argc,
         return false;
     }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_functions[] = {
-    // clang-format off
     JS_FN(js_escape_str,             str_escape,                1, JSPROP_RESOLVING),
     JS_FN(js_unescape_str,           str_unescape,              1, JSPROP_RESOLVING),
     JS_FN(js_uneval_str,             str_uneval,                1, JSPROP_RESOLVING),
     JS_FN(js_decodeURI_str,          str_decodeURI,             1, JSPROP_RESOLVING),
     JS_FN(js_encodeURI_str,          str_encodeURI,             1, JSPROP_RESOLVING),
     JS_FN(js_decodeURIComponent_str, str_decodeURI_Component,   1, JSPROP_RESOLVING),
     JS_FN(js_encodeURIComponent_str, str_encodeURI_Component,   1, JSPROP_RESOLVING),
 
     JS_FS_END
-    // clang-format on
 };
 
 static const unsigned STRING_ELEMENT_ATTRS = JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT;
 
 static bool
 str_enumerate(JSContext* cx, HandleObject obj)
 {
     RootedString str(cx, obj->as<StringObject>().unbox());
@@ -3398,17 +3396,16 @@ js::str_concat(JSContext* cx, unsigned a
         }
     }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_methods[] = {
-    // clang-format off
     JS_FN(js_toSource_str,     str_toSource,          0,0),
 
     /* Java-like methods. */
     JS_FN(js_toString_str,     str_toString,          0,0),
     JS_FN(js_valueOf_str,      str_toString,          0,0),
     JS_INLINABLE_FN("toLowerCase", str_toLowerCase,   0,0, StringToLowerCase),
     JS_INLINABLE_FN("toUpperCase", str_toUpperCase,   0,0, StringToUpperCase),
     JS_INLINABLE_FN("charAt",  str_charAt,            1,0, StringCharAt),
@@ -3462,17 +3459,16 @@ static const JSFunctionSpec string_metho
     JS_SELF_HOSTED_FN("sub",      "String_sub",        0,0),
     JS_SELF_HOSTED_FN("anchor",   "String_anchor",     1,0),
     JS_SELF_HOSTED_FN("link",     "String_link",       1,0),
     JS_SELF_HOSTED_FN("fontcolor","String_fontcolor",  1,0),
     JS_SELF_HOSTED_FN("fontsize", "String_fontsize",   1,0),
 
     JS_SELF_HOSTED_SYM_FN(iterator, "String_iterator", 0,0),
     JS_FS_END
-    // clang-format on
 };
 
 // ES6 rev 27 (2014 Aug 24) 21.1.1
 bool
 js::StringConstructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
@@ -3721,17 +3717,16 @@ js::str_fromCodePoint(JSContext* cx, uns
         return false;
     }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_static_methods[] = {
-    // clang-format off
     JS_INLINABLE_FN("fromCharCode", js::str_fromCharCode, 1, 0, StringFromCharCode),
     JS_INLINABLE_FN("fromCodePoint", js::str_fromCodePoint, 1, 0, StringFromCodePoint),
 
     JS_SELF_HOSTED_FN("raw",             "String_static_raw",           1,0),
     JS_SELF_HOSTED_FN("substring",       "String_static_substring",     3,0),
     JS_SELF_HOSTED_FN("substr",          "String_static_substr",        3,0),
     JS_SELF_HOSTED_FN("slice",           "String_static_slice",         3,0),
 
@@ -3756,17 +3751,16 @@ static const JSFunctionSpec string_stati
     JS_SELF_HOSTED_FN("toLocaleUpperCase","String_static_toLocaleUpperCase",1,0),
 #if EXPOSE_INTL_API
     JS_SELF_HOSTED_FN("normalize",       "String_static_normalize",     1,0),
 #endif
     JS_SELF_HOSTED_FN("concat",          "String_static_concat",        2,0),
 
     JS_SELF_HOSTED_FN("localeCompare",   "String_static_localeCompare", 2,0),
     JS_FS_END
-    // clang-format on
 };
 
 /* static */ Shape*
 StringObject::assignInitialShape(JSContext* cx, Handle<StringObject*> obj)
 {
     MOZ_ASSERT(obj->empty());
 
     return NativeObject::addDataProperty(cx, obj, cx->names().length, LENGTH_SLOT,
--- a/js/src/builtin/WeakMapObject.cpp
+++ b/js/src/builtin/WeakMapObject.cpp
@@ -309,16 +309,14 @@ const Class WeakMapObject::protoClass_ =
 };
 
 const JSPropertySpec WeakMapObject::properties[] = {
     JS_STRING_SYM_PS(toStringTag, "WeakMap", JSPROP_READONLY),
     JS_PS_END
 };
 
 const JSFunctionSpec WeakMapObject::methods[] = {
-    // clang-format off
     JS_FN("has", has, 1, 0),
     JS_FN("get", get, 1, 0),
     JS_FN("delete", delete_, 1, 0),
     JS_FN("set", set, 2, 0),
     JS_FS_END
-    // clang-format on
 };
--- a/js/src/builtin/WeakSetObject.cpp
+++ b/js/src/builtin/WeakSetObject.cpp
@@ -157,22 +157,20 @@ const Class WeakSetObject::protoClass_ =
 };
 
 const JSPropertySpec WeakSetObject::properties[] = {
     JS_STRING_SYM_PS(toStringTag, "WeakSet", JSPROP_READONLY),
     JS_PS_END
 };
 
 const JSFunctionSpec WeakSetObject::methods[] = {
-    // clang-format off
     JS_FN("add", add, 1, 0),
     JS_FN("delete", delete_, 1, 0),
     JS_FN("has", has, 1, 0),
     JS_FS_END
-    // clang-format on
 };
 
 WeakSetObject*
 WeakSetObject::create(JSContext* cx, HandleObject proto /* = nullptr */)
 {
     return NewObjectWithClassProto<WeakSetObject>(cx, proto);
 }
 
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -3345,26 +3345,23 @@ date_toPrimitive(JSContext* cx, unsigned
     }
 
     args.rval().set(args.thisv());
     RootedObject obj(cx, &args.thisv().toObject());
     return OrdinaryToPrimitive(cx, obj, hint, args.rval());
 }
 
 static const JSFunctionSpec date_static_methods[] = {
-    // clang-format off
     JS_FN("UTC",                 date_UTC,                7,0),
     JS_FN("parse",               date_parse,              1,0),
     JS_FN("now",                 date_now,                0,0),
     JS_FS_END
-    // clang-format on
 };
 
 static const JSFunctionSpec date_methods[] = {
-    // clang-format off
     JS_FN("getTime",             date_getTime,            0,0),
     JS_FN("getTimezoneOffset",   date_getTimezoneOffset,  0,0),
     JS_FN("getYear",             date_getYear,            0,0),
     JS_FN("getFullYear",         date_getFullYear,        0,0),
     JS_FN("getUTCFullYear",      date_getUTCFullYear,     0,0),
     JS_FN("getMonth",            date_getMonth,           0,0),
     JS_FN("getUTCMonth",         date_getUTCMonth,        0,0),
     JS_FN("getDate",             date_getDate,            0,0),
@@ -3409,17 +3406,16 @@ static const JSFunctionSpec date_methods
     JS_FN("toTimeString",        date_toTimeString,       0,0),
     JS_FN("toISOString",         date_toISOString,        0,0),
     JS_FN(js_toJSON_str,         date_toJSON,             1,0),
     JS_FN(js_toSource_str,       date_toSource,           0,0),
     JS_FN(js_toString_str,       date_toString,           0,0),
     JS_FN(js_valueOf_str,        date_valueOf,            0,0),
     JS_SYM_FN(toPrimitive,       date_toPrimitive,        1,JSPROP_READONLY),
     JS_FS_END
-    // clang-format on
 };
 
 static bool
 NewDateObject(JSContext* cx, const CallArgs& args, ClippedTime t)
 {
     MOZ_ASSERT(args.isConstructing());
 
     RootedObject proto(cx);
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -1087,17 +1087,16 @@ static bool
 math_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setString(cx->names().Math);
     return true;
 }
 
 static const JSFunctionSpec math_static_methods[] = {
-    // clang-format off
     JS_FN(js_toSource_str,  math_toSource,        0, 0),
     JS_INLINABLE_FN("abs",    math_abs,             1, 0, MathAbs),
     JS_INLINABLE_FN("acos",   math_acos,            1, 0, MathACos),
     JS_INLINABLE_FN("asin",   math_asin,            1, 0, MathASin),
     JS_INLINABLE_FN("atan",   math_atan,            1, 0, MathATan),
     JS_INLINABLE_FN("atan2",  math_atan2,           2, 0, MathATan2),
     JS_INLINABLE_FN("ceil",   math_ceil,            1, 0, MathCeil),
     JS_INLINABLE_FN("clz32",  math_clz32,           1, 0, MathClz32),
@@ -1125,17 +1124,16 @@ static const JSFunctionSpec math_static_
     JS_INLINABLE_FN("acosh",  math_acosh,           1, 0, MathACosH),
     JS_INLINABLE_FN("asinh",  math_asinh,           1, 0, MathASinH),
     JS_INLINABLE_FN("atanh",  math_atanh,           1, 0, MathATanH),
     JS_INLINABLE_FN("hypot",  math_hypot,           2, 0, MathHypot),
     JS_INLINABLE_FN("trunc",  math_trunc,           1, 0, MathTrunc),
     JS_INLINABLE_FN("sign",   math_sign,            1, 0, MathSign),
     JS_INLINABLE_FN("cbrt",   math_cbrt,            1, 0, MathCbrt),
     JS_FS_END
-    // clang-format on
 };
 
 JSObject*
 js::InitMathClass(JSContext* cx, Handle<GlobalObject*> global)
 {
     RootedObject proto(cx, GlobalObject::getOrCreateObjectPrototype(cx, global));
     if (!proto) {
         return nullptr;
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1200,30 +1200,28 @@ num_toPrecision_impl(JSContext* cx, cons
 static bool
 num_toPrecision(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsNumber, num_toPrecision_impl>(cx, args);
 }
 
 static const JSFunctionSpec number_methods[] = {
-    // clang-format off
     JS_FN(js_toSource_str,       num_toSource,          0, 0),
     JS_FN(js_toString_str,       num_toString,          1, 0),
 #if EXPOSE_INTL_API
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Number_toLocaleString", 0,0),
 #else
     JS_FN(js_toLocaleString_str, num_toLocaleString,     0,0),
 #endif
     JS_FN(js_valueOf_str,        num_valueOf,           0, 0),
     JS_FN("toFixed",             num_toFixed,           1, 0),
     JS_FN("toExponential",       num_toExponential,     1, 0),
     JS_FN("toPrecision",         num_toPrecision,       1, 0),
     JS_FS_END
-    // clang-format on
 };
 
 bool
 js::IsInteger(const Value& val)
 {
     return val.isInt32() ||
            (mozilla::IsFinite(val.toDouble()) && JS::ToInteger(val.toDouble()) == val.toDouble());
 }
--- a/js/src/perf/jsperf.cpp
+++ b/js/src/perf/jsperf.cpp
@@ -95,23 +95,21 @@ pm_canMeasureSomething(JSContext* cx, un
         return false;
 
     args.rval().setBoolean(PerfMeasurement::canMeasureSomething());
     return true;
 }
 
 static const uint8_t PM_FATTRS = JSPROP_READONLY | JSPROP_PERMANENT;
 static const JSFunctionSpec pm_fns[] = {
-    // clang-format off
     JS_FN("start",               pm_start,               0, PM_FATTRS),
     JS_FN("stop",                pm_stop,                0, PM_FATTRS),
     JS_FN("reset",               pm_reset,               0, PM_FATTRS),
     JS_FN("canMeasureSomething", pm_canMeasureSomething, 0, PM_FATTRS),
     JS_FS_END
-    // clang-format on
 };
 
 static const uint8_t PM_PATTRS =
     JSPROP_ENUMERATE | JSPROP_PERMANENT;
 
 #define GETTER(name)                            \
     JS_PSG(#name, pm_get_##name, PM_PATTRS)
 
--- a/js/src/vm/JSFunction.cpp
+++ b/js/src/vm/JSFunction.cpp
@@ -1929,25 +1929,23 @@ JSFunction::maybeRelazify(JSRuntime* rt)
         MOZ_ASSERT(isExtended());
         MOZ_ASSERT(getExtendedSlot(LAZY_FUNCTION_NAME_SLOT).toString()->isAtom());
     }
 
     realm->scheduleDelazificationForDebugger();
 }
 
 const JSFunctionSpec js::function_methods[] = {
-    // clang-format off
     JS_FN(js_toSource_str,   fun_toSource,   0,0),
     JS_FN(js_toString_str,   fun_toString,   0,0),
     JS_FN(js_apply_str,      fun_apply,      2,0),
     JS_FN(js_call_str,       fun_call,       1,0),
     JS_SELF_HOSTED_FN("bind", "FunctionBind", 2, 0),
     JS_SYM_FN(hasInstance, fun_symbolHasInstance, 1, JSPROP_READONLY | JSPROP_PERMANENT),
     JS_FS_END
-    // clang-format on
 };
 
 // ES2018 draft rev 2aea8f3e617b49df06414eb062ab44fad87661d3
 // 19.2.1.1.1 CreateDynamicFunction( constructor, newTarget, kind, args )
 static bool
 CreateDynamicFunction(JSContext* cx, const CallArgs& args, GeneratorKind generatorKind,
                       FunctionAsyncKind asyncKind)
 {
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -2386,17 +2386,16 @@ intrinsic_CopyDataPropertiesOrGetOwnKeys
 // content script might have changed the builtins' prototypes' members.
 // Installing the whole set of builtins in the self-hosting compartment, OTOH,
 // would be wasteful: it increases memory usage and initialization time for
 // self-hosting compartment.
 //
 // Additionally, a set of C++-implemented helper functions is defined on the
 // self-hosting global.
 static const JSFunctionSpec intrinsic_functions[] = {
-    // clang-format off
     JS_INLINABLE_FN("std_Array",                 array_construct,              1,0, Array),
     JS_INLINABLE_FN("std_Array_join",            array_join,                   1,0, ArrayJoin),
     JS_INLINABLE_FN("std_Array_push",            array_push,                   1,0, ArrayPush),
     JS_INLINABLE_FN("std_Array_pop",             array_pop,                    0,0, ArrayPop),
     JS_INLINABLE_FN("std_Array_shift",           array_shift,                  0,0, ArrayShift),
     JS_FN("std_Array_unshift",                   array_unshift,                1,0),
     JS_INLINABLE_FN("std_Array_slice",           array_slice,                  2,0, ArraySlice),
     JS_FN("std_Array_reverse",                   array_reverse,                0,0),
@@ -2660,26 +2659,30 @@ static const JSFunctionSpec intrinsic_fu
                     IntrinsicObjectIsTransparentTypedObject),
     JS_INLINABLE_FN("TypeDescrIsArrayType",           js::TypeDescrIsArrayType, 1, 0,
                     IntrinsicTypeDescrIsArrayType),
     JS_INLINABLE_FN("TypeDescrIsSimpleType",          js::TypeDescrIsSimpleType, 1, 0,
                     IntrinsicTypeDescrIsSimpleType),
     JS_INLINABLE_FN("SetTypedObjectOffset",           js::SetTypedObjectOffset, 2, 0,
                     IntrinsicSetTypedObjectOffset),
 
+// clang-format off
 #define LOAD_AND_STORE_SCALAR_FN_DECLS(_constant, _type, _name)         \
     JS_FN("Store_" #_name, js::StoreScalar##_type::Func, 3, 0),         \
     JS_FN("Load_" #_name,  js::LoadScalar##_type::Func, 3, 0),
     JS_FOR_EACH_UNIQUE_SCALAR_TYPE_REPR_CTYPE(LOAD_AND_STORE_SCALAR_FN_DECLS)
+// clang-format on
 #undef LOAD_AND_STORE_SCALAR_FN_DECLS
 
+// clang-format off
 #define LOAD_AND_STORE_REFERENCE_FN_DECLS(_constant, _type, _name)      \
     JS_FN("Store_" #_name, js::StoreReference##_name::Func, 3, 0),      \
     JS_FN("Load_" #_name,  js::LoadReference##_name::Func, 3, 0),
     JS_FOR_EACH_REFERENCE_TYPE_REPR(LOAD_AND_STORE_REFERENCE_FN_DECLS)
+// clang-format on
 #undef LOAD_AND_STORE_REFERENCE_FN_DECLS
 
     // See builtin/intl/*.h for descriptions of the intl_* functions.
     JS_FN("intl_availableCalendars", intl_availableCalendars, 1,0),
     JS_FN("intl_availableCollations", intl_availableCollations, 1,0),
     JS_FN("intl_canonicalizeTimeZone", intl_canonicalizeTimeZone, 1,0),
     JS_FN("intl_Collator", intl_Collator, 2,0),
     JS_FN("intl_Collator_availableLocales", intl_Collator_availableLocales, 0,0),
@@ -2798,17 +2801,16 @@ static const JSFunctionSpec intrinsic_fu
     JS_FN("ExecuteModule", intrinsic_ExecuteModule, 1, 0),
     JS_FN("NewModuleNamespace", intrinsic_NewModuleNamespace, 2, 0),
     JS_FN("AddModuleNamespaceBinding", intrinsic_AddModuleNamespaceBinding, 4, 0),
     JS_FN("ModuleNamespaceExports", intrinsic_ModuleNamespaceExports, 1, 0),
 
     JS_FN("PromiseResolve", intrinsic_PromiseResolve, 2, 0),
 
     JS_FS_END
-    // clang-format on
 };
 
 void
 js::FillSelfHostingCompileOptions(CompileOptions& options)
 {
     /*
      * In self-hosting mode, scripts use JSOP_GETINTRINSIC instead of
      * JSOP_GETNAME or JSOP_GETGNAME to access unbound variables.