Created
March 30, 2014 17:46
-
-
Save vinitkumar/9876680 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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