From a540cbe8016b1f86d8b9106a40e892893e5dde1c Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Thu, 30 Apr 2015 05:06:56 -0700 Subject: [PATCH] Failing test with return not on the same line as it's expression Note that this is not a parenthesis issue but this was the easiest way to reproduce it. I ran into it when testing generators with `retainLines` and the generated `return` statement (replacing yeild) was printed on the line preceding the expression being yielded. --- .../edgecase/return-with-retainlines-option/actual.js | 5 +++++ .../edgecase/return-with-retainlines-option/expected.js | 2 ++ .../edgecase/return-with-retainlines-option/options.json | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 test/core/fixtures/generation/edgecase/return-with-retainlines-option/actual.js create mode 100644 test/core/fixtures/generation/edgecase/return-with-retainlines-option/expected.js create mode 100644 test/core/fixtures/generation/edgecase/return-with-retainlines-option/options.json diff --git a/test/core/fixtures/generation/edgecase/return-with-retainlines-option/actual.js b/test/core/fixtures/generation/edgecase/return-with-retainlines-option/actual.js new file mode 100644 index 0000000000..66e5d50920 --- /dev/null +++ b/test/core/fixtures/generation/edgecase/return-with-retainlines-option/actual.js @@ -0,0 +1,5 @@ +function foo(l) { + return ( + l + ); +} diff --git a/test/core/fixtures/generation/edgecase/return-with-retainlines-option/expected.js b/test/core/fixtures/generation/edgecase/return-with-retainlines-option/expected.js new file mode 100644 index 0000000000..ccb44de809 --- /dev/null +++ b/test/core/fixtures/generation/edgecase/return-with-retainlines-option/expected.js @@ -0,0 +1,2 @@ +function foo(l) { + return l;} diff --git a/test/core/fixtures/generation/edgecase/return-with-retainlines-option/options.json b/test/core/fixtures/generation/edgecase/return-with-retainlines-option/options.json new file mode 100644 index 0000000000..97925bbcb6 --- /dev/null +++ b/test/core/fixtures/generation/edgecase/return-with-retainlines-option/options.json @@ -0,0 +1,3 @@ +{ + "retainLines": true +}