build(broccoli): make node_trees produce strict-mode scripts

Closes #2575
Closes #2648
This commit is contained in:
Caitlin Potter
2015-06-19 18:02:35 -04:00
parent 2d2ae9b8d8
commit ed9d9d5096
3 changed files with 38 additions and 32 deletions

View File

@ -127,27 +127,27 @@ export function makeParamDecorator(annotationCls): any {
if (this instanceof annotationCls) {
return annotationInstance;
} else {
function ParamDecorator(cls, unusedKey, index) {
var parameters: Array<Array<any>> = Reflect.getMetadata('parameters', cls);
parameters = parameters || [];
// there might be gaps if some in between parameters do not have annotations.
// we pad with nulls.
while (parameters.length <= index) {
parameters.push(null);
}
parameters[index] = parameters[index] || [];
var annotationsForParam: Array<any> = parameters[index];
annotationsForParam.push(annotationInstance);
Reflect.defineMetadata('parameters', parameters, cls);
return cls;
}
(<any>ParamDecorator).annotation = annotationInstance;
return ParamDecorator;
}
function ParamDecorator(cls, unusedKey, index) {
var parameters: Array<Array<any>> = Reflect.getMetadata('parameters', cls);
parameters = parameters || [];
// there might be gaps if some in between parameters do not have annotations.
// we pad with nulls.
while (parameters.length <= index) {
parameters.push(null);
}
parameters[index] = parameters[index] || [];
var annotationsForParam: Array<any> = parameters[index];
annotationsForParam.push(annotationInstance);
Reflect.defineMetadata('parameters', parameters, cls);
return cls;
}
}
ParamDecoratorFactory.prototype = Object.create(annotationCls.prototype);
return ParamDecoratorFactory;