Skip to content

Error parsing regex that contains // #448

@dichao

Description

@dichao

In the following code, RegEx /\sedg//i will be treated as if this is a commented section://i],
But in fact it is a valid regex and minifier will break the code.

{
test: [/\sedg//i],
describe(ua) {
const browser = {
name: 'Microsoft Edge',
};

  const version = Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, ua);

  if (version) {
    browser.version = version;
  }

  return browser;
},

},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions