1.0.1 • Published 9 years ago

override-decorator v1.0.1

Weekly downloads
11
License
CC0-1.0
Repository
github
Last release
9 years ago

override-decorator

Simple @Override decorator for ES7.

Usage

Enable stage 0 or es7.decorators in Babel, then mark properties that are intended to override superclass properties with @Override.

class A {
  a() {
    /* ... */
  }
}

class B extends A {
  @Override
  a() {
    /* ... */
  }
}

The decorator will throw an error if the decorated property does not override a parent property.

class C extends A {
  @Override
  b() {
    /* ... */
  }
}

// Error: b does not override a member of its superclass