mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-10 09:29:39 +08:00
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:
committed by
Facebook Github Bot
parent
62599fa8ff
commit
392e89676f
8
Libraries/vendor/core/Map.js
vendored
8
Libraries/vendor/core/Map.js
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user