inline __accept call so that sourcemaps work

Summary:Sourcemaps on HMR where a couple of line off. The problem is that since the `__accept` call doesn't go through the sourcemaps pipeline we need to make sure that call is a single-line one.

This was originally written in a single line but I incorrectly updated it on 436db67126. Would be great having test coverage for this.

Reviewed By: davidaurelio

Differential Revision: D3075164

fb-gh-sync-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
shipit-source-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
This commit is contained in:
Martín Bigio 2016-03-20 17:38:33 -07:00 committed by Facebook Github Bot 5
parent ec6770551c
commit bcb37c0b6a

View File

@ -96,15 +96,15 @@ Error: ${e.message}`
? global.nativeInjectHMRUpdate ? global.nativeInjectHMRUpdate
: eval; : eval;
// TODO: (martinb) yellow box if cannot accept module code = [
code = ` `__accept(`,
__accept( `${name},`,
${name}, `function(global,require,module,exports){`,
function(global, require, module, exports) { `${code}`,
${code} '\n},',
}, `${JSON.stringify(inverseDependencies)}`,
${JSON.stringify(inverseDependencies)} `);`,
);`; ].join('');
injectFunction(code, sourceURLs[i]); injectFunction(code, sourceURLs[i]);
}); });