Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
inline __accept call so that sourcemaps work
Browse files Browse the repository at this point in the history
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 facebook@436db67. Would be great having test coverage for this.

Reviewed By: davidaurelio

Differential Revision: D3075164

fb-gh-sync-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
shipit-source-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
  • Loading branch information
martinbigio authored and Facebook Github Bot 5 committed Mar 21, 2016
1 parent ec67705 commit bcb37c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Libraries/Utilities/HMRClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ Error: ${e.message}`
? global.nativeInjectHMRUpdate
: eval;

// TODO: (martinb) yellow box if cannot accept module
code = `
__accept(
${name},
function(global, require, module, exports) {
${code}
},
${JSON.stringify(inverseDependencies)}
);`;
code = [
`__accept(`,
`${name},`,
`function(global,require,module,exports){`,
`${code}`,
'\n},',
`${JSON.stringify(inverseDependencies)}`,
`);`,
].join('');

injectFunction(code, sourceURLs[i]);
});
Expand Down

0 comments on commit bcb37c0

Please sign in to comment.