Skip to content

Commit

Permalink
Fix module function name in error overlay (#3012)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored and JohnNilsson committed Sep 9, 2017
1 parent 7aa5c2c commit ae457ae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/react-error-overlay/src/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ function frameDiv(
const frame = document.createElement('div');
const frameFunctionName = document.createElement('div');

let cleanedFunctionName;
if (!functionName || functionName === 'Object.<anonymous>') {
cleanedFunctionName = '(anonymous function)';
} else {
cleanedFunctionName = functionName;
if (functionName && functionName.indexOf('Object.') === 0) {
functionName = functionName.slice('Object.'.length);
}

if (functionName === '<anonymous>') {
functionName = null;
}
const cleanedFunctionName = functionName || '(anonymous function)';
const cleanedUrl = url.replace('webpack://', '.');

if (internalUrl) {
Expand Down

0 comments on commit ae457ae

Please sign in to comment.