Skip to content

Commit

Permalink
tools: remove superfluous regex in tools/doc/json.js
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Jamie Davis <[email protected]>
  • Loading branch information
Trott authored and codebytere committed Jul 12, 2020
1 parent ee36c87 commit 2e38f0d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/doc/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ const maybeAncestors = r`(?:${id}\.?)*`;

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

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

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

/* eslint-disable max-len */
Expand All @@ -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 */

Expand Down

0 comments on commit 2e38f0d

Please sign in to comment.