From 854678a83ab0687971b19761df365909b5db9e28 Mon Sep 17 00:00:00 2001 From: fisker Date: Tue, 1 Sep 2020 14:50:56 +0800 Subject: [PATCH] Test `in` https://github.com/babel/babel/pull/11931 --- tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap | 9 +++++++++ tests/misc/errors/js/no-for-in-init-concise-binary-in.js | 3 +++ 2 files changed, 12 insertions(+) create mode 100644 tests/misc/errors/js/no-for-in-init-concise-binary-in.js diff --git a/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap index d5b7068fa497..02535f581236 100644 --- a/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/js/__snapshots__/jsfmt.spec.js.snap @@ -18,6 +18,15 @@ exports[`module-attributes.js error test 1`] = ` 2 | " `; +exports[`no-for-in-init-concise-binary-in.js error test 1`] = ` +"Unexpected token, expected \\")\\" (3:18) + 1 | // https://github.com/babel/babel/pull/11931 + 2 | +> 3 | for (() => x in y;;); + | ^ + 4 | " +`; + exports[`partial-template-strings.js error test 1`] = ` "Unexpected token (6:42) 4 | diff --git a/tests/misc/errors/js/no-for-in-init-concise-binary-in.js b/tests/misc/errors/js/no-for-in-init-concise-binary-in.js new file mode 100644 index 000000000000..a5ede557702f --- /dev/null +++ b/tests/misc/errors/js/no-for-in-init-concise-binary-in.js @@ -0,0 +1,3 @@ +// https://github.com/babel/babel/pull/11931 + +for (() => x in y;;);