Skip to content
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

string concatenation results invalid javascript if space is omitted #2754

Closed
edokan opened this issue Mar 2, 2013 · 1 comment
Closed

string concatenation results invalid javascript if space is omitted #2754

edokan opened this issue Mar 2, 2013 · 1 comment

Comments

@edokan
Copy link

edokan commented Mar 2, 2013

following code

class test
  @test_id: 'menemen'

  menemen: ->
    a = @test_id +''

produces following output

var test;
test = (function() {
  function test() {}
  test.test_id = 'menemen';
  test.prototype.menemen = function() {
    var a;
    return a = this.test_id(+'');
  };
  return test;
})();

if you look at the line return a = this.test_id(+''), you will see the problem. it is caused by missing space between + and ''. if i try @test_id(space)+(space)'' or @test_id+'' it works fine.

@vendethiel
Copy link
Collaborator

Most recent dup : #2703. Explanations are in

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

3 participants