Test for proper handling of incomplete hex escapes (#1274)

See relevant firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1408452
This commit is contained in:
Zirak 2017-10-16 20:04:51 +03:00 committed by Leo Balter
parent 9e3ff9a232
commit d36a1777b4
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// Copyright (C) 2015 Zirak. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: An incomplete HexEscape or UnicodeEscape should be treated as an Identity Escape
info: >
An incomplete HexEscape (e.g. /\x/) or UnicodeEscape (/\u/) should fall
through to IdentityEscape
esid: prod-AtomEscape
---*/
// Hex escape
assert(/\x/.test("x"), "/\\x/");
assert(/\xa/.test("xa"), "/\\xa/");
// Unicode escape
assert(/\u/.test("u"), "/\\u/");
assert(/\ua/.test("ua"), "/\\ua/");