Skip to content
Snippets Groups Projects
Commit c7ac073e authored by Mathias Bynens's avatar Mathias Bynens Committed by Leo Balter
Browse files
parent 23925f86
No related branches found
No related tags found
No related merge requests found
Showing
with 355 additions and 12 deletions
// Copyright 2017 Mathias Bynens. All rights reserved.
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
......@@ -7,15 +7,12 @@ description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
assert.throws.early(SyntaxError, "/\\p{ASCII=Yes}/u");
assert.throws.early(SyntaxError, "/\\p{ASCII=Y}/u");
assert.throws.early(SyntaxError, "/\\p{ASCII=T}/u");
throw "Test262: This statement should not be evaluated.";
assert.throws.early(SyntaxError, "/\\P{ASCII=No}/u");
assert.throws.early(SyntaxError, "/\\P{ASCII=N}/u");
assert.throws.early(SyntaxError, "/\\P{ASCII=F}/u");
assert.throws.early(SyntaxError, "/\\p{ASCII=Invalid}/u");
/\P{ASCII=F}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=F}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{ASCII=Invalid}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=Invalid}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{ASCII=N}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=N}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{ASCII=No}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=No}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{ASCII=T}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=T}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{ASCII=Y}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=Y}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{ASCII=Yes}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Binary properties with an explicit value must throw in Unicode property
escapes (even if the value is valid).
esid: sec-static-semantics-unicodematchproperty-p
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\p{ASCII=Yes}/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
NonemptyClassRanges :: ClassAtom - ClassAtom ClassRanges
It is a Syntax Error if IsCharacterClass of the first ClassAtom is
true or IsCharacterClass of the second ClassAtom is true.
esid: sec-patterns-static-semantics-early-errors
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/[--\p{Hex}]/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
NonemptyClassRangesNoDash :: ClassAtomNoDash - ClassAtom ClassRanges
It is a Syntax Error if IsCharacterClass of ClassAtomNoDash is true or
IsCharacterClass of ClassAtom is true.
esid: sec-patterns-static-semantics-early-errors
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/[\uFFFF-\p{Hex}]/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
NonemptyClassRangesNoDash :: ClassAtomNoDash - ClassAtom ClassRanges
It is a Syntax Error if IsCharacterClass of ClassAtomNoDash is true or
IsCharacterClass of ClassAtom is true.
esid: sec-patterns-static-semantics-early-errors
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/[\p{Hex}-\uFFFF]/u;
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
NonemptyClassRanges :: ClassAtom - ClassAtom ClassRanges
It is a Syntax Error if IsCharacterClass of the first ClassAtom is
true or IsCharacterClass of the second ClassAtom is true.
esid: sec-patterns-static-semantics-early-errors
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/[\p{Hex}--]/u;
// Copyright 2017 Mathias Bynens. All rights reserved.
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
......@@ -10,17 +10,7 @@ features: [regexp-unicode-property-escapes]
---*/
/[\p{Hex}]/u;
assert.throws(
SyntaxError,
() => /[\p{Hex}-\uFFFF]/u,
// See step 1 of https://tc39.github.io/ecma262/#sec-runtime-semantics-characterrange-abstract-operation.
'property escape at start of character class range should throw if it expands to multiple characters'
);
assert.throws.early(SyntaxError, "/[\\p{}]/u");
assert.throws.early(SyntaxError, "/[\\p{invalid}]/u");
assert.throws.early(SyntaxError, "/[\\p{]/u");
assert.throws.early(SyntaxError, "/[\\p{]}/u");
assert.throws.early(SyntaxError, "/[\\p}]/u");
assert(
/[\p{Hex}\P{Hex}]/u.test('\u{1D306}'),
'multiple property escapes in a single character class should be supported'
......
// Copyright 2018 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
This tests violations of the grammar starting here:
CharacterClassEscape[U]::
[+U] p{ UnicodePropertyValueExpression }
[+U] P{ UnicodePropertyValueExpression }
esid: prod-CharacterClassEscape
negative:
phase: parse
type: SyntaxError
features: [regexp-unicode-property-escapes]
---*/
throw "Test262: This statement should not be evaluated.";
/\P{InAdlam}/u;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment