Skip to content

Inconsistent super behaviour #40

@rwz

Description

@rwz

In coffescript you can call super without any arguments and it'll be equivalent to passing all arguments to it.

class MyClass
  myMethod: ->
    super

translates into this:

var MyClass;

MyClass = (function() {
  function MyClass() {}

  MyClass.prototype.myMethod = function() {
    return MyClass.__super__.myMethod.apply(this, arguments);
  };

  return MyClass;

})();

But in Emberscript super without arguments doesn't even call the method. It just accesses the _super property.

// Generated by EmberScript 0.0.14
var MyClass;
var get$ = Ember.get;
var set$ = Ember.set;
MyClass = Ember.Object.extend({
  myMethod: function () {
    return this._super;
  }
});

Is that intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions