Prettier React Native Libraries

Reviewed By: sahrens

Differential Revision: D7961488

fbshipit-source-id: 05f9b8b0b91ae77f9040a5321ccc18f7c3c1ce9a
This commit is contained in:
Eli White
2018-05-10 19:06:46 -07:00
committed by Facebook Github Bot
parent 1e2de71290
commit d01ab66b47
301 changed files with 6259 additions and 3781 deletions

View File

@@ -81,14 +81,21 @@ if (Platform.OS === 'ios') {
// However, the way things are set up, the list of view managers is not known at compile time.
// As Prepack runs at compile it, it cannot process this loop.
// So we wrap it in a special __residual call, which basically tells Prepack to ignore it.
let residual = global.__residual ? global.__residual : (_, f, ...args) => f.apply(undefined, args);
residual("void", (UIManager, defineLazyObjectProperty) => {
UIManager.ViewManagerNames.forEach(viewManagerName => {
defineLazyObjectProperty(UIManager, viewManagerName, {
get: () => UIManager.getConstantsForViewManager(viewManagerName),
let residual = global.__residual
? global.__residual
: (_, f, ...args) => f.apply(undefined, args);
residual(
'void',
(UIManager, defineLazyObjectProperty) => {
UIManager.ViewManagerNames.forEach(viewManagerName => {
defineLazyObjectProperty(UIManager, viewManagerName, {
get: () => UIManager.getConstantsForViewManager(viewManagerName),
});
});
});
}, UIManager, defineLazyObjectProperty);
},
UIManager,
defineLazyObjectProperty,
);
// As Prepack now no longer knows which properties exactly the UIManager has,
// we also tell Prepack that it has only partial knowledge of the UIManager,