node-semver icon indicating copy to clipboard operation
node-semver copied to clipboard

[BUG?] possible issues in internal/re.js

Open pygy opened this issue 5 years ago • 1 comments

What / Why

I've been porting internal/re.js to compose-regexp, for personal use as a vendored-in dep, because raw regexp concatenation hurts my eyes, and I've found a couple of things that strike me as possible bugs, around L73-L87... namely:

  • BUILD is supposed not to capture according to the comment, but it does capture its content.
  • the v? prefix in FULLPLAIN is different from those in LOOSEPLAIN and XRANGEPLAIN(LOOSE)? ([v=\\s]*).

Who

  • @isaacs

pygy avatar Dec 31 '19 00:12 pygy

BUILD is supposed not to capture according to the comment, but it does capture its content.

Ah, yes, that is an outdated and incorrect comment.

the v? prefix in FULLPLAIN is different from those in LOOSEPLAIN and XRANGEPLAIN(LOOSE)? ([v=\s]*).

I think that's because v1.2.3 or =1.2.3 is a valid version in loose mode but not in strict mode. But v1.x is always a valid range, loose or not.

isaacs avatar Dec 31 '19 19:12 isaacs