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

super inconstistencies #193

Closed
vendethiel opened this issue Dec 6, 2012 · 3 comments
Closed

super inconstistencies #193

vendethiel opened this issue Dec 6, 2012 · 3 comments
Labels

Comments

@vendethiel
Copy link
Contributor

class A
  b: -> super ...
  "c": -> super ...
  "#d": -> super ...

I think this is by "design" (is that "inconsistency by design" ?), because IIRC this was the reason dynamic keys were removed from coffee
Still, I think #d": -> super ... should compile to

  prototype["" + d] = function(){
    return superclass.prototype["" + d].apply(this, arguments);
  };

or maybe ?

  key$ = "" + d;
  prototype[key$] = function(){
    return superclass.prototype["" + key$].apply(this, arguments);
  };

Is there a special reason for this ? Is something relying on this ?

@satyr
Copy link
Owner

satyr commented Dec 7, 2012

Is there a special reason for this ?

Lazy me not feeling like implementing caching, is all. Patches welcome.

IIRC this was the reason dynamic keys were removed from coffee

The real reason was more like distaste for general complexity. Coffee doesn't properly handle dynamic cases nonetheless:

$ coffee -bce 'A[f()] = -> super'
TypeError: Cannot read property 'name' of null
    at Scope.exports.Scope.Scope.namedMethod (/usr/local/lib/coffee-script/lib/cof

@vendethiel
Copy link
Contributor Author

I'd gladly do that if I had any understanding of coco's interns.
I thought that it was from this: but I don't know how to cache it. Should this be done in the Obj class ?

      while not scope.get \superclass and scope.fun, scope.=parent
        return \superclass.prototype + Index that .compile o if that.meth

@satyr satyr closed this as completed in 5771465 Dec 12, 2012
@vendethiel
Copy link
Contributor Author

Ah, thanks.

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

No branches or pull requests

2 participants