From 92ce940ec32b6af792ec6b5f4b8cd81080868307 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 12 Aug 2018 00:24:56 +0100 Subject: [PATCH] JavaScriptMinifier: Add test case for another line-break bug Discovered by adding a test case that uses file_get_contents() to pass jquery.js, and then scan the PHPUnit output for an entry containing `return` by itself on a line where the next line is isn't `;` - then reducing it to a test case as small as possible. This was reduced from the definition of jQuery.event.addProp. Bug: T201606 Change-Id: I1f907436c32630102e60e3ded7092dbeb9669fe8 --- .../includes/libs/JavaScriptMinifierTest.php | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index ce8bb06abc..16048bf433 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -261,6 +261,7 @@ class JavaScriptMinifierTest extends PHPUnit\Framework\TestCase { [ // Regression test for T201606. // Must not break between 'return' and Expression. + // Was caused by bad state after '{}' in property value. <<