coffee-script icon indicating copy to clipboard operation
coffee-script copied to clipboard

Class.name is readonly in strict mode

Open yyfearth opened this issue 13 years ago • 5 comments

in iced-coffee-script, class Class will be compiled into:

var Class;
Class = (function() {
  Class.name = 'Class';
  function Class() {}
  return Class;
})();

in strict mode while add "use strict"; in front Class.name = 'Class'; thow exception because class.name is readonly

and i look at current verion of coffee-script it will not add Class.name = 'Class';:

var Class;
Class = (function() {
  function Class() {}
  return Class;
})();

yyfearth avatar Feb 25 '12 13:02 yyfearth

Iced is a fork of github coffeescript, so besides await and defer, it has the same features github coffee has.

So this is a jashkenas/coffee-script issue, not iced's.

paulmillr avatar Feb 25 '12 13:02 paulmillr

I created a bug for this: #2139 in original repo.

paulmillr avatar Feb 25 '12 13:02 paulmillr

i tried current released version 1.2.0 of original coffeescript do not have these 2 issues. so why? diff branch?

yyfearth avatar Feb 25 '12 13:02 yyfearth

1.2.0 is npm version of coffeescript.

The next major release is 1.3.0 which is been in development for two months and iced is using it. It was not yet released on npm.

paulmillr avatar Feb 25 '12 13:02 paulmillr

got it thx

yyfearth avatar Feb 25 '12 13:02 yyfearth