|
1 | 1 | "use strict";
|
2 |
| -var __extends = (this && this.__extends) || function (d, b) { |
3 |
| - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; |
4 |
| - function __() { this.constructor = d; } |
5 |
| - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
6 |
| -}; |
7 |
| -var stream = require('stream'); |
8 |
| -var vfs = require('vinyl-fs'); |
9 |
| -var path = require('path'); |
10 |
| -var gutil = require('gulp-util'); |
11 |
| -var utils = require('./utils'); |
12 |
| -var reporter_1 = require('./reporter'); |
13 |
| -var input_1 = require('./input'); |
14 |
| -var output_1 = require('./output'); |
15 |
| -var compiler_1 = require('./compiler'); |
| 2 | +var __extends = (this && this.__extends) || (function () { |
| 3 | + var extendStatics = Object.setPrototypeOf || |
| 4 | + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
| 5 | + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
| 6 | + return function (d, b) { |
| 7 | + extendStatics(d, b); |
| 8 | + function __() { this.constructor = d; } |
| 9 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
| 10 | + }; |
| 11 | +})(); |
| 12 | +Object.defineProperty(exports, "__esModule", { value: true }); |
| 13 | +var stream = require("stream"); |
| 14 | +var vfs = require("vinyl-fs"); |
| 15 | +var path = require("path"); |
| 16 | +var gutil = require("gulp-util"); |
| 17 | +var utils = require("./utils"); |
| 18 | +var reporter_1 = require("./reporter"); |
| 19 | +var input_1 = require("./input"); |
| 20 | +var output_1 = require("./output"); |
| 21 | +var compiler_1 = require("./compiler"); |
16 | 22 | function setupProject(projectDirectory, config, options, typescript) {
|
17 | 23 | var input = new input_1.FileCache(typescript, options);
|
18 | 24 | var compiler = options.isolatedModules ? new compiler_1.FileCompiler() : new compiler_1.ProjectCompiler();
|
@@ -89,12 +95,13 @@ function src() {
|
89 | 95 | var CompileStream = (function (_super) {
|
90 | 96 | __extends(CompileStream, _super);
|
91 | 97 | function CompileStream(project) {
|
92 |
| - _super.call(this, { objectMode: true }); |
93 |
| - this.js = new CompileOutputStream(); |
94 |
| - this.dts = new CompileOutputStream(); |
95 |
| - this.project = project; |
| 98 | + var _this = _super.call(this, { objectMode: true }) || this; |
| 99 | + _this.js = new CompileOutputStream(); |
| 100 | + _this.dts = new CompileOutputStream(); |
| 101 | + _this.project = project; |
96 | 102 | // Prevent "Unhandled stream error in pipe" when a compilation error occurs.
|
97 |
| - this.on('error', function () { }); |
| 103 | + _this.on('error', function () { }); |
| 104 | + return _this; |
98 | 105 | }
|
99 | 106 | CompileStream.prototype._write = function (file, encoding, cb) {
|
100 | 107 | if (cb === void 0) { cb = function (err) { }; }
|
@@ -130,7 +137,7 @@ var CompileStream = (function (_super) {
|
130 | 137 | var CompileOutputStream = (function (_super) {
|
131 | 138 | __extends(CompileOutputStream, _super);
|
132 | 139 | function CompileOutputStream() {
|
133 |
| - _super.call(this, { objectMode: true }); |
| 140 | + return _super.call(this, { objectMode: true }) || this; |
134 | 141 | }
|
135 | 142 | CompileOutputStream.prototype._read = function () {
|
136 | 143 | };
|
|
0 commit comments