Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Exception: Constructors of derived class must contain a super call when the memberVariables option is enabled #97

Open
stefanr opened this issue Feb 3, 2015 · 1 comment

Comments

@stefanr
Copy link

stefanr commented Feb 3, 2015

When the memberVariables option in traceur is enabled I get the following exception:

Uncaught exception: [ 'annotations.js:29:3: Constructors of derived class must contain a super call when the memberVariables option is enabled' ]

Tested with (Options: --annotations --types --member-variables):

import {Injector, Inject} from "di/src";
[...]

This would fix the problem:

[...]
class InjectPromise extends Inject {
  constructor(...tokens) {
    super(...tokens);
    this.isPromise = true;
    this.isLazy = false;
  }
}
[...]
@caitp
Copy link
Contributor

caitp commented Feb 3, 2015

There were recent changes to Classes over the past few months, one of them is that there is now a TDZ on this, just like there is on let or const declarations, until the super-constructor is called. https://github.com/tc39/ecma262/blob/master/workingdocs/ES6-super-construct%3Dproposal.md (but there have been some more changes since) --- so, the traceur option is just sort of showing you how it's going to be

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants