Skip to content

Commit

Permalink
Test for proper handling of incomplete hex escapes (#1274)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zirak authored and leobalter committed Oct 16, 2017
1 parent 9e3ff9a commit d36a177
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/built-ins/RegExp/incomplete_hex_unicode_escape.js
Original file line number Diff line number Diff line change
@@ -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/");

0 comments on commit d36a177

Please sign in to comment.