Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoffeeScript 2 #30

Merged
merged 4 commits into from
Mar 28, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var coffee = require("coffee-script");
var coffee = require("coffeescript");
Copy link
Member

@michael-ciniawsky michael-ciniawsky Mar 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe wrap in a try/catch ? 😛 I'm not sure...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need. Peer dep should force it. And it's better to fail hard in this case most likely.

var loaderUtils = require("loader-utils");
module.exports = function(source) {
this.cacheable && this.cacheable();
Expand All @@ -24,8 +24,8 @@ module.exports = function(source) {
} catch (e) {
var err = "";
if (e.location == null || e.location.first_column == null || e.location.first_line == null) {
err += "Got an unexpected exception from the coffee-script compiler. The original exception was: " + e + "\n";
err += "(The coffee-script compiler should not raise *unexpected* exceptions. You can file this error as an issue of the coffee-script compiler: https://github.com/jashkenas/coffee-script/issues)\n";
err += "Got an unexpected exception from the coffeescript compiler. The original exception was: " + e + "\n";
err += "(The coffeescript compiler should not raise *unexpected* exceptions. You can file this error as an issue of the coffeescript compiler: https://github.com/jashkenas/coffee-script/issues)\n";
} else {
var codeLine = source.split("\n")[e.location.first_line];
var offendingCharacter = (e.location.first_column < codeLine.length) ? codeLine[e.location.first_column] : "";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"loader-utils": "^1.0.2"
},
"peerDependencies": {
"coffee-script": "1.x"
"coffeescript": ">= 1.8.x"
},
"repository": {
"type": "git",
Expand Down