Skip to content

Commit

Permalink
Merge pull request #18 from appedemic/dev
Browse files Browse the repository at this point in the history
Fix #15 with a temporary wrapper
  • Loading branch information
GianlucaGuarini committed Nov 9, 2015
2 parents ebb3177 + 838afa4 commit ed821b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@
}, opts)).code
},
babel: /* istanbul ignore next */ function (js, opts) {
js = 'function __parser_babel_wrapper__(){' + js + '}';
return _req('babel').transform(js, extend({
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
}, opts)).code.replace(/"use strict";[\r\n]+/, '')
}, opts)).code.replace(/"use strict";[\r\n]+/, '').slice(38, -2);
},
coffee: function (js, opts) {
return _req('coffee').compile(js, extend({bare: true}, opts))
Expand Down
3 changes: 2 additions & 1 deletion dist/riot.compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ var parsers = (function () {
}, opts)).code
},
babel: /* istanbul ignore next */ function (js, opts) {
js = 'function __parser_babel_wrapper__(){' + js + '}';
return _req('babel').transform(js, extend({
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
}, opts)).code.replace(/"use strict";[\r\n]+/, '')
}, opts)).code.replace(/"use strict";[\r\n]+/, '').slice(38, -2);
},
coffee: function (js, opts) {
return _req('coffee').compile(js, extend({bare: true}, opts))
Expand Down
3 changes: 2 additions & 1 deletion lib/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ var parsers = (function () {
}, opts)).code
},
babel: /* istanbul ignore next */ function (js, opts) {
js = 'function __parser_babel_wrapper__(){' + js + '}';
return _req('babel').transform(js, extend({
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
}, opts)).code.replace(/"use strict";[\r\n]+/, '')
}, opts)).code.replace(/"use strict";[\r\n]+/, '').slice(38, -2);
},
coffee: function (js, opts) {
return _req('coffee').compile(js, extend({bare: true}, opts))
Expand Down

0 comments on commit ed821b7

Please sign in to comment.