snowball 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/roll.js +5 -9
- data/lib/snowball/version.rb +1 -1
- metadata +1 -1
data/bin/roll.js
CHANGED
@@ -53,7 +53,7 @@ if (argv.env) {
|
|
53
53
|
bundle = browserify();
|
54
54
|
|
55
55
|
// Todo: make jade-support optional (consider snowball plugins?)
|
56
|
-
bundle.register('.jade', function () {
|
56
|
+
bundle.register('.jade', (function () {
|
57
57
|
var compileDebug = !!(argv.env && argv.env.hasOwnProperty('NODE_ENV') && argv.env.NODE_ENV == 'development');
|
58
58
|
return function (b, filename) {
|
59
59
|
var body = fs.readFileSync(filename);
|
@@ -66,8 +66,8 @@ bundle.register('.jade', function () {
|
|
66
66
|
}).toString();
|
67
67
|
}
|
68
68
|
catch (e) {
|
69
|
-
// There's a syntax error in the template. Wrap it into a function that will throw an error
|
70
|
-
|
69
|
+
// There's a syntax error in the template. Wrap it into a function that will immediately throw an error
|
70
|
+
return '\nthrow new '+ e.name +'('+JSON.stringify(e.message)+');';
|
71
71
|
}
|
72
72
|
// Wrap the compiled template function in a function that merges in previously registered globals (i.e. helpers, etc)
|
73
73
|
return ''+
|
@@ -77,7 +77,7 @@ bundle.register('.jade', function () {
|
|
77
77
|
' return ('+compiled+")(locals, attrs, escape, rethrow, merge);" +
|
78
78
|
'}';
|
79
79
|
}
|
80
|
-
});
|
80
|
+
})());
|
81
81
|
|
82
82
|
if (argv.prelude === false) {
|
83
83
|
bundle.files = [];
|
@@ -109,12 +109,8 @@ if (argv.ignore) {
|
|
109
109
|
bundle.ignore(argv.ignore);
|
110
110
|
}
|
111
111
|
|
112
|
-
bundle.on("loadError", function(e) {
|
113
|
-
bundle.prepend('\nthrow new Error('+JSON.stringify(e.message)+');');
|
114
|
-
});
|
115
|
-
|
116
112
|
bundle.on("syntaxError", function(e) {
|
117
|
-
bundle.prepend('throw new
|
113
|
+
bundle.prepend('throw new SyntaxError('+JSON.stringify(e.toString())+');');
|
118
114
|
});
|
119
115
|
|
120
116
|
(argv._.concat(argv.entry || [])).forEach(function (entry) {
|
data/lib/snowball/version.rb
CHANGED