esperanto-source 0.6.22 → 0.6.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/esperanto/source/version.rb +1 -1
- data/vendor/esperanto.browser.js +104 -98
- data/vendor/esperanto.js +148 -154
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 864bf2d89a4c779247b296ce3c07bc63f060964b
|
4
|
+
data.tar.gz: 6e02d94b12fe6bf561a7c4a385bb110f2b251397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13b4d51e1ad918ca512e5febdc9893651adbad989d6a5eea1421d8cc72462d59e235a0ad6dab0557fcb3b42a56fc379e769feefd2a2acb2fc51cc411e61102da
|
7
|
+
data.tar.gz: bfc123010aa38aba0647fe16e5471a8b376f855323acc3db93dda6fe433f21050ca58faefa23c37eb8d82418148fa352c4271224bb8cdb18301bd8633770011a
|
data/vendor/esperanto.browser.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
esperanto.js v0.6.
|
2
|
+
esperanto.js v0.6.23 - 2015-03-31
|
3
3
|
http://esperantojs.org
|
4
4
|
|
5
5
|
Released under the MIT License.
|
@@ -12,6 +12,7 @@
|
|
12
12
|
}(this, function (acorn) { 'use strict';
|
13
13
|
|
14
14
|
var hasOwnProp = Object.prototype.hasOwnProperty;
|
15
|
+
var utils_hasOwnProp = hasOwnProp;
|
15
16
|
|
16
17
|
function hasNamedImports ( mod ) {
|
17
18
|
var i = mod.imports.length;
|
@@ -67,7 +68,9 @@
|
|
67
68
|
}
|
68
69
|
};
|
69
70
|
|
70
|
-
|
71
|
+
var src_SourceMap = SourceMap;
|
72
|
+
|
73
|
+
function utils_getRelativePath__getRelativePath ( from, to ) {
|
71
74
|
var fromParts, toParts, i;
|
72
75
|
|
73
76
|
fromParts = from.split( /[\/\\]/ );
|
@@ -143,10 +146,10 @@
|
|
143
146
|
getSemis( this.outro )
|
144
147
|
);
|
145
148
|
|
146
|
-
return new
|
149
|
+
return new src_SourceMap({
|
147
150
|
file: options.file.split( /[\/\\]/ ).pop(),
|
148
151
|
sources: this.sources.map( function ( source ) {
|
149
|
-
return
|
152
|
+
return utils_getRelativePath__getRelativePath( options.file, source.filename );
|
150
153
|
}),
|
151
154
|
sourcesContent: this.sources.map( function ( source ) {
|
152
155
|
return options.includeContent ? source.content.original : null;
|
@@ -252,7 +255,7 @@
|
|
252
255
|
}
|
253
256
|
};
|
254
257
|
|
255
|
-
|
258
|
+
var src_Bundle = Bundle;
|
256
259
|
|
257
260
|
function stringify ( source ) {
|
258
261
|
return source.content.toString();
|
@@ -379,7 +382,7 @@
|
|
379
382
|
return result;
|
380
383
|
}
|
381
384
|
|
382
|
-
var
|
385
|
+
var utils_encode = encode;
|
383
386
|
|
384
387
|
function encodeMappings ( original, str, mappings, hires, sourcemapLocations, sourceIndex, offsets ) {
|
385
388
|
var lineStart,
|
@@ -470,7 +473,7 @@
|
|
470
473
|
|
471
474
|
firstSegment = false;
|
472
475
|
|
473
|
-
return
|
476
|
+
return utils_encode( arr );
|
474
477
|
}).join( ',' );
|
475
478
|
}).join( ';' );
|
476
479
|
|
@@ -554,9 +557,9 @@
|
|
554
557
|
generateMap: function ( options ) {
|
555
558
|
options = options || {};
|
556
559
|
|
557
|
-
return new
|
560
|
+
return new src_SourceMap({
|
558
561
|
file: ( options.file ? options.file.split( '/' ).pop() : null ),
|
559
|
-
sources: [ options.source ?
|
562
|
+
sources: [ options.source ? utils_getRelativePath__getRelativePath( options.file || '', options.source ) : null ],
|
560
563
|
sourcesContent: options.includeContent ? [ this.original ] : [ null ],
|
561
564
|
names: [],
|
562
565
|
mappings: this.getMappings( options.hires, 0 )
|
@@ -879,7 +882,7 @@
|
|
879
882
|
}
|
880
883
|
};
|
881
884
|
|
882
|
-
MagicString.Bundle =
|
885
|
+
MagicString.Bundle = src_Bundle;
|
883
886
|
|
884
887
|
function adjust ( mappings, start, end, d ) {
|
885
888
|
var i = end;
|
@@ -930,31 +933,33 @@
|
|
930
933
|
return result;
|
931
934
|
}
|
932
935
|
|
936
|
+
var magic_string = MagicString;
|
937
|
+
|
933
938
|
function walk ( ast, leave) {var enter = leave.enter, leave = leave.leave;
|
934
939
|
visit( ast, null, enter, leave );
|
935
940
|
}
|
936
941
|
|
937
|
-
var
|
938
|
-
skip: function() {return
|
942
|
+
var ast_walk__context = {
|
943
|
+
skip: function() {return ast_walk__context.shouldSkip = true}
|
939
944
|
};
|
940
945
|
|
941
|
-
var
|
946
|
+
var ast_walk__childKeys = {};
|
942
947
|
|
943
|
-
var
|
948
|
+
var ast_walk__toString = Object.prototype.toString;
|
944
949
|
|
945
950
|
function isArray ( thing ) {
|
946
|
-
return
|
951
|
+
return ast_walk__toString.call( thing ) === '[object Array]';
|
947
952
|
}
|
948
953
|
|
949
954
|
function visit ( node, parent, enter, leave ) {
|
950
955
|
if ( enter ) {
|
951
|
-
|
952
|
-
enter.call(
|
953
|
-
if (
|
956
|
+
ast_walk__context.shouldSkip = false;
|
957
|
+
enter.call( ast_walk__context, node, parent );
|
958
|
+
if ( ast_walk__context.shouldSkip ) return;
|
954
959
|
}
|
955
960
|
|
956
|
-
var keys =
|
957
|
-
|
961
|
+
var keys = ast_walk__childKeys[ node.type ] || (
|
962
|
+
ast_walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
|
958
963
|
);
|
959
964
|
|
960
965
|
var key, value, i, j;
|
@@ -981,6 +986,30 @@
|
|
981
986
|
}
|
982
987
|
}
|
983
988
|
|
989
|
+
function getId ( m ) {
|
990
|
+
return m.id;
|
991
|
+
}
|
992
|
+
|
993
|
+
function getName ( m ) {
|
994
|
+
return m.name;
|
995
|
+
}
|
996
|
+
|
997
|
+
function quote ( str ) {
|
998
|
+
return "'" + JSON.stringify(str).slice(1, -1).replace(/'/g, "\\'") + "'";
|
999
|
+
}
|
1000
|
+
|
1001
|
+
function req ( path ) {
|
1002
|
+
return 'require(' + quote(path) + ')';
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
function globalify ( name ) {
|
1006
|
+
if ( /^__dep\d+__$/.test( name ) ) {
|
1007
|
+
return 'undefined';
|
1008
|
+
} else {
|
1009
|
+
return 'global.' + name;
|
1010
|
+
}
|
1011
|
+
}
|
1012
|
+
|
984
1013
|
/*
|
985
1014
|
This module traverse a module's AST, attaching scope information
|
986
1015
|
to nodes as it goes, which is later used to determine which
|
@@ -1050,9 +1079,13 @@
|
|
1050
1079
|
}
|
1051
1080
|
}
|
1052
1081
|
|
1082
|
+
var names = node.params.map( getName );
|
1083
|
+
|
1084
|
+
names.forEach( function(name ) {return declared[ name ] = true} );
|
1085
|
+
|
1053
1086
|
scope = node._scope = new Scope({
|
1054
1087
|
parent: scope,
|
1055
|
-
params:
|
1088
|
+
params: names // TODO rest params?
|
1056
1089
|
});
|
1057
1090
|
|
1058
1091
|
break;
|
@@ -1372,7 +1405,7 @@
|
|
1372
1405
|
});
|
1373
1406
|
});
|
1374
1407
|
}
|
1375
|
-
return
|
1408
|
+
return utils_hasOwnProp.call( importedNames, name );
|
1376
1409
|
}
|
1377
1410
|
|
1378
1411
|
walk( mod.ast, {
|
@@ -1424,7 +1457,7 @@
|
|
1424
1457
|
}
|
1425
1458
|
|
1426
1459
|
function checkName ( name ) {
|
1427
|
-
if (
|
1460
|
+
if ( utils_hasOwnProp.call( usedNames, name ) ) {
|
1428
1461
|
throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
|
1429
1462
|
}
|
1430
1463
|
|
@@ -1463,13 +1496,13 @@
|
|
1463
1496
|
var toRemove = [];
|
1464
1497
|
|
1465
1498
|
var mod = {
|
1466
|
-
body: new
|
1499
|
+
body: new magic_string( options.source ),
|
1467
1500
|
ast: acorn.parse( options.source, {
|
1468
1501
|
ecmaVersion: 6,
|
1469
1502
|
sourceType: 'module',
|
1470
1503
|
onComment: function ( block, text, start, end ) {
|
1471
1504
|
// sourceMappingURL comments should be removed
|
1472
|
-
if ( !block &&
|
1505
|
+
if ( !block && SOURCEMAPPINGURL_REGEX.test( text ) ) {
|
1473
1506
|
toRemove.push({ start: start, end: end });
|
1474
1507
|
}
|
1475
1508
|
}
|
@@ -1512,7 +1545,7 @@
|
|
1512
1545
|
moduleId = x.path;
|
1513
1546
|
|
1514
1547
|
// use existing value
|
1515
|
-
if (
|
1548
|
+
if ( utils_hasOwnProp.call( nameById, moduleId ) ) {
|
1516
1549
|
x.name = nameById[ moduleId ];
|
1517
1550
|
return;
|
1518
1551
|
}
|
@@ -1521,9 +1554,9 @@
|
|
1521
1554
|
if ( userFn && ( name = userFn( moduleId ) ) ) {
|
1522
1555
|
name = sanitize( name );
|
1523
1556
|
|
1524
|
-
if (
|
1557
|
+
if ( utils_hasOwnProp.call( usedNames, name ) ) {
|
1525
1558
|
// TODO write a test for this
|
1526
|
-
throw new Error(
|
1559
|
+
throw new Error( (("Naming collision: module " + moduleId) + (" cannot be called " + name) + "") );
|
1527
1560
|
}
|
1528
1561
|
}
|
1529
1562
|
|
@@ -1535,7 +1568,7 @@
|
|
1535
1568
|
while ( i-- > 0 ) {
|
1536
1569
|
candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
|
1537
1570
|
|
1538
|
-
if ( !
|
1571
|
+
if ( !utils_hasOwnProp.call( usedNames, candidate ) ) {
|
1539
1572
|
name = candidate;
|
1540
1573
|
break;
|
1541
1574
|
}
|
@@ -1554,13 +1587,13 @@
|
|
1554
1587
|
// use inferred names for default imports, wherever they
|
1555
1588
|
// don't clash with path-based names
|
1556
1589
|
imports.forEach( function(x ) {
|
1557
|
-
if ( x.as && !
|
1590
|
+
if ( x.as && !utils_hasOwnProp.call( usedNames, x.as ) ) {
|
1558
1591
|
inferredNames[ x.path ] = x.as;
|
1559
1592
|
}
|
1560
1593
|
});
|
1561
1594
|
|
1562
1595
|
imports.forEach( function(x ) {
|
1563
|
-
if (
|
1596
|
+
if ( utils_hasOwnProp.call( inferredNames, x.path ) ) {
|
1564
1597
|
x.name = inferredNames[ x.path ];
|
1565
1598
|
}
|
1566
1599
|
});
|
@@ -1648,7 +1681,7 @@
|
|
1648
1681
|
map = body.generateMap({
|
1649
1682
|
includeContent: true,
|
1650
1683
|
file: sourceMapFile,
|
1651
|
-
source: (sourceMapFile && !isBundle) ?
|
1684
|
+
source: (sourceMapFile && !isBundle) ? utils_packageResult__getRelativePath( sourceMapFile, options.sourceMapSource ) : null
|
1652
1685
|
});
|
1653
1686
|
|
1654
1687
|
if ( options.sourceMap === 'inline' ) {
|
@@ -1679,7 +1712,7 @@
|
|
1679
1712
|
return /^(?:[A-Z]:)?[\/\\]/i.test( path );
|
1680
1713
|
}
|
1681
1714
|
|
1682
|
-
function
|
1715
|
+
function utils_packageResult__getRelativePath ( from, to ) {
|
1683
1716
|
var fromParts, toParts, i;
|
1684
1717
|
|
1685
1718
|
fromParts = splitPath( from );
|
@@ -1771,33 +1804,9 @@
|
|
1771
1804
|
};
|
1772
1805
|
}
|
1773
1806
|
|
1774
|
-
|
1775
|
-
return m.id;
|
1776
|
-
}
|
1777
|
-
|
1778
|
-
function getName ( m ) {
|
1779
|
-
return m.name;
|
1780
|
-
}
|
1781
|
-
|
1782
|
-
function quote ( str ) {
|
1783
|
-
return "'" + JSON.stringify(str).slice(1, -1).replace(/'/g, "\\'") + "'";
|
1784
|
-
}
|
1785
|
-
|
1786
|
-
function req ( path ) {
|
1787
|
-
return 'require(' + quote(path) + ')';
|
1788
|
-
}
|
1789
|
-
|
1790
|
-
function globalify ( name ) {
|
1791
|
-
if ( /^__dep\d+__$/.test( name ) ) {
|
1792
|
-
return 'undefined';
|
1793
|
-
} else {
|
1794
|
-
return 'global.' + name;
|
1795
|
-
}
|
1796
|
-
}
|
1797
|
-
|
1798
|
-
var amd__introTemplate = template( 'define(<%= amdName %><%= paths %>function (<%= names %>) {\n\n' );
|
1807
|
+
var defaultsMode_amd__introTemplate = template( 'define(<%= amdName %><%= paths %>function (<%= names %>) {\n\n' );
|
1799
1808
|
|
1800
|
-
function
|
1809
|
+
function defaultsMode_amd__amd ( mod, options ) {
|
1801
1810
|
var seen = {},
|
1802
1811
|
importNames = [],
|
1803
1812
|
importPaths = [],
|
@@ -1808,7 +1817,7 @@
|
|
1808
1817
|
mod.imports.forEach( function(x ) {
|
1809
1818
|
var path = options.absolutePaths ? resolveId( x.path, options.amdName ) : x.path;
|
1810
1819
|
|
1811
|
-
if ( !
|
1820
|
+
if ( !utils_hasOwnProp.call( seen, path ) ) {
|
1812
1821
|
importPaths.push( path );
|
1813
1822
|
|
1814
1823
|
if ( x.as ) {
|
@@ -1829,7 +1838,7 @@
|
|
1829
1838
|
|
1830
1839
|
transformExportDeclaration( mod.exports[0], mod.body );
|
1831
1840
|
|
1832
|
-
intro =
|
1841
|
+
intro = defaultsMode_amd__introTemplate({
|
1833
1842
|
amdName: options.amdName ? (("'" + (options.amdName)) + "', ") : '',
|
1834
1843
|
paths: importPaths.length ? '[' + importPaths.map( quote ).join( ', ' ) + '], ' : '',
|
1835
1844
|
names: importNames.join( ', ' )
|
@@ -1845,11 +1854,11 @@
|
|
1845
1854
|
return packageResult( mod, mod.body, options, 'toAmd' );
|
1846
1855
|
}
|
1847
1856
|
|
1848
|
-
function
|
1857
|
+
function defaultsMode_cjs__cjs ( mod, options ) {
|
1849
1858
|
var seen = {}, exportDeclaration;
|
1850
1859
|
|
1851
1860
|
mod.imports.forEach( function(x ) {
|
1852
|
-
if ( !
|
1861
|
+
if ( !utils_hasOwnProp.call( seen, x.path ) ) {
|
1853
1862
|
var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
|
1854
1863
|
mod.body.replace( x.start, x.end, replacement );
|
1855
1864
|
|
@@ -1946,15 +1955,17 @@
|
|
1946
1955
|
EsperantoError.prototype.constructor = EsperantoError;
|
1947
1956
|
EsperantoError.prototype.name = 'EsperantoError';
|
1948
1957
|
|
1958
|
+
var utils_EsperantoError = EsperantoError;
|
1959
|
+
|
1949
1960
|
function requireName ( options ) {
|
1950
1961
|
if ( !options.name ) {
|
1951
|
-
throw new
|
1962
|
+
throw new utils_EsperantoError( 'You must supply a `name` option for UMD modules', {
|
1952
1963
|
code: 'MISSING_NAME'
|
1953
1964
|
});
|
1954
1965
|
}
|
1955
1966
|
}
|
1956
1967
|
|
1957
|
-
function
|
1968
|
+
function defaultsMode_umd__umd ( mod, options ) {
|
1958
1969
|
var importNames = [];
|
1959
1970
|
var importPaths = [];
|
1960
1971
|
var seen = {};
|
@@ -1973,7 +1984,7 @@
|
|
1973
1984
|
} else {
|
1974
1985
|
// gather imports, and remove import declarations
|
1975
1986
|
mod.imports.forEach( function(x ) {
|
1976
|
-
if ( !
|
1987
|
+
if ( !utils_hasOwnProp.call( seen, x.path ) ) {
|
1977
1988
|
importPaths.push( x.path );
|
1978
1989
|
|
1979
1990
|
if ( x.as ) {
|
@@ -2010,9 +2021,9 @@
|
|
2010
2021
|
}
|
2011
2022
|
|
2012
2023
|
var defaultsMode = {
|
2013
|
-
amd:
|
2014
|
-
cjs:
|
2015
|
-
umd:
|
2024
|
+
amd: defaultsMode_amd__amd,
|
2025
|
+
cjs: defaultsMode_cjs__cjs,
|
2026
|
+
umd: defaultsMode_umd__umd
|
2016
2027
|
};
|
2017
2028
|
|
2018
2029
|
function gatherImports ( imports ) {
|
@@ -2110,14 +2121,14 @@
|
|
2110
2121
|
|
2111
2122
|
name = assignee.name;
|
2112
2123
|
|
2113
|
-
if (
|
2124
|
+
if ( utils_hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
|
2114
2125
|
throw new Error( ( isNamespaceAssignment ? namespaceMessage : bindingMessage ) + '`' + name + '`' );
|
2115
2126
|
}
|
2116
2127
|
}
|
2117
2128
|
|
2118
2129
|
function replaceIdentifiers ( body, node, identifierReplacements, scope ) {
|
2119
2130
|
var name = node.name;
|
2120
|
-
var replacement =
|
2131
|
+
var replacement = utils_hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
|
2121
2132
|
|
2122
2133
|
// TODO unchanged identifiers shouldn't have got this far -
|
2123
2134
|
// remove the `replacement !== name` safeguard once that's the case
|
@@ -2127,7 +2138,7 @@
|
|
2127
2138
|
}
|
2128
2139
|
}
|
2129
2140
|
|
2130
|
-
function rewriteExportAssignments ( body, node, exports, scope,
|
2141
|
+
function rewriteExportAssignments ( body, node, exports, scope, capturedUpdates ) {
|
2131
2142
|
var assignee, name, exportAs;
|
2132
2143
|
|
2133
2144
|
if ( node.type === 'AssignmentExpression' ) {
|
@@ -2148,7 +2159,7 @@
|
|
2148
2159
|
return; // shadows an export
|
2149
2160
|
}
|
2150
2161
|
|
2151
|
-
if ( exports &&
|
2162
|
+
if ( exports && utils_hasOwnProp.call( exports, name ) && ( exportAs = exports[ name ] ) ) {
|
2152
2163
|
if ( !!capturedUpdates ) {
|
2153
2164
|
capturedUpdates.push({
|
2154
2165
|
name: name,
|
@@ -2163,16 +2174,10 @@
|
|
2163
2174
|
} else {
|
2164
2175
|
body.replace( node.start, node.start, (("exports." + exportAs) + " = ") );
|
2165
2176
|
}
|
2166
|
-
|
2167
|
-
// keep track of what we've already exported - we don't need to
|
2168
|
-
// export it again later
|
2169
|
-
if ( isTopLevelNode ) {
|
2170
|
-
alreadyExported[ name ] = true;
|
2171
|
-
}
|
2172
2177
|
}
|
2173
2178
|
}
|
2174
2179
|
|
2175
|
-
function traverseAst ( ast, body, identifierReplacements, importedBindings, importedNamespaces, exportNames
|
2180
|
+
function traverseAst ( ast, body, identifierReplacements, importedBindings, importedNamespaces, exportNames ) {
|
2176
2181
|
var scope = ast._scope,
|
2177
2182
|
blockScope = ast._blockScope,
|
2178
2183
|
capturedUpdates = null,
|
@@ -2204,9 +2209,11 @@
|
|
2204
2209
|
// Catch illegal reassignments
|
2205
2210
|
disallowIllegalReassignment( node, importedBindings, importedNamespaces, scope );
|
2206
2211
|
|
2207
|
-
// Rewrite assignments to exports
|
2208
|
-
//
|
2209
|
-
|
2212
|
+
// Rewrite assignments to exports inside functions, to keep bindings live.
|
2213
|
+
// This call may mutate `capturedUpdates`, which is used elsewhere
|
2214
|
+
if ( scope !== ast._scope ) {
|
2215
|
+
rewriteExportAssignments( body, node, exportNames, scope, capturedUpdates );
|
2216
|
+
}
|
2210
2217
|
|
2211
2218
|
if ( node.type === 'Identifier' && parent.type !== 'FunctionExpression' ) {
|
2212
2219
|
replaceIdentifiers( body, node, identifierReplacements, scope );
|
@@ -2247,7 +2254,6 @@
|
|
2247
2254
|
importedBindings = {},
|
2248
2255
|
importedNamespaces = {},
|
2249
2256
|
exportNames,
|
2250
|
-
alreadyExported = {},
|
2251
2257
|
earlyExports,
|
2252
2258
|
lateExports;
|
2253
2259
|
|
@@ -2259,7 +2265,7 @@
|
|
2259
2265
|
// ensure no conflict with `exports`
|
2260
2266
|
identifierReplacements.exports = deconflict( 'exports', mod.ast._declared );
|
2261
2267
|
|
2262
|
-
traverseAst( mod.ast, body, identifierReplacements, importedBindings, importedNamespaces, exportNames
|
2268
|
+
traverseAst( mod.ast, body, identifierReplacements, importedBindings, importedNamespaces, exportNames );
|
2263
2269
|
|
2264
2270
|
// Remove import statements from the body of the module
|
2265
2271
|
mod.imports.forEach( function(x ) {
|
@@ -2326,7 +2332,7 @@
|
|
2326
2332
|
// functions should be exported early, in
|
2327
2333
|
// case of cyclic dependencies
|
2328
2334
|
earlyExports.push( (("exports." + exportAs) + (" = " + name) + ";") );
|
2329
|
-
} else
|
2335
|
+
} else {
|
2330
2336
|
lateExports.push( (("exports." + exportAs) + (" = " + name) + ";") );
|
2331
2337
|
}
|
2332
2338
|
});
|
@@ -2347,7 +2353,7 @@
|
|
2347
2353
|
;$D$0 = void 0}
|
2348
2354
|
|
2349
2355
|
function deconflict ( name, declared ) {
|
2350
|
-
while (
|
2356
|
+
while ( utils_hasOwnProp.call( declared, name ) ) {
|
2351
2357
|
name = '_' + name;
|
2352
2358
|
}
|
2353
2359
|
|
@@ -2358,7 +2364,7 @@
|
|
2358
2364
|
var importPaths = [], importNames = [], seen = {}, placeholders = 0;
|
2359
2365
|
|
2360
2366
|
mod.imports.forEach( function(x ) {
|
2361
|
-
if ( !
|
2367
|
+
if ( !utils_hasOwnProp.call( seen, x.path ) ) {
|
2362
2368
|
importPaths.push( x.path );
|
2363
2369
|
|
2364
2370
|
if ( x.specifiers.length ) {
|
@@ -2416,7 +2422,7 @@
|
|
2416
2422
|
importBlock = mod.imports.map( function(x ) {
|
2417
2423
|
var name, replacement;
|
2418
2424
|
|
2419
|
-
if ( !
|
2425
|
+
if ( !utils_hasOwnProp.call( seen, x.path ) ) {
|
2420
2426
|
if ( x.isEmpty ) {
|
2421
2427
|
replacement = (("" + (req(x.path))) + ";");
|
2422
2428
|
} else {
|
@@ -2520,15 +2526,15 @@
|
|
2520
2526
|
strictMode: strictMode
|
2521
2527
|
};
|
2522
2528
|
|
2523
|
-
var
|
2529
|
+
var builders_defaultsMode_amd__introTemplate = template( 'define(<%= amdName %><%= amdDeps %>function (<%= names %>) {\n\n\t\'use strict\';\n\n' );
|
2524
2530
|
|
2525
|
-
function
|
2531
|
+
function builders_defaultsMode_amd__amd ( bundle, options ) {
|
2526
2532
|
var defaultName = bundle.entryModule.identifierReplacements.default;
|
2527
2533
|
if ( defaultName ) {
|
2528
2534
|
bundle.body.append( (("\n\nreturn " + defaultName) + ";") );
|
2529
2535
|
}
|
2530
2536
|
|
2531
|
-
var intro =
|
2537
|
+
var intro = builders_defaultsMode_amd__introTemplate({
|
2532
2538
|
amdName: options.amdName ? (("" + (quote(options.amdName))) + ", ") : '',
|
2533
2539
|
amdDeps: bundle.externalModules.length ? '[' + bundle.externalModules.map( quoteId ).join( ', ' ) + '], ' : '',
|
2534
2540
|
names: bundle.externalModules.map( getName ).join( ', ' )
|
@@ -2542,7 +2548,7 @@
|
|
2542
2548
|
return "'" + m.id + "'";
|
2543
2549
|
}
|
2544
2550
|
|
2545
|
-
function
|
2551
|
+
function builders_defaultsMode_cjs__cjs ( bundle, options ) {
|
2546
2552
|
var importBlock = bundle.externalModules.map( function(x ) {
|
2547
2553
|
return (("var " + (x.name)) + (" = " + (req(x.id))) + ";");
|
2548
2554
|
}).join( '\n' );
|
@@ -2561,7 +2567,7 @@
|
|
2561
2567
|
return packageResult( bundle, bundle.body, options, 'toCjs', true );
|
2562
2568
|
}
|
2563
2569
|
|
2564
|
-
function
|
2570
|
+
function builders_defaultsMode_umd__umd ( bundle, options ) {
|
2565
2571
|
requireName( options );
|
2566
2572
|
|
2567
2573
|
var entry = bundle.entryModule;
|
@@ -2599,9 +2605,9 @@
|
|
2599
2605
|
}
|
2600
2606
|
|
2601
2607
|
var builders_defaultsMode = {
|
2602
|
-
amd:
|
2603
|
-
cjs:
|
2604
|
-
umd:
|
2608
|
+
amd: builders_defaultsMode_amd__amd,
|
2609
|
+
cjs: builders_defaultsMode_cjs__cjs,
|
2610
|
+
umd: builders_defaultsMode_umd__umd
|
2605
2611
|
};
|
2606
2612
|
|
2607
2613
|
function getExportBlock ( entry ) {
|
@@ -2832,7 +2838,7 @@
|
|
2832
2838
|
|
2833
2839
|
bundle.modules.forEach( function(mod ) {
|
2834
2840
|
mod.imports.forEach( function(x ) {
|
2835
|
-
if (
|
2841
|
+
if ( utils_hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
|
2836
2842
|
throw new Error( 'You can only have named external imports in strict mode (pass `strict: true`)' );
|
2837
2843
|
}
|
2838
2844
|
});
|