Skip to content

Split output wrong for Node version 6.12.0 when trapping calls to RegExp.prototype.execΒ #17149

@mtorp

Description

@mtorp
  • Version: v6.12.0
  • Platform: 4.10.0-38-generic rename node.js -> io.jsΒ #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:

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.

var orig = RegExp.prototype.exec;

RegExp.prototype.exec = function() {
    return Reflect.apply(orig, this, arguments);
};

var selector = ".hover-yellow:hover";
var r = /(?!^)(?=[.:])/g
console.log(selector.split(r));

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions