@@ -19,7 +19,7 @@ module.exports = {
19
19
* @param {Object } dependencies example: {libName: "dependencyName"}
20
20
* @param {String } jsAttrName
21
21
* @param {String } jsAttrScheme
22
- * @param {String } mimic
22
+ * @param {String|Array } mimic
23
23
* @returns {string }
24
24
*/
25
25
buildModule : function ( targetPath , bhEngine , inputSources , dependencies , jsAttrName , jsAttrScheme ,
@@ -29,7 +29,9 @@ module.exports = {
29
29
this . _defineModule ( 'bh' , file , dependencies , bhEngine , inputSources , jsAttrName , jsAttrScheme , true ) ;
30
30
31
31
if ( mimic ) {
32
- this . _defineModule ( mimic , file , { bh : 'bh' } ) ;
32
+ [ ] . concat ( mimic ) . forEach ( function ( name ) {
33
+ this . _defineModule ( name , file , { bh : 'bh' } ) ;
34
+ } , this ) ;
33
35
}
34
36
35
37
return file ;
@@ -43,7 +45,7 @@ module.exports = {
43
45
* @param {String } jsAttrName
44
46
* @param {String } jsAttrScheme
45
47
* @param {Boolean } useSourceMap
46
- * @param {String } mimic
48
+ * @param {String|Array } mimic
47
49
* @returns {string }
48
50
*/
49
51
build : function ( targetPath , bhEngine , inputSources , dependencies , jsAttrName , jsAttrScheme , useSourceMap , mimic ) {
@@ -67,7 +69,7 @@ module.exports = {
67
69
* @param {Object } dependencies example: {libName: "dependencyName"}
68
70
* @param {String } jsAttrName
69
71
* @param {String } jsAttrScheme
70
- * @param {String } [mimic]
72
+ * @param {String|Array } [mimic]
71
73
* @returns {Object } enb-source-map/lib/file instance
72
74
*/
73
75
_concatFile : function ( file , bhEngine , inputSources , dependencies , jsAttrName , jsAttrScheme , mimic ) {
@@ -81,9 +83,11 @@ module.exports = {
81
83
file . writeLine ( '});' ) ;
82
84
83
85
if ( mimic ) {
84
- file . writeLine ( 'if (typeof ' + mimic + ' === \'undefined\') {' ) ;
85
- file . writeLine ( 'var ' + mimic + ' = bh;' ) ;
86
- file . writeLine ( '}' ) ;
86
+ [ ] . concat ( mimic ) . forEach ( function ( name ) {
87
+ file . writeLine ( 'if (typeof ' + name + ' === \'undefined\') {' ) ;
88
+ file . writeLine ( 'var ' + name + ' = bh;' ) ;
89
+ file . writeLine ( '}' ) ;
90
+ } ) ;
87
91
}
88
92
89
93
libPrepares . forEach ( function ( libPrepare ) {
0 commit comments