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): | |||
Description
How to reproduce
- Add return {foo: 1}; to one of our core modules imported into Adblock Plus for Chrome.
- 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
Note: See
TracTickets for help on using
tickets.

Fixed: https://hg.adblockplus.org/jshydra/rev/5620200c91ff