snowball 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/roll.js +5 -9
  2. data/lib/snowball/version.rb +1 -1
  3. metadata +1 -1
@@ -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 when templates is used
70
- compiled = "function() {throw new Error(unescape('"+escape(e.toString()+"\nIn "+filename)+"'))}"
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 Error('+JSON.stringify(e.message)+');');
113
+ bundle.prepend('throw new SyntaxError('+JSON.stringify(e.toString())+');');
118
114
  });
119
115
 
120
116
  (argv._.concat(argv.entry || [])).forEach(function (entry) {
@@ -1,3 +1,3 @@
1
1
  module Snowball
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snowball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: