We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d58b13 commit 5824866Copy full SHA for 5824866
1 file changed
modules/angular2/src/core/util/decorators.ts
@@ -238,9 +238,13 @@ export function Class(clsDef: ClassDefinition): ConcreteType {
238
}
239
240
var Reflect = global.Reflect;
241
-if (!(Reflect && Reflect.getMetadata)) {
242
- throw 'reflect-metadata shim is required when using class decorators';
243
-}
+// Throw statement at top-level is disallowed by closure compiler in ES6 input.
+// Wrap in an IIFE as a work-around.
+(function checkReflect() {
244
+ if (!(Reflect && Reflect.getMetadata)) {
245
+ throw 'reflect-metadata shim is required when using class decorators';
246
+ }
247
+})();
248
249
export function makeDecorator(
250
annotationCls, chainFn: (fn: Function) => void = null): (...args: any[]) => (cls: any) => any {
0 commit comments