RFR: 8027302: Identifiers containing unicode escapes are not recognized as reserved words

Hannes Wallnöfer hannes.wallnoefer at oracle.com
Fri Oct 13 14:19:52 UTC 2017


Am 13.10.2017 um 14:35 schrieb Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com>:
> 
> 
>  36 } catch (e if e instanceof SyntaxError) {
>  37     Assert.assertTrue(e instanceof SyntaxError);
>  38 }
>  39
> 
> In test. Do you want to just catch catch(e) ?
> 

Indeed. I forgot I left this in. Thanks for the review!

Hannes

> -Sundar
> 
> On 13/10/17, 2:06 PM, Hannes Wallnöfer wrote:
>> Please review:
>> 
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8027302
>> Webrev: http://cr.openjdk.java.net/~hannesw/8027302/webrev.01
>> 
>> ES6 and ES5 require different handling regarding unencoding Unicode escapes in keywords and identifiers. This patch makes handling more compliant and more efficient in ES6 mode (previously we didn’t cover all cases, and checked every identifier instead of just those containing escapes).
>> 
>> About the removal of Lexer.isEscapeCharacter: this method always returns true in Lexer, and it’s only purpose was to be overridden in JSON parser, but JSON parser doesn’t extend Lexer/Parser anymore.
>> 
>> Thanks,
>> Hannes



More information about the nashorn-dev mailing list