Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit e10db4b

Browse files
committed
Attempting to use less wrapper code.
1 parent 86699d8 commit e10db4b

File tree

7 files changed

+8
-20
lines changed

7 files changed

+8
-20
lines changed

lib/handler/CommonCoffeeHandler.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/handler/CommonJsHandler.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/handler/CommonCoffeeHandler.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ module.exports = class CommonCoffeeHandler
1010
constructor: (@template) ->
1111
@template ?= '''
1212
if (!module) { var module = {}; }
13-
(function () {
1413
1514
%s
16-
return module.exports;
17-
}).call(this);
15+
module.exports;
1816
'''
1917

2018
handleFile: (filePath) => new Promise (resolve, reject) =>

src/handler/CommonJsHandler.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ module.exports = class CommonJsHandler
1010
constructor: (@template) ->
1111
@template ?= '''
1212
if (!module) { var module = {}; }
13-
(function () {
1413
1514
%s
16-
return module.exports;
17-
}).call(this);
15+
module.exports;
1816
'''
1917

2018
handleFile: (filePath) => new Promise (resolve, reject) =>

test/suite/handler/CommonCoffeeHandler.spec.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ describe 'CommonCoffeeHandler', ->
1616
'coffee'
1717
'''
1818
if (!module) { var module = {}; }
19-
(function () {
2019
2120
var test;
2221
@@ -26,8 +25,7 @@ describe 'CommonCoffeeHandler', ->
2625
return [test, Array.prototype.slice.call(arguments)];
2726
};
2827
29-
return module.exports;
30-
}).call(this);
28+
module.exports;
3129
'''
3230
]
3331

test/suite/handler/CommonJsHandler.spec.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ describe 'CommonJsHandler', ->
1616
'js'
1717
'''
1818
if (!module) { var module = {}; }
19-
(function () {
2019
2120
var test = 'It works.';
2221
module.exports = function () { return [test, Array.prototype.slice.call(arguments)] };
2322
24-
return module.exports;
25-
}).call(this);
23+
module.exports;
2624
'''
2725
]
2826

test/suite/index.spec.coffee

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ describe 'Module', ->
88
it 'builds a result using the correct handlers', ->
99
expectedCoffee = '''
1010
if (!module) { var module = {}; }
11-
(function () {
1211
1312
var test;
1413
@@ -18,18 +17,15 @@ describe 'Module', ->
1817
return [test, Array.prototype.slice.call(arguments)];
1918
};
2019
21-
return module.exports;
22-
}).call(this);
20+
module.exports;
2321
'''
2422
expectedJs = '''
2523
if (!module) { var module = {}; }
26-
(function () {
2724
2825
var test = 'It works.';
2926
module.exports = function () { return [test, Array.prototype.slice.call(arguments)] };
3027
31-
return module.exports;
32-
}).call(this);
28+
module.exports;
3329
'''
3430
expected =
3531
'coffee': expectedCoffee

0 commit comments

Comments
 (0)