Skip to content

Commit 6474d2f

Browse files
author
Brian Vaughn
committed
Replaced regex .exec() with .test()
1 parent 6e98033 commit 6474d2f

File tree

1 file changed

+2
-2
lines changed
  • packages/react-devtools-shared/src/backend

1 file changed

+2
-2
lines changed

packages/react-devtools-shared/src/backend/console.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export function patch(): void {
111111
const lastArg = args.length > 0 ? args[args.length - 1] : null;
112112
const alreadyHasComponentStack =
113113
lastArg !== null &&
114-
(PREFIX_REGEX.exec(lastArg) ||
115-
ROW_COLUMN_NUMBER_REGEX.exec(lastArg));
114+
(PREFIX_REGEX.test(lastArg) ||
115+
ROW_COLUMN_NUMBER_REGEX.test(lastArg));
116116

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

0 commit comments

Comments
 (0)