core/class.rb in opal-0.3.21 vs core/class.rb in opal-0.3.22

- old
+ new

@@ -3,44 +3,44 @@ %x{ function AnonClass(){}; var klass = boot_class(sup, AnonClass) klass._name = nil; - #{ sup.inherited `klass` }; + sup.$inherited(klass); if (block !== nil) { - block(klass, ''); + block.call(klass); } return klass; } end def allocate %x{ - var obj = []; + var obj = new #{self}; obj._id = unique_id++; return obj; } end def new(*args, &block) %x{ - var obj = new self; + var obj = new #{self}; obj._id = unique_id++; - obj.$m.initialize._p = block; + obj.$initialize._p = block; - obj.$m.initialize.apply(null, [obj].concat(args)); + obj.$initialize.apply(obj, args); return obj; } end def inherited(cls) end def superclass %x{ - var sup = #{self}.$s; + var sup = #{self}._super; if (!sup) { return nil; } \ No newline at end of file