Class: Class

Inherits:
Object show all
Defined in:
/Users/elia/Code/opal-docs/opal/stdlib/native.rb

Instance Method Summary collapse

Instance Method Details

#native_alias(new_jsid, existing_mid) ⇒ Object


608
609
610
611
612
613
614
615
616
# File '/Users/elia/Code/opal-docs/opal/stdlib/native.rb', line 608

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

#native_classObject


618
619
620
621
# File '/Users/elia/Code/opal-docs/opal/stdlib/native.rb', line 618

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