From 87e86669c399b9ec87292d95eda3cc0b71b9726c Mon Sep 17 00:00:00 2001
From: Leo Balter <leonardo.balter@gmail.com>
Date: Mon, 26 Nov 2018 18:01:12 -0500
Subject: [PATCH] Add tests for private method/fields unnescapable token

---
 ...e-async-generator-cannot-escape-token.case | 16 +++++++++++++
 ...vate-async-method-cannot-escape-token.case | 16 +++++++++++++
 .../private-call-exp-cannot-escape-token.case | 24 +++++++++++++++++++
 .../private-field-cannot-escape-token.case    | 16 +++++++++++++
 ...private-generator-cannot-escape-token.case | 16 +++++++++++++
 ...rivate-member-exp-cannot-escape-token.case | 24 +++++++++++++++++++
 .../private-method-cannot-escape-token.case   | 16 +++++++++++++
 7 files changed, 128 insertions(+)
 create mode 100644 src/class-elements/private-async-generator-cannot-escape-token.case
 create mode 100644 src/class-elements/private-async-method-cannot-escape-token.case
 create mode 100644 src/class-elements/private-call-exp-cannot-escape-token.case
 create mode 100644 src/class-elements/private-field-cannot-escape-token.case
 create mode 100644 src/class-elements/private-generator-cannot-escape-token.case
 create mode 100644 src/class-elements/private-member-exp-cannot-escape-token.case
 create mode 100644 src/class-elements/private-method-cannot-escape-token.case

diff --git a/src/class-elements/private-async-generator-cannot-escape-token.case b/src/class-elements/private-async-generator-cannot-escape-token.case
new file mode 100644
index 0000000000..01ba09697f
--- /dev/null
+++ b/src/class-elements/private-async-generator-cannot-escape-token.case
@@ -0,0 +1,16 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private async generator cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName::
+    # IdentifierName
+
+  U+0023 is the escape sequence for #
+features: [class-methods-private, async-iteration]
+---*/
+
+//- elements
+async * \u0023m() { return 42; }
diff --git a/src/class-elements/private-async-method-cannot-escape-token.case b/src/class-elements/private-async-method-cannot-escape-token.case
new file mode 100644
index 0000000000..de2b706749
--- /dev/null
+++ b/src/class-elements/private-async-method-cannot-escape-token.case
@@ -0,0 +1,16 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private async method cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName::
+    # IdentifierName
+
+  U+0023 is the escape sequence for #
+features: [class-methods-private, async-functions]
+---*/
+
+//- elements
+async \u0023m() { return 42; }
diff --git a/src/class-elements/private-call-exp-cannot-escape-token.case b/src/class-elements/private-call-exp-cannot-escape-token.case
new file mode 100644
index 0000000000..a14f23c68f
--- /dev/null
+++ b/src/class-elements/private-call-exp-cannot-escape-token.case
@@ -0,0 +1,24 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private reference cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName ::
+    # IdentifierName
+
+  MemberExpression :
+    MemberExpression . PrivateName
+
+  CallExpression :
+    CallExpression . PrivateName
+
+  U+0023 is the escape sequence for #
+features: [class-fields-private]
+---*/
+
+//- elements
+method() {
+  foo().\u0023field;
+}
diff --git a/src/class-elements/private-field-cannot-escape-token.case b/src/class-elements/private-field-cannot-escape-token.case
new file mode 100644
index 0000000000..21da52f41b
--- /dev/null
+++ b/src/class-elements/private-field-cannot-escape-token.case
@@ -0,0 +1,16 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private field cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName::
+    # IdentifierName
+
+  U+0023 is the escape sequence for #
+features: [class-fields-private]
+---*/
+
+//- elements
+\u0023field;
diff --git a/src/class-elements/private-generator-cannot-escape-token.case b/src/class-elements/private-generator-cannot-escape-token.case
new file mode 100644
index 0000000000..a3465976d7
--- /dev/null
+++ b/src/class-elements/private-generator-cannot-escape-token.case
@@ -0,0 +1,16 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private generator cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName::
+    # IdentifierName
+
+  U+0023 is the escape sequence for #
+features: [class-methods-private, generators]
+---*/
+
+//- elements
+* \u0023m() { return 42; }
diff --git a/src/class-elements/private-member-exp-cannot-escape-token.case b/src/class-elements/private-member-exp-cannot-escape-token.case
new file mode 100644
index 0000000000..6a9748824b
--- /dev/null
+++ b/src/class-elements/private-member-exp-cannot-escape-token.case
@@ -0,0 +1,24 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private reference cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName ::
+    # IdentifierName
+
+  MemberExpression :
+    MemberExpression . PrivateName
+
+  CallExpression :
+    CallExpression . PrivateName
+
+  U+0023 is the escape sequence for #
+features: [class-fields-private]
+---*/
+
+//- elements
+method() {
+  this.\u0023field;
+}
diff --git a/src/class-elements/private-method-cannot-escape-token.case b/src/class-elements/private-method-cannot-escape-token.case
new file mode 100644
index 0000000000..44a5d7e761
--- /dev/null
+++ b/src/class-elements/private-method-cannot-escape-token.case
@@ -0,0 +1,16 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+desc: The pound signal in the private method cannot be escaped
+template: syntax/invalid
+info: |
+  PrivateName::
+    # IdentifierName
+
+  U+0023 is the escape sequence for #
+features: [class-methods-private]
+---*/
+
+//- elements
+\u0023m() { return 42; }
-- 
GitLab