mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-23 20:51:12 +08:00
Fix module function name in error overlay (#3012)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user