Opened on 05/19/2014 at 06:54:10 AM

Closed on 05/19/2014 at 12:05:40 PM

#516 closed defect (fixed)

JSHydra: return {foo:bar} produces broken code

Reported by: trev Assignee: trev
Priority: P3 Milestone:
Module: Automation Keywords:
Cc: Blocked By:
Blocking: #517 Platform:
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

http://codereview.adblockplus.org/6330303089999872

Description

How to reproduce

  1. Add return {foo: 1}; to one of our core modules imported into Adblock Plus for Chrome.
  2. Build Adblock Plus for Chrome.

Observed behaviour

The code is converted to:

return
{
  foo: bar
};

Note the newline after return, the browser will imply a semicolon there - this will be interpreted as a return statement followed by a block. Consequently, the browser will complain about a syntax error (unexpected colon).

Expected behaviour

The opening bracket of the object should be on the same line:

return {
  foo: bar
};

Attachments (0)

Change History (3)

comment:1 Changed on 05/19/2014 at 06:59:24 AM by trev

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed on 05/19/2014 at 07:42:40 AM by trev

  • Blocking 517 added

comment:3 Changed on 05/19/2014 at 12:05:40 PM by trev

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from trev.
 
Note: See TracTickets for help on using tickets.