Line breaks in array literals

31 views
Skip to first unread message

Andreas Hartmann

unread,
Dec 16, 2012, 6:54:18 AM12/16/12
to roy...@googlegroups.com
Hi everybody,

is it possible to insert line breaks in array literals?

Motivation: I'm using Roy with Dojo AMD, and the module imports can get quite long.
Example:

define ['dojo/_base/xhr', 'dojo/on', 'dojo/dom', 'dojo/dom-construct', "dojo/_base/array"] (\xhr on dom domConstruct array ->
  …

Or is there a better way to express this construct in Roy?

TIA for any advice!

Brian McKenna

unread,
Dec 23, 2012, 2:18:49 AM12/23/12
to roy...@googlegroups.com
Should now be possible in master:

define [
'dojo/_base/xhr',
'dojo/on',
'dojo/dom',
'dojo/dom-construct',
'dojo/_base/array'
] (\xhr on dom domConstruct array ->
...
)

Andreas Hartmann

unread,
Jan 7, 2013, 4:29:18 AM1/7/13
to roy...@googlegroups.com
It works, thanks a lot!

For the record, putting the closing bracket at the end of the last line doesn't compile, but this is not important at the moment:

define [
 'a',
 'b',
 'c'] (\a b c ->

results in

Compilation error: Parse error on line 4: Unexpected ']'

-- Andreas
Reply all
Reply to author
Forward
0 new messages