diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index 017546642f..4f719f92b0 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -29,11 +29,11 @@ class SettingDefaults extends Backbone.Model { } constructor(attributes?: any, options?: any) { + super(attributes, options); // error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. this.defaults = { name: "Joe" } // super has to come last - super(attributes, options); } // or set it like this diff --git a/backbone/backbone-with-lodash-tests.ts b/backbone/backbone-with-lodash-tests.ts index 0138b26030..001882ca02 100644 --- a/backbone/backbone-with-lodash-tests.ts +++ b/backbone/backbone-with-lodash-tests.ts @@ -30,11 +30,11 @@ class SettingDefaults extends Backbone.Model { } constructor(attributes?: any, options?: any) { + super(attributes, options); // TODO error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. this.defaults = { name: "Joe" } // super has to come last - super(attributes, options); } // or set it like this