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
This commit is contained in:
David Aurelio 2016-08-18 07:23:23 -07:00 committed by Facebook Github Bot 5
parent a5a087ef44
commit 599aaead28
1 changed files with 1 additions and 1 deletions

View File

@ -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,