Class: Class

Inherits:
Object show all
Defined in:
opal/stdlib/native.rb

Instance Method Summary collapse

Instance Method Details

#native_alias(new_jsid, existing_mid) ⇒ Object



616
617
618
619
620
621
622
623
624
# File 'opal/stdlib/native.rb', line 616

def native_alias(new_jsid, existing_mid)
  %x{
    var aliased = #{self}.prototype[Opal.jsid(#{existing_mid})];
    if (!aliased) {
      #{raise NameError.new("undefined method `#{existing_mid}' for class `#{inspect}'", existing_mid)};
    }
    #{self}.prototype[#{new_jsid}] = aliased;
  }
end

#native_classObject



626
627
628
629
# File 'opal/stdlib/native.rb', line 626

def native_class
  native_module
  `self["new"] = self.$new`
end