mirror of
https://github.com/tc39/test262.git
synced 2025-06-28 01:34:42 +02:00
Add invalid non-Unicode test
This commit is contained in:
parent
b0995ea174
commit
3b5845afe7
@ -0,0 +1,55 @@
|
|||||||
|
// Copyright 2020 the Apple Inc. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
author: Michael Saboff
|
||||||
|
description: Invalid exotic named group names in non-Unicode RegExps
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
Valid ID_Continue Unicode characters (Can't be first identifier character.)
|
||||||
|
|
||||||
|
𝟚 \u{1d7da} \ud835 \udfda
|
||||||
|
|
||||||
|
Invalid ID_Start / ID_Continue
|
||||||
|
|
||||||
|
(fox face emoji) 🦊 \u{1f98a} \ud83e \udd8a
|
||||||
|
(dog emoji) 🐕 \u{1f415} \ud83d \udc15
|
||||||
|
*/
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<🦊>fox)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<\u{1f98a}>fox)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<\ud83e\udd8a>fox)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<🐕>dog)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<\u{1f415}>dog)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<\ud83d \udc15>dog)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<𝟚the>the)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<\u{1d7da}the>the)");
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(SyntaxError, function() {
|
||||||
|
return new RegExp("(?<\ud835\udfdathe>the)");
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user