Closed Bug 1476622 Opened Last year Closed Last year

Inconsistent output compared with other JS engines when handling regular expression

Categories

(Core :: JavaScript Engine, defect)

63 Branch
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 1361876

People

(Reporter: sunlili, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Steps to reproduce:

Execute following code:

function use_space_then_do_test(depth) {                                                                                                         
  try {
    // The "+ depth" is to avoid the regexp compilation cache.
    var regexp_src = repeat(".(.)", 12) + depth;
    /a[\P{Any}]a/u.exec('a\uD83Da');
    return true;
  } catch (e) {
    //assertFalse(("" + e).indexOf("tack") == -1);  // Check for [Ss]tack.
    return false;
  }
}
use_space_then_do_test(100);


Actual results:

SyntaxError: invalid identity escape in regular expression:
a[\P{Any}]a
...^
Other engines output nothing.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: Last year
Resolution: --- → DUPLICATE
Duplicate of bug: 1361876
You need to log in before you can comment on or make changes to this bug.