Fix react-native function call arity errors

Reviewed By: zertosh

Differential Revision: D5081816

fbshipit-source-id: 5978770c30a69fb287d03aa7511999ce30f856a1
This commit is contained in:
Gabe Levi
2017-05-18 16:55:55 -07:00
committed by Facebook Github Bot
parent aa3bbf18a1
commit 3ddc7d47d5
22 changed files with 86 additions and 72 deletions
+3 -3
View File
@@ -10,6 +10,7 @@
*/
'use strict';
const emptyFunction = require('fbjs/lib/emptyFunction');
const invariant = require('fbjs/lib/invariant');
const memoize = require('async/memoize');
const nullthrows = require('fbjs/lib/nullthrows');
@@ -51,11 +52,10 @@ type LoadQueue =
const createParentModule =
() => ({file: {code: '', type: 'script', path: ''}, dependencies: []});
const noop = () => {};
const NO_OPTIONS = {};
exports.create = function create(resolve: ResolveFn, load: LoadFn): GraphFn {
function Graph(entryPoints, platform, options, callback = noop) {
function Graph(entryPoints, platform, options, callback = emptyFunction) {
const {
log = (console: any),
optimize = false,
@@ -80,7 +80,7 @@ exports.create = function create(resolve: ResolveFn, load: LoadFn): GraphFn {
callback(null, collect());
};
loadQueue.error = error => {
loadQueue.error = noop;
loadQueue.error = emptyFunction;
loadQueue.kill();
callback(error);
};