Skip to content

Commit 0f7e461

Browse files
martinbigiobestander
authored andcommitted
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 436db67. Would be great having test coverage for this. Reviewed By: davidaurelio Differential Revision: D3075164 fb-gh-sync-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701 shipit-source-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
1 parent cafbeb0 commit 0f7e461

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Libraries/Utilities/HMRClient.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ Error: ${e.message}`
9696
? global.nativeInjectHMRUpdate
9797
: eval;
9898

99-
// TODO: (martinb) yellow box if cannot accept module
100-
code = `
101-
__accept(
102-
${name},
103-
function(global, require, module, exports) {
104-
${code}
105-
},
106-
${JSON.stringify(inverseDependencies)}
107-
);`;
99+
code = [
100+
`__accept(`,
101+
`${name},`,
102+
`function(global,require,module,exports){`,
103+
`${code}`,
104+
'\n},',
105+
`${JSON.stringify(inverseDependencies)}`,
106+
`);`,
107+
].join('');
108108

109109
injectFunction(code, sourceURLs[i]);
110110
});

0 commit comments

Comments
 (0)