Reviewed By: nicklockwood

Differential Revision: D2745907

fb-gh-sync-id: f4687313ad817bb1d5a56bb766d8efa4a2926da7
This commit is contained in:
glevi@fb.com 2015-12-10 13:47:32 -08:00 коммит произвёл facebook-github-bot-7
Родитель c5c41d9d4c
Коммит 53825f5206
2 изменённых файлов: 20 добавлений и 2 удалений

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

@ -41,7 +41,7 @@ Object.keys(RemoteModules).forEach((moduleName) => {
const NativeModules = {};
Object.keys(RemoteModules).forEach((moduleName) => {
Object.defineProperty(NativeModules, moduleName, {
enumerable: true,
enumerable: true,
get: () => {
let module = RemoteModules[moduleName];
if (module && typeof module.moduleID === 'number' && global.nativeRequireModuleConfig) {
@ -69,8 +69,9 @@ UIManager && Object.keys(UIManager).forEach(viewName => {
const viewConfig = UIManager[viewName];
const constants = {};
if (viewConfig.Manager) {
/* $FlowFixMe - nice try. Flow doesn't like getters */
Object.defineProperty(viewConfig, 'Constants', {
enumerable: true,
enumerable: true,
get: () => {
const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)];
viewManager && Object.keys(viewManager).forEach(key => {

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

@ -0,0 +1,17 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule NativeModules
* @flow
*/
'use strict';
const BatchedBridge = require('BatchedBridge');
const RemoteModules = BatchedBridge.RemoteModules;
module.exports = RemoteModules;