Work around weird inferred name in Chrome

This commit is contained in:
Dan Abramov
2017-05-14 12:35:18 +01:00
parent 4434467a43
commit ac7777d52d

View File

@@ -142,7 +142,10 @@ function createFrame(
// Chrome has a bug with inferring function.name:
// https://github.com/facebookincubator/create-react-app/issues/2097
// Let's ignore a meaningless name we get for top-level modules.
if (functionName === 'Object.friendlySyntaxErrorLabel') {
if (
functionName === 'Object.friendlySyntaxErrorLabel' ||
functionName === 'Object.exports.__esModule'
) {
functionName = '(anonymous function)';
}