mochiscript 0.4.6.pre1 → 0.4.6.pre2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1030,7 +1030,7 @@ RootParser.extend("ShorthandMapperParser", function(KLASS, OO){
1030
1030
  args = "($1,$2,$3)";
1031
1031
  }
1032
1032
 
1033
- var body = new $c.CurlyParser();
1033
+ var body = new $c.ReturnableCurlyParser();
1034
1034
  body.parse(tokens);
1035
1035
 
1036
1036
  this.out = [ '.', method, '(function', args, body, ')' ];
@@ -1111,6 +1111,14 @@ RootParser.extend("RegexParser", function(KLASS, OO){
1111
1111
 
1112
1112
  });
1113
1113
 
1114
+ CurlyParser.extend("ReturnableCurlyParser", function(KLASS, OO){
1115
+ OO.addMember("toString", function(){
1116
+ var ret = this.$super();
1117
+ return ret.replace(/^{(\s*)(return)?/, '{$1return ');
1118
+ });
1119
+ });
1120
+
1121
+
1114
1122
  CurlyParser.extend("ForeachParser", function(KLASS, OO){
1115
1123
  OO.addMember("_TYPE", 'Foreach');
1116
1124
 
@@ -1,3 +1,3 @@
1
1
  module Mochiscript
2
- VERSION = "0.4.6.pre1"
2
+ VERSION = "0.4.6.pre2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mochiscript
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: 6
5
- version: 0.4.6.pre1
5
+ version: 0.4.6.pre2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jeff Su