Sha256: 7595184c0cd2218822a485d4f49e7e67a696a3940253bc01dfb0622b5dd423a2

Contents?: true

Size: 541 Bytes

Versions: 1

Compression:

Stored size: 541 Bytes

Contents

class Class < Module

  # def new(*args)
  #   `var obj = self.$m.allocate(self);
  #   args.unshift(obj);

  #   obj.$m.initialize.apply(null, args);

  #   return obj;`
  # end

  # This is what new should be: need to fix compiler for splat args
  #
  # def new(*args)
  #   obj = allocate
  #   obj.initialize *args
  #   obj
  # end

  def superclass
    `var sup = self.$super;

    if (!sup) {
      if (self == VM.BasicObject) return nil;
      throw new Error('RuntimeError: uninitialized class');
    }

    return sup;`
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-0.3.2 gems/core/lib/core/class.rb