Вот код index.js
var Test = require( './test.js' );
function MyPlugin( ){
var test = new Test( );
test.myProblem( );
return through2.obj( );
}
Вот test.js
'use strict';
module.exports = Test;
function TestError( message ){
Error.call( this, message );
}
TestError.prototype = Object.create( Error.prototype );
TestError.prototype.constructor = TestError;
function Test( ){}
Test.prototype = {
constructor: Test,
myProblem: function( ){
// throw new Error( "[method myProblem]ERROR!!!" ); // так работает
throw new TestError( "[method myProblem]" ); // так нет, почему?
}
}
Вопрос в комментах.
UPD: если выполнять код при помощи чистого nodejs, то код работает.
Не работает только когда gulp его через свои команды к nodejs его выполняет.
Это возможно баг, так как это вообще и gulp и nodejs раняет.