add prettier check in ci (#23382)

Summary:
enforce code format
Pull Request resolved: https://github.com/facebook/react-native/pull/23382

Differential Revision: D14024609

Pulled By: cpojer

fbshipit-source-id: 21176cf8f009987e5a281bbead414374632eabee
This commit is contained in:
gengjiawen
2019-02-11 09:03:16 -08:00
committed by Facebook Github Bot
parent 62599fa8ff
commit 392e89676f
4 changed files with 14 additions and 8 deletions

View File

@@ -546,8 +546,10 @@ module.exports = (function(global, undefined) {
}
if (!isES5) {
if (hasOwn.call(o, "propertyIsEnumerable") &&
hasOwn.call(o.propertyIsEnumerable, hashProperty)) {
if (
hasOwn.call(o, 'propertyIsEnumerable') &&
hasOwn.call(o.propertyIsEnumerable, hashProperty)
) {
return o.propertyIsEnumerable[hashProperty];
}
}
@@ -571,7 +573,7 @@ module.exports = (function(global, undefined) {
o.propertyIsEnumerable = function() {
return propIsEnumerable.apply(this, arguments);
};
return o.propertyIsEnumerable[hashProperty] = ++hashCounter;
return (o.propertyIsEnumerable[hashProperty] = ++hashCounter);
}
}

View File

@@ -19,13 +19,15 @@ function getTestMap() {
// Wrap Object.{freeze,seal,preventExtensions} so each function adds its
// argument to a Map first, which gives our ./Map.js polyfill a chance to
// tag the object before it becomes non-extensible.
["freeze", "seal", "preventExtensions"].forEach(name => {
['freeze', 'seal', 'preventExtensions'].forEach(name => {
const method = Object[name];
if (typeof method === "function") {
(Object: any)[name] = function (obj) {
if (typeof method === 'function') {
(Object: any)[name] = function(obj) {
try {
// If .set succeeds, also call .delete to avoid leaking memory.
getTestMap().set(obj, obj).delete(obj);
getTestMap()
.set(obj, obj)
.delete(obj);
} finally {
// If .set fails, the exception will be silently swallowed
// by this return-from-finally statement, and the method will