From f47a29f922bdeca8748abdc4c9b5dc6f60a98784 Mon Sep 17 00:00:00 2001 From: Thomas Aylott Date: Wed, 5 Aug 2015 12:31:51 -0700 Subject: [PATCH] [react-packager] Fixes stack traces Summary: TransformErrors weren't showing stack traces, making it hard to debug problems in transformer code. --- react-packager/src/JSTransformer/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-packager/src/JSTransformer/index.js b/react-packager/src/JSTransformer/index.js index 7c20e10e..0cc7f2c6 100644 --- a/react-packager/src/JSTransformer/index.js +++ b/react-packager/src/JSTransformer/index.js @@ -121,7 +121,9 @@ Transformer.prototype.loadFileAndTransform = function(filePath) { }); }; -function TransformError() {} +function TransformError() { + Error.captureStackTrace && Error.captureStackTrace(this, TransformError); +} util.inherits(TransformError, SyntaxError); function formatError(err, filename, source) {