1
0
Fork 0

UnknownEventError: use ease.js

ease.js supports Error extending now.

* src/event/UnknownEventError.js: Use easejs.
master
Mike Gerwitz 2017-02-06 11:55:18 -05:00
parent bd81e2e726
commit a65f568714
1 changed files with 6 additions and 14 deletions

View File

@ -19,19 +19,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
module.exports = function UnknownEventError( msg )
const Class = require( 'easejs' ).Class;
module.exports = Class( 'UnknownEventHandler' )
.extend( TypeError,
{
// 'new' keyword optional
if ( !( this instanceof module.exports ) )
{
return new module.exports( msg );
}
Error.prototype.constructor.apply( this, arguments );
};
// extends TypeError
module.exports.constructor = module.exports;
module.exports.prototype = TypeError();
module.exports.prototype.name = 'UnknownEventError';
} );