Permalink
Browse files

Fix module IDs of initial require calls

Summary: The logic of assigning module IDs to the initial require calls of a bundle was faulty, counting up from -1 instead of counting down. This change ensures that IDs are -1, -2, ...

Reviewed By: matryoshcow

Differential Revision: D3735560

fbshipit-source-id: 89efa3e73b39c2f8bfed8a6a30487733d1a8b145
  • Loading branch information...
1 parent ee49dd7 commit f83c86941149704bdb061a707a77482f14bc7200 @davidaurelio davidaurelio committed with Facebook Github Bot 5 Aug 18, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 packager/react-packager/src/Bundler/Bundle.js
@@ -67,7 +67,7 @@ class Bundle extends BundleBase {
const name = 'require-' + moduleId;
super.addModule(new ModuleTransport({
name,
- id: this._numRequireCalls - 1,
+ id: -this._numRequireCalls - 1,
code,
virtual: true,
sourceCode: code,

0 comments on commit f83c869

Please sign in to comment.