google-code-export / esprima

Automatically exported from code.google.com/p/esprima
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Esprima no longer errors on unicode escapes in regex flags #604

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. esprima.parse("/hello/\u0067")

What is the expected output?
This should be an error. Unicode escapes are forbidden in regex flags (see 
11.8.5.1 
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-regular-expre
ssion-literals-static-semantics-early-errors)

What do you see instead?
esprima.parse("/hello/\u0067").body[0].expression
Object {type: "Literal", value: /hello/g, raw: "/hello/g", regex: Object}

What version of the product are you using? On what operating system? Which
browser? I was using the https://github.com/facebook/esprima fork of esprima on 
Chrome 38.0.2125.101 on mac OSX

Please provide any additional information below.

This bug probably blames to 
https://github.com/facebook/esprima/commit/e6e83f07968e386c33cf291f05fff001ac902
9ef

Original issue reported on code.google.com by GabeL...@gmail.com on 10 Oct 2014 at 1:24

GoogleCodeExporter commented 9 years ago
This is essentially issue 503. It is resolved by porting the fix to the harmony 
branch.

Original comment by ariya.hi...@gmail.com on 13 Jan 2015 at 4:15