From e73054f75e08e329e73e0f77bf92503ad5b83d0f Mon Sep 17 00:00:00 2001 From: akluball <35855437+akluball@users.noreply.github.com> Date: Wed, 5 Aug 2020 15:27:34 -0400 Subject: [PATCH] Add tests for ZWJ and ZWNJ in identifiers (#2723) --- .../identifiers/part-zwj-zwnj-escaped.js | 16 ++++++++++++++++ test/language/identifiers/start-zwj-escaped.js | 15 +++++++++++++++ test/language/identifiers/start-zwnj-escaped.js | 15 +++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 test/language/identifiers/part-zwj-zwnj-escaped.js create mode 100644 test/language/identifiers/start-zwj-escaped.js create mode 100644 test/language/identifiers/start-zwnj-escaped.js diff --git a/test/language/identifiers/part-zwj-zwnj-escaped.js b/test/language/identifiers/part-zwj-zwnj-escaped.js new file mode 100644 index 0000000000..934b311ba7 --- /dev/null +++ b/test/language/identifiers/part-zwj-zwnj-escaped.js @@ -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); diff --git a/test/language/identifiers/start-zwj-escaped.js b/test/language/identifiers/start-zwj-escaped.js new file mode 100644 index 0000000000..a677eddcf0 --- /dev/null +++ b/test/language/identifiers/start-zwj-escaped.js @@ -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; diff --git a/test/language/identifiers/start-zwnj-escaped.js b/test/language/identifiers/start-zwnj-escaped.js new file mode 100644 index 0000000000..ae8c920899 --- /dev/null +++ b/test/language/identifiers/start-zwnj-escaped.js @@ -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;