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 committed Aug 26, 2017
1 parent 5ea6de9 commit 5c010e0
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 5c010e0

Please sign in to comment.