fix(closure): don't throw from top-level
workaround for http://b/27151095
This commit is contained in:
parent
0d58b137a7
commit
5824866a83
|
@ -238,9 +238,13 @@ export function Class(clsDef: ClassDefinition): ConcreteType {
|
|||
}
|
||||
|
||||
var Reflect = global.Reflect;
|
||||
// Throw statement at top-level is disallowed by closure compiler in ES6 input.
|
||||
// Wrap in an IIFE as a work-around.
|
||||
(function checkReflect() {
|
||||
if (!(Reflect && Reflect.getMetadata)) {
|
||||
throw 'reflect-metadata shim is required when using class decorators';
|
||||
}
|
||||
})();
|
||||
|
||||
export function makeDecorator(
|
||||
annotationCls, chainFn: (fn: Function) => void = null): (...args: any[]) => (cls: any) => any {
|
||||
|
|
Loading…
Reference in New Issue