Repository navigation
Split output wrong for Node version 6.12.0 when trapping calls to RegExp.prototype.exec #17149
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
Description
Activity
- addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
on Nov 20, 2017 I can confirm. It's a more-or-less known bug in the v6.x implementation:
Lines 477 to 488 in c6a2ec5
// TODO(adamk): this fast path is wrong with respect to this.global // and this.sticky, but hopefully the spec will remove those gets // and thus make the assumption of 'exec' having no side-effects // more correct. Also, we doesn't ensure that 'exec' is actually // a data property on RegExp.prototype. var exec; if (IS_REGEXP(this) && constructor === GlobalRegExp) { exec = this.exec; if (exec === RegExpSubclassExecJS) { return %_Call(RegExpSplit, this, string, limit); } }
It's been fixed in newer V8 versions but in a way that can't be back-ported. A fix would have to be written from scratch.works just fine for me ;)
$ node -pe "'.hover-yellow:hover'.split(/(?!^)(?=[.:])/g)" [ '.hover-yellow', ':hover' ]$ node -pe 'process.version'{ http_parser: '2.7.0', node: '10.0.0-pre', v8: '6.4.332-node.0', uv: '1.16.1', zlib: '1.2.11', ares: '1.13.0', modules: '61', nghttp2: '1.25.0', openssl: '1.0.2m', icu: '60.1', unicode: '10.0', cldr: '32.0', tz: '2017c' }@Announcement The original poster wrote that the bug is in version 6.12.0 and was fixed by 7.10.0 at the latest. You're running 10.0.0-pre.
There is no possible way this gets fixed in 6.x at this point. I'm going to close this out. Thanks for the report.
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
The following code snippet produces the output
[ '.hover-yellow:hover' ]using Node version 6.12.0. The expected output is[ '.hover-yellow', ':hover' ]which is also the output produced by for example Node 7.10.0.