gkz / LiveScript

LiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
http://livescript.net
MIT License
2.32k stars 156 forks source link

Coffeescript processes one case better #363

Closed askucher closed 11 years ago

askucher commented 11 years ago

It works in coffeescript

$(myImg).Jcrop __trackDocument: true __onSelect: (x) ->

It doesn't work in livescript:

$(myImg).Jcrop( __trackDocument: true __onSelect: (x) -> _____)

Is it ok?

racklin commented 11 years ago

@askucher Hi, you should use do for an implicit object.

$(myImg).Jcrop do
  trackDocument: true
  onSelect: (x) ->
gkz commented 11 years ago

You must use do when calling with an implicit object.

eg.

$ myImg .Jcrop do
    trackDocument: true
    onSelect: (x) ->

PS. Indent code four spaces to preserve formatting.

askucher commented 11 years ago

Thx for quick answer

On Sat, Aug 24, 2013 at 7:31 PM, George Zahariev notifications@github.comwrote:

You must use do when calling with an implicit object.

eg. $ myImg .Jcrop do

trackDocument: true onSelect: (x) ->

PS. Indent code four spaces to preserve formatting.

— Reply to this email directly or view it on GitHubhttps://github.com/gkz/LiveScript/issues/363#issuecomment-23211808 .