File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
modules/angular2/src/core/util Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -238,9 +238,13 @@ export function Class(clsDef: ClassDefinition): ConcreteType {
238238}
239239
240240var Reflect = global . Reflect ;
241- if ( ! ( Reflect && Reflect . getMetadata ) ) {
242- throw 'reflect-metadata shim is required when using class decorators' ;
243- }
241+ // Throw statement at top-level is disallowed by closure compiler in ES6 input.
242+ // Wrap in an IIFE as a work-around.
243+ ( function checkReflect ( ) {
244+ if ( ! ( Reflect && Reflect . getMetadata ) ) {
245+ throw 'reflect-metadata shim is required when using class decorators' ;
246+ }
247+ } ) ( ) ;
244248
245249export function makeDecorator (
246250 annotationCls , chainFn : ( fn : Function ) => void = null ) : ( ...args : any [ ] ) => ( cls : any ) => any {
You can’t perform that action at this time.
0 commit comments