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 коммит произвёл Facebook Github Bot
Родитель 62599fa8ff
Коммит 392e89676f
4 изменённых файлов: 14 добавлений и 8 удалений

Просмотреть файл

@ -358,6 +358,7 @@ jobs:
- run: *setup-artifacts
- run: *yarn
- run: *run-js-tests
- run: yarn run format-check
- store_test_results:
path: ~/react-native/reports/junit

8
Libraries/vendor/core/Map.js поставляемый
Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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

Просмотреть файл

@ -139,7 +139,8 @@
"flow-check-ios": "flow check",
"flow-check-android": "flow check --flowconfig-name .flowconfig.android",
"lint": "eslint .",
"prettier": "prettier \"./**/*.js\" --write",
"prettier": "prettier --write \"./**/*.js\" \"./**/*.md\"",
"format-check": "prettier --list-different \"./**/*.js\" \"./**/*.md\"",
"docker-setup-android": "docker pull reactnativecommunity/react-native-android",
"docker-build-android": "docker build -t reactnativeci/android -f ContainerShip/Dockerfile.android .",
"test-android-run-instrumentation": "docker run --cap-add=SYS_ADMIN -it reactnativeci/android bash ContainerShip/scripts/run-android-docker-instrumentation-tests.sh",