core icon indicating copy to clipboard operation
core copied to clipboard

Inheriting from a stub class

Open Tarmil opened this issue 7 years ago • 0 comments

The prototype chain is not set correctly. The following code:

[<Stub>]
type ParentClass() = class end

[<JavaScript>]
type ComponentClass() =
    inherit ParentClass()

should generate this:

 ComponentClass=Runtime.Class({},ParentClass,ComponentClass);
 ComponentClass.New=Runtime.Ctor(function()
 {
  ParentClass.call(this);
 },ComponentClass);

but instead generates this:

 ComponentClass=Runtime.Class({},null,ComponentClass);
//                               ^^^^ this should be ParentClass
 ComponentClass.New=Runtime.Ctor(function()
 {
  ParentClass.call(this);
 },ComponentClass);

Tarmil avatar Aug 17 '18 18:08 Tarmil