mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
trace-tab
This commit is contained in:
parent
d099ed4809
commit
9321b91552
|
@ -1,6 +1,6 @@
|
|||
import StackFrame from './react-error-overlay/utils/stack-frame';
|
||||
|
||||
const isFF = navigator.userAgent.indexOf('Firefox') !== -1;
|
||||
const isFF = navigator.userAgent.includes('Firefox');
|
||||
|
||||
function openResource(
|
||||
fileName: string,
|
||||
|
|
|
@ -76,7 +76,7 @@ class StackFrame extends Component<Props, State> {
|
|||
return null;
|
||||
}
|
||||
// e.g. "/path-to-my-app/webpack/bootstrap eaddeb46b67d75e4dfc1"
|
||||
const isInternalWebpackBootstrapCode = fileName.trim().indexOf(' ') !== -1;
|
||||
const isInternalWebpackBootstrapCode = fileName.trim().includes(' ');
|
||||
if (isInternalWebpackBootstrapCode) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ function StackFrameCodeBlock(props: StackFrameCodeBlockPropsType) {
|
|||
if (text == null) {
|
||||
continue;
|
||||
}
|
||||
if (text.indexOf(` ${lineNum} |`) === -1) {
|
||||
if (!text.includes(` ${lineNum} |`)) {
|
||||
continue;
|
||||
}
|
||||
// $FlowFixMe
|
||||
|
|
|
@ -88,7 +88,9 @@ export function extractSourceMapUrl(
|
|||
match = next;
|
||||
}
|
||||
if (!(match && match[1])) {
|
||||
return Promise.reject(`Cannot find a source map directive for ${fileUri}.`);
|
||||
return Promise.reject(
|
||||
new Error(`Cannot find a source map directive for ${fileUri}.`),
|
||||
);
|
||||
}
|
||||
return Promise.resolve(match[1].toString());
|
||||
}
|
||||
|
|
|
@ -51,8 +51,7 @@ function getStackFrames(
|
|||
return enhancedFrames.filter(
|
||||
({ functionName, fileName }) =>
|
||||
(functionName == null ||
|
||||
functionName.indexOf('__stack_frame_overlay_proxy_console__') ===
|
||||
-1) &&
|
||||
!functionName.includes('__stack_frame_overlay_proxy_console__')) &&
|
||||
!toExclude.test(fileName!),
|
||||
);
|
||||
});
|
||||
|
|
|
@ -12,9 +12,9 @@ function isInternalFile(
|
|||
return (
|
||||
sourceFileName == null ||
|
||||
sourceFileName === '' ||
|
||||
sourceFileName.indexOf('/~/') !== -1 ||
|
||||
sourceFileName.indexOf('/node_modules/') !== -1 ||
|
||||
sourceFileName.trim().indexOf(' ') !== -1 ||
|
||||
sourceFileName.includes('/~/') ||
|
||||
sourceFileName.includes('/node_modules/') ||
|
||||
sourceFileName.trim().includes(' ') ||
|
||||
fileName == null ||
|
||||
fileName === ''
|
||||
);
|
||||
|
|
|
@ -30,7 +30,7 @@ async function map(
|
|||
if (fileName == null) {
|
||||
return;
|
||||
}
|
||||
if (files.indexOf(fileName) !== -1) {
|
||||
if (files.includes(fileName)) {
|
||||
return;
|
||||
}
|
||||
files.push(fileName);
|
||||
|
|
|
@ -50,10 +50,10 @@ function parseStack(stack: string[]): StackFrame[] {
|
|||
);
|
||||
} else {
|
||||
// Strip eval, we don't care about it
|
||||
if (e.indexOf('(eval ') !== -1) {
|
||||
if (e.includes('(eval ')) {
|
||||
e = e.replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
|
||||
}
|
||||
if (e.indexOf('(at ') !== -1) {
|
||||
if (e.includes('(at ')) {
|
||||
e = e.replace(/\(at /, '(');
|
||||
}
|
||||
const data = e.trim().split(/\s+/g).slice(1);
|
||||
|
|
Loading…
Reference in New Issue
Block a user