@@ -18,7 +18,7 @@ module ts {
1818 export function emitFiles ( resolver : EmitResolver , host : EmitHost , targetSourceFile : SourceFile ) : EmitResult {
1919 // emit output for the __extends helper function
2020 const extendsHelper = `
21- var __extends = this.__extends || function (d, b) {
21+ var __extends = ( this && this .__extends) || function (d, b) {
2222 for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2323 function __() { this.constructor = d; }
2424 __.prototype = b.prototype;
@@ -27,7 +27,7 @@ var __extends = this.__extends || function (d, b) {
2727
2828 // emit output for the __decorate helper function
2929 const decorateHelper = `
30- if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
30+ var __decorate = (this && this. __decorate) || function (decorators, target, key, desc) {
3131 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
3232 switch (arguments.length) {
3333 case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
@@ -38,13 +38,13 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target,
3838
3939 // emit output for the __metadata helper function
4040 const metadataHelper = `
41- if (typeof __metadata !== "function") __metadata = function (k, v) {
41+ var __metadata = (this && this. __metadata) || function (k, v) {
4242 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4343};` ;
4444
4545 // emit output for the __param helper function
4646 const paramHelper = `
47- if (typeof __param !== "function") __param = function (paramIndex, decorator) {
47+ var __param = (this && this. __param) || function (paramIndex, decorator) {
4848 return function (target, key) { decorator(target, key, paramIndex); }
4949};` ;
5050
0 commit comments