Skip to content

Commit 6633296

Browse files
Sylvain Pratozouai-6sense
authored andcommitted
Partial fix for #104, part 1 only
1 parent 1b02c05 commit 6633296

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

build/amdclean.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! amdclean - v2.7.0 - 2015-04-10
1+
/*! amdclean - v2.7.0 - 2015-12-05
22
* http://gregfranko.com/amdclean
33
* Copyright (c) 2015 Greg Franko */
44

@@ -464,7 +464,7 @@ convertToIIFEDeclaration = function convertToIIFEDeclaration(obj) {
464464
'computed': true,
465465
'object': {
466466
'type': 'Identifier',
467-
'name': 'module'
467+
'name': 'modules'
468468
},
469469
'property': {
470470
'type': 'Literal',
@@ -1451,7 +1451,7 @@ clean = function clean() {
14511451
});
14521452
}
14531453
});
1454-
// Adds a local module variable if a user wants local module information available to them
1454+
// Adds a local modules variable if a user wants local module information available to them
14551455
if (_.isObject(options.config) && !_.isEmpty(options.config)) {
14561456
configAst = function () {
14571457
var props = [];
@@ -1493,7 +1493,7 @@ clean = function clean() {
14931493
'type': 'VariableDeclarator',
14941494
'id': {
14951495
'type': 'Identifier',
1496-
'name': 'module'
1496+
'name': 'modules'
14971497
},
14981498
'init': {
14991499
'type': 'ObjectExpression',
@@ -1528,7 +1528,7 @@ clean = function clean() {
15281528
};
15291529
(function () {
15301530
(function (root, factory, undefined) {
1531-
1531+
'use strict';
15321532
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, and plain browser loading
15331533
if (typeof define === 'function' && define.amd) {
15341534
factory.amd = true;
@@ -1554,7 +1554,7 @@ clean = function clean() {
15541554
root.amdclean = factory(null, root);
15551555
}
15561556
}(this, function cleanamd(amdDependencies, context) {
1557-
1557+
'use strict';
15581558
// Third-Party Dependencies
15591559
// Note: These dependencies are hoisted to the top (as local variables) at build time (Look in the gulpfile.js file and the AMDclean wrap option for more details)
15601560
sourcemapToAst = function () {

build/amdclean.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/amdclean.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! amdclean - v2.7.0 - 2015-04-10
1+
/*! amdclean - v2.7.0 - 2015-12-05
22
* http://gregfranko.com/amdclean
33
* Copyright (c) 2015 Greg Franko */
44

@@ -464,7 +464,7 @@ convertToIIFEDeclaration = function convertToIIFEDeclaration(obj) {
464464
'computed': true,
465465
'object': {
466466
'type': 'Identifier',
467-
'name': 'module'
467+
'name': 'modules'
468468
},
469469
'property': {
470470
'type': 'Literal',
@@ -1451,7 +1451,7 @@ clean = function clean() {
14511451
});
14521452
}
14531453
});
1454-
// Adds a local module variable if a user wants local module information available to them
1454+
// Adds a local modules variable if a user wants local module information available to them
14551455
if (_.isObject(options.config) && !_.isEmpty(options.config)) {
14561456
configAst = function () {
14571457
var props = [];
@@ -1493,7 +1493,7 @@ clean = function clean() {
14931493
'type': 'VariableDeclarator',
14941494
'id': {
14951495
'type': 'Identifier',
1496-
'name': 'module'
1496+
'name': 'modules'
14971497
},
14981498
'init': {
14991499
'type': 'ObjectExpression',
@@ -1528,7 +1528,7 @@ clean = function clean() {
15281528
};
15291529
(function () {
15301530
(function (root, factory, undefined) {
1531-
1531+
'use strict';
15321532
// Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, and plain browser loading
15331533
if (typeof define === 'function' && define.amd) {
15341534
factory.amd = true;
@@ -1554,7 +1554,7 @@ clean = function clean() {
15541554
root.amdclean = factory(null, root);
15551555
}
15561556
}(this, function cleanamd(amdDependencies, context) {
1557-
1557+
'use strict';
15581558
// Third-Party Dependencies
15591559
// Note: These dependencies are hoisted to the top (as local variables) at build time (Look in the gulpfile.js file and the AMDclean wrap option for more details)
15601560
sourcemapToAst = function () {

src/modules/clean.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ define([
261261
}
262262
});
263263

264-
// Adds a local module variable if a user wants local module information available to them
264+
// Adds a local modules variable if a user wants local module information available to them
265265
if (_.isObject(options.config) && !_.isEmpty(options.config)) {
266266
configAst = (function() {
267267
var props = [];
@@ -306,7 +306,7 @@ define([
306306
'type': 'VariableDeclarator',
307307
'id': {
308308
'type': 'Identifier',
309-
'name': 'module'
309+
'name': 'modules'
310310
},
311311
'init': {
312312
'type': 'ObjectExpression',

src/modules/convertToIIFEDeclaration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ define([
115115
'computed': true,
116116
'object': {
117117
'type': 'Identifier',
118-
'name': 'module'
118+
'name': 'modules'
119119
},
120120
'property': {
121121
'type': 'Literal',

test/specs/convert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ describe('amdclean specs', function() {
901901
}
902902
}),
903903
cleanedCode = amdclean.clean(AMDcode, options),
904-
standardJavaScript = "var moment,module={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (require,exports,module){return moment;}({},{},module['moment']);}";
904+
standardJavaScript = "var moment,modules={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (require,exports,module){return moment;}({},{},modules['moment']);}";
905905

906906
expect(cleanedCode).toBe(standardJavaScript);
907907
});
@@ -920,7 +920,7 @@ describe('amdclean specs', function() {
920920
}
921921
}),
922922
cleanedCode = amdclean.clean(AMDcode, options),
923-
standardJavaScript = "var moment,module={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (module){return moment;}(module['moment']);}";
923+
standardJavaScript = "var moment,modules={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (module){return moment;}(modules['moment']);}";
924924

925925
expect(cleanedCode).toBe(standardJavaScript);
926926
});
@@ -939,7 +939,7 @@ describe('amdclean specs', function() {
939939
}
940940
}),
941941
cleanedCode = amdclean.clean(AMDcode, options),
942-
standardJavaScript = "var moment,module={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (test,module){return moment;}(test,module['moment']);}";
942+
standardJavaScript = "var moment,modules={'moment':{'config':function(){return{'noGlobal':true};}}};if(true){moment=function (test,module){return moment;}(test,modules['moment']);}";
943943

944944
expect(cleanedCode).toBe(standardJavaScript);
945945
});

0 commit comments

Comments
 (0)