alexo / wro4j

New project location is:https://github.com/wro4j/wro4j
442 stars 110 forks source link

Very old (1.4.0) Coffeescript version #148

Closed genuinefafa closed 10 years ago

genuinefafa commented 11 years ago

I read the coffeescript page and choose a part of .coffee in order to try wro4j behavior. http://coffeescript.org/

I'm using this WroConfig

/** PreProcessor used by wro4j.grails.plugin.GrailsWroManagerFactory  */
wro.grailsWroManagerFactory.preProcessors = [
    new CssUrlRewritingProcessor(),
    new CssImportPreProcessor(),
    new SemicolonAppenderPreProcessor(),
    new JSMinProcessor(),
    new JawrCssMinifierProcessor(),
    new CoffeeScriptProcessor()
]

/** postProcessor used by wro4j.grails.plugin.GrailsWroManagerFactory  */
wro.grailsWroManagerFactory.postProcessors = [
    new CssVariablesProcessor(),
    new LessCssProcessor()
]

And I took this example from the coffeescript site,

# Assignment:
number   = 42
opposite = true

# Conditions:
number = -42 if opposite

# Functions:
square = (x) -> x * x

# Arrays:
list = [1, 2, 3, 4, 5]

# Objects:
math =
    root:   Math.sqrt
    square: square
    cube:   (x) -> x * square x

# Splats:
race = (winner, runners...) ->
    print winner, runners

# Existence:
alert "I knew it!" if elvis?

# Array comprehensions:
cubes = (math.cube num for num in list)

But I'm getting this

// Generated by CoffeeScript 1.4.0
(function() {
  var opposite;

  opposite = false;

  ({
    square: square,
    cube: function(x) {
      return x * square(x);
    }
  });

}).call(this);

I should be getting

var cubes, list, math, num, number, opposite, race, square,
  __slice = [].slice;

number = 42;

opposite = true;

if (opposite) {
  number = -42;
}

square = function(x) {
  return x * x;
};

list = [1, 2, 3, 4, 5];

math = {
  root: Math.sqrt,
  square: square,
  cube: function(x) {
    return x * square(x);
  }
};

race = function() {
  var runners, winner;
  winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
  return print(winner, runners);
};

if (typeof elvis !== "undefined" && elvis !== null) {
  alert("I knew it!");
}

cubes = (function() {
  var _i, _len, _results;
  _results = [];
  for (_i = 0, _len = list.length; _i < _len; _i++) {
    num = list[_i];
    _results.push(math.cube(num));
  }
  return _results;
})();

I'm guessing there is an older version of coffeescript (1.4.0) somewhere, but I cannot find where. Latest version is 1.6.3.

alexo commented 10 years ago

Closing this issue, since latest version of wro4j, uses coffee-script-1.6.3 (provided by webjar).

genuinefafa commented 10 years ago

Excellent. Thanks.

On 26/01/2014, at 12:55, Alex Objelean notifications@github.com wrote:

Closing this issue, since latest version of wro4j, uses coffee-script-1.6.3 (provided by webjar).

— Reply to this email directly or view it on GitHub.