From 5dca04ee8e460226ba17c9184e04c14dc0e37a9b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 20 Jun 2020 21:13:35 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/33998 Reviewed-By: Luigi Pinca Reviewed-By: Jamie Davis --- tools/doc/json.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/doc/json.js b/tools/doc/json.js index 66e07b3512befb..bcba923d907fb2 100644 --- a/tools/doc/json.js +++ b/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 */