Add tests for ZWJ and ZWNJ in identifiers (#2723)

This commit is contained in:
akluball 2020-08-05 15:27:34 -04:00 committed by GitHub
parent 5f99d05c6a
commit e73054f75e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// Copyright (C) 2020 Adam Kluball. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Adam Kluball
esid: sec-names-and-keywords
description: zero width joiner and zero width non-joiner are valid identifier parts
---*/
var $ = 1;
var $\u200D = 2;
var $\u200C = 3;
assert.sameValue($, 1);
assert.sameValue($\u200D, 2);
assert.sameValue($\u200C, 3);

View File

@ -0,0 +1,15 @@
// Copyright (C) 2020 Adam Kluball. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Adam Kluball
esid: sec-names-and-keywords
description: zero width joiner is not a valid identifier start
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
var \u200D;

View File

@ -0,0 +1,15 @@
// Copyright (C) 2020 Adam Kluball. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Adam Kluball
esid: sec-names-and-keywords
description: zero width non-joiner is not a valid identifier start
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
var \u200C;