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
[
// Regression test for T201606.
// Must not break between 'return' and Expression.
+ // Was caused by bad state after '{}' in property value.
<<<JAVASCRIPT
call( function () {
try {
')',
';',
]
- ]
+ ],
+ [
+ // Regression test for T201606.
+ // Must not break between 'return' and Expression.
+ // FIXME: Cause?
+ <<<JAVASCRIPT
+call( {
+ key: 1 ? 0 : function () {
+ return this;
+ }
+} );
+JAVASCRIPT
+ ,
+ [
+ 'call',
+ '(',
+ '{',
+ 'key',
+ ':',
+ '1',
+ '?',
+ '0',
+ ':',
+ 'function',
+ '(',
+ ')',
+ '{',
+ 'return', 'this', // FIXME
+ ';',
+ '}',
+ '}',
+ ')',
+ ';',
+ ]
+ ],
];
}