Skip to content

Commit

Permalink
Replaced regex .exec() with .test()
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Apr 21, 2020
1 parent 6e98033 commit 6474d2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-devtools-shared/src/backend/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ export function patch(): void {
const lastArg = args.length > 0 ? args[args.length - 1] : null;
const alreadyHasComponentStack =
lastArg !== null &&
(PREFIX_REGEX.exec(lastArg) ||
ROW_COLUMN_NUMBER_REGEX.exec(lastArg));
(PREFIX_REGEX.test(lastArg) ||
ROW_COLUMN_NUMBER_REGEX.test(lastArg));

if (!alreadyHasComponentStack) {
// If there's a component stack for at least one of the injected renderers, append it.
Expand Down

0 comments on commit 6474d2f

Please sign in to comment.