Skip to content

Block Comments Generate Anonymous Functions #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
STRd6 opened this issue May 23, 2011 · 3 comments
Closed

Block Comments Generate Anonymous Functions #1386

STRd6 opened this issue May 23, 2011 · 3 comments

Comments

@STRd6
Copy link
Contributor

STRd6 commented May 23, 2011

This CoffeeScript

self = Core(I).extend
  ###*
  A Block Comment
  ###
  key: val

  ###
  Huh? These are functions?
  ###
  key2: ->
    test

Generates the following JavaScript:

var self;
self = Core(I).extend((function() {
  /**
  A Block Comment
  */
})(), {
  key: val
}, (function() {
  /*
  Huh? These are functions?
      */
})(), {
  key2: function() {
    return test;
  }
});

It should instead generate something more like this:

var self;
self = Core(I).extend({      /**
  Huh?
  */
  key: val,
  /*
  Huh? These are functions?
      */
  key2: function() {
    return test;
  }
});

So instead of passing a single object as the sole parameter to Core(I).extend it passes 4 arguments, undefined for each comment, and an object for each key.

This previously worked in 0.9.4, but is now broken in 1.1.1

@tysonmote
Copy link

Dupe: #1322

@michaelficarra
Copy link
Collaborator

@tysontate: thanks for the link, closing

@GeoffreyBooth
Copy link
Collaborator

After #4572, the original example becomes:

var self;

self = Core(I).extend({
  /**
  A Block Comment
  */
  key: val,
  /*
  Huh? These are functions?
  */
  key2: function() {
    return test;
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants