From cac2368d201eca584f2b5c54afb10b3b30e3cbe9 Mon Sep 17 00:00:00 2001 From: Andrew Wilcox Date: Thu, 16 May 2013 10:36:47 -0400 Subject: [PATCH 1/2] Fix CoffeeScript error reporting. Fixes #1050. With the upgrade to CoffeeScript 1.6.2 the source file name and line number of a parse error is no longer present in the `message` field of the exception. --- packages/coffeescript/package.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/coffeescript/package.js b/packages/coffeescript/package.js index e8884d59597..a8c6479fbf8 100644 --- a/packages/coffeescript/package.js +++ b/packages/coffeescript/package.js @@ -15,7 +15,11 @@ var coffeescript_handler = function(bundle, source_path, serve_path, where) { try { contents = coffee.compile(contents.toString('utf8'), options); } catch (e) { - return bundle.error(e.message); + return bundle.error( + source_path + ':' + + (e.location ? (e.location.first_line + ': ') : ' ') + + e.message + ); } contents = new Buffer(contents); From 28ea851c2aad0095fb16230c66973339783a567c Mon Sep 17 00:00:00 2001 From: Nick Martin Date: Wed, 22 May 2013 22:45:06 -0700 Subject: [PATCH 2/2] History --- History.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/History.md b/History.md index 2249b5927e4..5dba98985c4 100644 --- a/History.md +++ b/History.md @@ -12,6 +12,9 @@ can be used to create repeatable test cases for code that picks random values. #1033 +* Fix CoffeeScript error reporting to include source file and line + number again. #1052 + Patches contributed by GitHub users awwx and timhaines.