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



530
531
532
533
534
535
536
537
538
# File 'opal/stdlib/native.rb', line 530

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

#native_classObject



540
541
542
543
# File 'opal/stdlib/native.rb', line 540

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