Skip to content

Support ES5-style inheritance with Object.create (Salsa) #18609

Closed as not planned
@PhaserEditor2D

Description

@PhaserEditor2D

TypeScript Version: 2.4.1

Salsa engine does not understand ES3 prototype inheritance.

Code

function A() {
    
}

A.prototype.hello = function (){
};

function B() {
    A.call(this);
}

B.prototype = Object.create(A.prototype);
B.prototype.constructor = B;

var b = new B();
b.[request completions]

Expected behavior:

It should show the list of methods inherited from A, like hello().

Actual behavior:

It does not show the methods from A.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: JavaScriptThe issue relates to JavaScript specificallyIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions