Skip to content

extending classes with ES6 syntax #11

Open
@Disorrder

Description

@Disorrder

There is unable to extend classes

var robot = require('robot-js');
class Window extends robot.Window {
  constructor(hwnd) {
    super(hwnd);
    this.newProperty = 'hello';
  }
  newFeature(){}
}

var wnd = new Window();
wnd.newProperty; // 'hello' !!! this is weird
wnd.newFeature(); // TypeError: newFeature in not a function
wnd instanceof Window // false
wnd instanceof robot.Window // true

:(

Metadata

Metadata

Assignees

No one assigned

    Labels

    RequestA cool feature request for the library

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions