{"size": 1240, "ext": "js", "max_stars_repo_path": "test/test.js", "max_stars_repo_name": "WebReflection/babel-plugin-transform-builtin-classes", "max_stars_repo_stars_event_min_datetime": "2017-06-27T13:45:06.000Z", "max_stars_repo_stars_event_max_datetime": "2019-12-26T11:24:48.000Z", "max_issues_repo_path": "test/test.js", "max_issues_repo_name": "WebReflection/babel-plugin-transform-builtin-classes", "max_issues_repo_issues_event_min_datetime": "2017-08-01T19:59:59.000Z", "max_issues_repo_issues_event_max_datetime": "2018-09-03T19:33:10.000Z", "max_forks_repo_path": "test/test.js", "max_forks_repo_name": "WebReflection/babel-plugin-transform-builtin-classes", "max_forks_repo_forks_event_min_datetime": "2017-08-02T21:54:58.000Z", "max_forks_repo_forks_event_max_datetime": "2018-07-04T18:09:59.000Z"}
{"max_stars_count": 43, "max_issues_count": 16, "max_forks_count": 4, "avg_line_length": 33.5135135135, "max_line_length": 105, "alphanum_fraction": 0.6725806452}
var tressa = require('tressa');

class List extends Array {
  constructor(value) {
    super().push(value);
  }
  push(value) {
    super.push(value);
    return this;
  }
}

tressa.title(/test\.js$/.test(__filename) ?
  'Native Classes' :
  'Transformed Classes'
);

tressa.assert(new List(1) instanceof List, 'new List is an instanceof List');
tressa.assert(new List(2) instanceof Array, 'new List is an instanceof Array');
var l = new List(3);
tressa.assert(l.length === 1 && l[0] === 3, 'constructor pushes an entry');
tressa.assert(l.push(4) === l && l.length === 2 && l.join() === '3,4', 'method override works');

class SecondLevel extends List {
  method() {
    return this;
  }
}

tressa.assert(new SecondLevel(1) instanceof SecondLevel, 'new SecondLevel is an instanceof SecondLevel');
tressa.assert(new SecondLevel(2) instanceof List, 'new SecondLevel is an instanceof List');
tressa.assert(new SecondLevel(3) instanceof Array, 'new SecondLevel is an instanceof Array');
var s = new SecondLevel(4);
tressa.assert(s.length === 1 && s[0] === 4, 'constructor pushes an entry');
tressa.assert(s.push(5) === s && s.length === 2 && s.join() === '4,5', 'inherited override works');
tressa.assert(s.method() === s, 'new method works');
