Skip to content
Permalink
Browse files
tools: remove superfluous regex in tools/doc/json.js
Remove noCallOrProp from tools/doc/json.js. It is a negative lookahead
that is only used in one regex where it is placed immediately before a
terminating $, thus rendering it meaningless.

PR-URL: #33998
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jamie Davis <davisjam@vt.edu>
  • Loading branch information
Trott authored and codebytere committed Jun 27, 2020
1 parent ec07e61 commit 5dca04ee8e460226ba17c9184e04c14dc0e37a9b
Showing with 1 addition and 3 deletions.
  1. +1 −3 tools/doc/json.js
@@ -456,8 +456,6 @@ const maybeAncestors = r`(?:${id}\.?)*`;

const callWithParams = r`\([^)]*\)`;

const noCallOrProp = '(?![.[(])';

const maybeExtends = `(?: +extends +${maybeAncestors}${classId})?`;

/* eslint-disable max-len */
@@ -478,7 +476,7 @@ const headingExpressions = [
`^${maybeBacktick}${maybeAncestors}(${id})${callWithParams}${maybeBacktick}$`, 'i') },

{ type: 'property', re: RegExp(
`^${maybeClassPropertyPrefix}${maybeBacktick}${ancestors}(${id})${maybeBacktick}${noCallOrProp}$`, 'i') },
`^${maybeClassPropertyPrefix}${maybeBacktick}${ancestors}(${id})${maybeBacktick}$`, 'i') },
];
/* eslint-enable max-len */

0 comments on commit 5dca04e

Please sign in to comment.