Skip to content

Instantly share code, notes, and snippets.

@vinitkumar
Created March 30, 2014 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinitkumar/9876680 to your computer and use it in GitHub Desktop.
Save vinitkumar/9876680 to your computer and use it in GitHub Desktop.
import {isFunction} from './utils';
class SuperConstructor {}
class InjectAnnotation {
constructor(...tokens) {
this.tokens = tokens;
this.isPromise = false;
}
}
class InjectPromiseAnnotation extends InjectAnnotation {
constructor(token) {
this.token = token;
this.isPromise = true;
}
}
class ProvideAnnotation {
constructor(token) {
this.token = token;
this.isPromise = false;
}
}
class ProvidePromiseAnnotation extends ProvideAnnotation {
constructor(token) {
this.token = token;
this.isPromise = true;
}
}
//aliases
var Inject = InjectAnnotation;
var InjectPromise = InjectPromiseAnnotation;
var Provide = ProvideAnnotation;
var ProvidePromise = ProvidePromiseAnnotation;
//Helpers for when annotations are not enabled in Traceur
function annotate(fn, annotation) {
fn.annotation = fn.annotation || [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment