esperanto-source 0.6.30 → 0.6.31
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 +73 -78
- data/vendor/esperanto.js +80 -81
- 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: 93187dc47b5708726735e42b9f323c6c2db3765a
|
4
|
+
data.tar.gz: 7b5ebf1e30fefec34fecc41287a3edefb57d1be7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c15eb97c1e1900df87cbfe4f4587b824a5e6a86d42792fa4748b836707244ad5954f314210d1bc05de7f5d83247023620f8c15b9b7394bc410856063931e0b8e
|
7
|
+
data.tar.gz: 699ec2c9d140367d5abb7729b003277aeb610630586037ae11e0bd445256d9bb6d68acf2d056cccea37982d3b25c235608e0c45658b20d3b9fead33b7449e86e
|
data/vendor/esperanto.browser.js
CHANGED
@@ -12,7 +12,6 @@
|
|
12
12
|
}(this, function (acorn) { 'use strict';
|
13
13
|
|
14
14
|
var hasOwnProp = Object.prototype.hasOwnProperty;
|
15
|
-
var utils_hasOwnProp = hasOwnProp;
|
16
15
|
|
17
16
|
function hasNamedImports ( mod ) {
|
18
17
|
var i = mod.imports.length;
|
@@ -68,9 +67,7 @@
|
|
68
67
|
}
|
69
68
|
};
|
70
69
|
|
71
|
-
|
72
|
-
|
73
|
-
function utils_getRelativePath__getRelativePath ( from, to ) {
|
70
|
+
function getRelativePath__getRelativePath ( from, to ) {
|
74
71
|
var fromParts, toParts, i;
|
75
72
|
|
76
73
|
fromParts = from.split( /[\/\\]/ );
|
@@ -146,10 +143,10 @@
|
|
146
143
|
getSemis( this.outro )
|
147
144
|
);
|
148
145
|
|
149
|
-
return new
|
146
|
+
return new SourceMap({
|
150
147
|
file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
|
151
148
|
sources: this.sources.map( function ( source ) {
|
152
|
-
return options.file ?
|
149
|
+
return options.file ? getRelativePath__getRelativePath( options.file, source.filename ) : source.filename;
|
153
150
|
}),
|
154
151
|
sourcesContent: this.sources.map( function ( source ) {
|
155
152
|
return options.includeContent ? source.content.original : null;
|
@@ -255,7 +252,7 @@
|
|
255
252
|
}
|
256
253
|
};
|
257
254
|
|
258
|
-
|
255
|
+
|
259
256
|
|
260
257
|
function stringify ( source ) {
|
261
258
|
return source.content.toString();
|
@@ -345,15 +342,17 @@
|
|
345
342
|
}
|
346
343
|
|
347
344
|
function encode ( value ) {
|
348
|
-
var result
|
345
|
+
var result;
|
349
346
|
|
350
347
|
if ( typeof value === 'number' ) {
|
351
348
|
result = encodeInteger( value );
|
352
|
-
} else {
|
349
|
+
} else if ( Array.isArray( value ) ) {
|
353
350
|
result = '';
|
354
|
-
|
355
|
-
result += encodeInteger(
|
356
|
-
}
|
351
|
+
value.forEach( function ( num ) {
|
352
|
+
result += encodeInteger( num );
|
353
|
+
});
|
354
|
+
} else {
|
355
|
+
throw new Error( 'vlq.encode accepts an integer or an array of integers' );
|
357
356
|
}
|
358
357
|
|
359
358
|
return result;
|
@@ -382,7 +381,7 @@
|
|
382
381
|
return result;
|
383
382
|
}
|
384
383
|
|
385
|
-
var
|
384
|
+
var encode__default = encode;
|
386
385
|
|
387
386
|
function encodeMappings ( original, str, mappings, hires, sourcemapLocations, sourceIndex, offsets ) {
|
388
387
|
var lineStart,
|
@@ -473,7 +472,7 @@
|
|
473
472
|
|
474
473
|
firstSegment = false;
|
475
474
|
|
476
|
-
return
|
475
|
+
return encode__default( arr );
|
477
476
|
}).join( ',' );
|
478
477
|
}).join( ';' );
|
479
478
|
|
@@ -557,9 +556,9 @@
|
|
557
556
|
generateMap: function ( options ) {
|
558
557
|
options = options || {};
|
559
558
|
|
560
|
-
return new
|
559
|
+
return new SourceMap({
|
561
560
|
file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
|
562
|
-
sources: [ options.source ?
|
561
|
+
sources: [ options.source ? getRelativePath__getRelativePath( options.file || '', options.source ) : null ],
|
563
562
|
sourcesContent: options.includeContent ? [ this.original ] : [ null ],
|
564
563
|
names: [],
|
565
564
|
mappings: this.getMappings( options.hires, 0 )
|
@@ -880,7 +879,7 @@
|
|
880
879
|
}
|
881
880
|
};
|
882
881
|
|
883
|
-
MagicString.Bundle =
|
882
|
+
MagicString.Bundle = Bundle;
|
884
883
|
|
885
884
|
function adjust ( mappings, start, end, d ) {
|
886
885
|
var i = end;
|
@@ -931,35 +930,33 @@
|
|
931
930
|
return result;
|
932
931
|
}
|
933
932
|
|
934
|
-
var magic_string = MagicString;
|
935
|
-
|
936
933
|
function walk ( ast, leave) {var enter = leave.enter, leave = leave.leave;
|
937
934
|
visit( ast, null, enter, leave );
|
938
935
|
}
|
939
936
|
|
940
|
-
var
|
941
|
-
skip: function() {return
|
937
|
+
var walk__context = {
|
938
|
+
skip: function() {return walk__context.shouldSkip = true}
|
942
939
|
};
|
943
940
|
|
944
|
-
var
|
941
|
+
var walk__childKeys = {};
|
945
942
|
|
946
|
-
var
|
943
|
+
var walk__toString = Object.prototype.toString;
|
947
944
|
|
948
945
|
function isArray ( thing ) {
|
949
|
-
return
|
946
|
+
return walk__toString.call( thing ) === '[object Array]';
|
950
947
|
}
|
951
948
|
|
952
949
|
function visit ( node, parent, enter, leave ) {
|
953
950
|
if ( !node ) return;
|
954
951
|
|
955
952
|
if ( enter ) {
|
956
|
-
|
957
|
-
enter.call(
|
958
|
-
if (
|
953
|
+
walk__context.shouldSkip = false;
|
954
|
+
enter.call( walk__context, node, parent );
|
955
|
+
if ( walk__context.shouldSkip ) return;
|
959
956
|
}
|
960
957
|
|
961
|
-
var keys =
|
962
|
-
|
958
|
+
var keys = walk__childKeys[ node.type ] || (
|
959
|
+
walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
|
963
960
|
);
|
964
961
|
|
965
962
|
var key, value, i, j;
|
@@ -1410,7 +1407,7 @@
|
|
1410
1407
|
});
|
1411
1408
|
});
|
1412
1409
|
}
|
1413
|
-
return
|
1410
|
+
return hasOwnProp.call( importedNames, name );
|
1414
1411
|
}
|
1415
1412
|
|
1416
1413
|
walk( mod.ast, {
|
@@ -1462,7 +1459,7 @@
|
|
1462
1459
|
}
|
1463
1460
|
|
1464
1461
|
function checkName ( name ) {
|
1465
|
-
if (
|
1462
|
+
if ( hasOwnProp.call( usedNames, name ) ) {
|
1466
1463
|
throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
|
1467
1464
|
}
|
1468
1465
|
|
@@ -1509,7 +1506,7 @@
|
|
1509
1506
|
var toRemove = [];
|
1510
1507
|
|
1511
1508
|
var mod = {
|
1512
|
-
body: new
|
1509
|
+
body: new MagicString( code ),
|
1513
1510
|
ast: ast || ( acorn.parse( code, {
|
1514
1511
|
ecmaVersion: 6,
|
1515
1512
|
sourceType: 'module',
|
@@ -1558,7 +1555,7 @@
|
|
1558
1555
|
moduleId = x.path;
|
1559
1556
|
|
1560
1557
|
// use existing value
|
1561
|
-
if (
|
1558
|
+
if ( hasOwnProp.call( nameById, moduleId ) ) {
|
1562
1559
|
x.name = nameById[ moduleId ];
|
1563
1560
|
return;
|
1564
1561
|
}
|
@@ -1567,7 +1564,7 @@
|
|
1567
1564
|
if ( userFn && ( name = userFn( moduleId ) ) ) {
|
1568
1565
|
name = sanitize( name );
|
1569
1566
|
|
1570
|
-
if (
|
1567
|
+
if ( hasOwnProp.call( usedNames, name ) ) {
|
1571
1568
|
// TODO write a test for this
|
1572
1569
|
throw new Error( (("Naming collision: module " + moduleId) + (" cannot be called " + name) + "") );
|
1573
1570
|
}
|
@@ -1584,7 +1581,7 @@
|
|
1584
1581
|
while ( i-- > 0 ) {
|
1585
1582
|
candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
|
1586
1583
|
|
1587
|
-
if ( !
|
1584
|
+
if ( !hasOwnProp.call( usedNames, candidate ) ) {
|
1588
1585
|
name = candidate;
|
1589
1586
|
break;
|
1590
1587
|
}
|
@@ -1603,13 +1600,13 @@
|
|
1603
1600
|
// use inferred names for default imports, wherever they
|
1604
1601
|
// don't clash with path-based names
|
1605
1602
|
imports.forEach( function(x ) {
|
1606
|
-
if ( x.as && !
|
1603
|
+
if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
|
1607
1604
|
inferredNames[ x.path ] = x.as;
|
1608
1605
|
}
|
1609
1606
|
});
|
1610
1607
|
|
1611
1608
|
imports.forEach( function(x ) {
|
1612
|
-
if (
|
1609
|
+
if ( hasOwnProp.call( inferredNames, x.path ) ) {
|
1613
1610
|
x.name = inferredNames[ x.path ];
|
1614
1611
|
}
|
1615
1612
|
});
|
@@ -1663,7 +1660,7 @@
|
|
1663
1660
|
|
1664
1661
|
var ABSOLUTE_PATH = /^(?:[A-Z]:)?[\/\\]/i;
|
1665
1662
|
|
1666
|
-
var
|
1663
|
+
var packageResult__warned = {};
|
1667
1664
|
|
1668
1665
|
function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
|
1669
1666
|
// wrap output
|
@@ -1698,7 +1695,7 @@
|
|
1698
1695
|
map = body.generateMap({
|
1699
1696
|
includeContent: true,
|
1700
1697
|
file: sourceMapFile,
|
1701
|
-
source: ( sourceMapFile && !isBundle ) ?
|
1698
|
+
source: ( sourceMapFile && !isBundle ) ? packageResult__getRelativePath( sourceMapFile, options.sourceMapSource ) : null
|
1702
1699
|
});
|
1703
1700
|
|
1704
1701
|
if ( options.sourceMap === 'inline' ) {
|
@@ -1715,9 +1712,9 @@
|
|
1715
1712
|
code: code,
|
1716
1713
|
map: map,
|
1717
1714
|
toString: function () {
|
1718
|
-
if ( !
|
1715
|
+
if ( !packageResult__warned[ methodName ] ) {
|
1719
1716
|
console.log( (("Warning: esperanto." + methodName) + "() returns an object with a 'code' property. You should use this instead of using the returned value directly") );
|
1720
|
-
|
1717
|
+
packageResult__warned[ methodName ] = true;
|
1721
1718
|
}
|
1722
1719
|
|
1723
1720
|
return code;
|
@@ -1725,7 +1722,7 @@
|
|
1725
1722
|
};
|
1726
1723
|
}
|
1727
1724
|
|
1728
|
-
function
|
1725
|
+
function packageResult__getRelativePath ( from, to ) {
|
1729
1726
|
var fromParts, toParts, i;
|
1730
1727
|
|
1731
1728
|
fromParts = splitPath( from );
|
@@ -1797,7 +1794,7 @@
|
|
1797
1794
|
resolved = importerParts.concat( importParts ).join( '/' );
|
1798
1795
|
}
|
1799
1796
|
|
1800
|
-
return resolved
|
1797
|
+
return resolved;
|
1801
1798
|
}
|
1802
1799
|
|
1803
1800
|
function resolveAgainst ( importerPath ) {
|
@@ -1857,9 +1854,9 @@
|
|
1857
1854
|
}
|
1858
1855
|
|
1859
1856
|
var intro = (("\
|
1860
|
-
\
|
1857
|
+
\n define(" + (processName(name))) + ("" + (processIds(ids))) + ("function (" + (names.join( ', ' ))) + ") {\
|
1861
1858
|
\n\
|
1862
|
-
\n");
|
1859
|
+
\n ");
|
1863
1860
|
|
1864
1861
|
if ( useStrict ) {
|
1865
1862
|
intro += (("" + indentStr) + "'use strict';\n\n");
|
@@ -1868,7 +1865,7 @@
|
|
1868
1865
|
return intro;
|
1869
1866
|
}
|
1870
1867
|
|
1871
|
-
function
|
1868
|
+
function amd__amd ( mod, options ) {
|
1872
1869
|
mod.imports.forEach( function(x ) {
|
1873
1870
|
mod.body.remove( x.start, x.next );
|
1874
1871
|
});
|
@@ -1892,11 +1889,11 @@
|
|
1892
1889
|
return packageResult( mod, mod.body, options, 'toAmd' );
|
1893
1890
|
}
|
1894
1891
|
|
1895
|
-
function
|
1892
|
+
function cjs__cjs ( mod, options ) {
|
1896
1893
|
var seen = {};
|
1897
1894
|
|
1898
1895
|
mod.imports.forEach( function(x ) {
|
1899
|
-
if ( !
|
1896
|
+
if ( !hasOwnProp.call( seen, x.path ) ) {
|
1900
1897
|
var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
|
1901
1898
|
mod.body.replace( x.start, x.end, replacement );
|
1902
1899
|
|
@@ -1936,12 +1933,12 @@
|
|
1936
1933
|
if ( !hasExports && !imports.length ) {
|
1937
1934
|
intro =
|
1938
1935
|
(("(function (factory) {\
|
1939
|
-
\n
|
1940
|
-
\n
|
1941
|
-
\n
|
1942
|
-
\n
|
1936
|
+
\n !(typeof exports === 'object' && typeof module !== 'undefined') &&\
|
1937
|
+
\n typeof define === 'function' && define.amd ? define(" + (processName(amdName))) + ("factory) :\
|
1938
|
+
\n factory()\
|
1939
|
+
\n }(function () {" + useStrictPragma) + "\
|
1943
1940
|
\n\
|
1944
|
-
\n
|
1941
|
+
\n ");
|
1945
1942
|
}
|
1946
1943
|
|
1947
1944
|
else {
|
@@ -1965,7 +1962,7 @@
|
|
1965
1962
|
defaultsBlock = externalDefaults.map( function(x )
|
1966
1963
|
{return '\t' + ( x.needsNamed ? (("var " + (x.name)) + "__default") : x.name ) +
|
1967
1964
|
((" = ('default' in " + (x.name)) + (" ? " + (x.name)) + ("['default'] : " + (x.name)) + ");")}
|
1968
|
-
|
1965
|
+
).join('\n') + '\n\n';
|
1969
1966
|
}
|
1970
1967
|
} else {
|
1971
1968
|
amdExport = (("define(" + (processName(amdName))) + ("" + (processIds(ids))) + "factory)");
|
@@ -1977,12 +1974,12 @@
|
|
1977
1974
|
|
1978
1975
|
intro =
|
1979
1976
|
(("(function (global, factory) {\
|
1980
|
-
\n
|
1981
|
-
\n
|
1982
|
-
\n
|
1983
|
-
\n
|
1977
|
+
\n typeof exports === 'object' && typeof module !== 'undefined' ? " + cjsExport) + (" :\
|
1978
|
+
\n typeof define === 'function' && define.amd ? " + amdExport) + (" :\
|
1979
|
+
\n " + globalExport) + ("\
|
1980
|
+
\n }(this, function (" + (names.join( ', ' ))) + (") {" + useStrictPragma) + ("\
|
1984
1981
|
\n\
|
1985
|
-
\n
|
1982
|
+
\n " + defaultsBlock) + "");
|
1986
1983
|
|
1987
1984
|
}
|
1988
1985
|
|
@@ -2006,17 +2003,15 @@
|
|
2006
2003
|
EsperantoError.prototype.constructor = EsperantoError;
|
2007
2004
|
EsperantoError.prototype.name = 'EsperantoError';
|
2008
2005
|
|
2009
|
-
var utils_EsperantoError = EsperantoError;
|
2010
|
-
|
2011
2006
|
function requireName ( options ) {
|
2012
2007
|
if ( !options.name ) {
|
2013
|
-
throw new
|
2008
|
+
throw new EsperantoError( 'You must supply a `name` option for UMD modules', {
|
2014
2009
|
code: 'MISSING_NAME'
|
2015
2010
|
});
|
2016
2011
|
}
|
2017
2012
|
}
|
2018
2013
|
|
2019
|
-
function
|
2014
|
+
function umd__umd ( mod, options ) {
|
2020
2015
|
requireName( options );
|
2021
2016
|
|
2022
2017
|
mod.imports.forEach( function(x ) {
|
@@ -2041,9 +2036,9 @@
|
|
2041
2036
|
}
|
2042
2037
|
|
2043
2038
|
var defaultsMode = {
|
2044
|
-
amd:
|
2045
|
-
cjs:
|
2046
|
-
umd:
|
2039
|
+
amd: amd__amd,
|
2040
|
+
cjs: cjs__cjs,
|
2041
|
+
umd: umd__umd
|
2047
2042
|
};
|
2048
2043
|
|
2049
2044
|
function gatherImports ( imports ) {
|
@@ -2140,14 +2135,14 @@
|
|
2140
2135
|
|
2141
2136
|
var name = assignee.name;
|
2142
2137
|
|
2143
|
-
if (
|
2138
|
+
if ( hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
|
2144
2139
|
throw new Error( ( isNamespaceAssignment ? namespaceMessage : bindingMessage ) + '`' + name + '`' );
|
2145
2140
|
}
|
2146
2141
|
}
|
2147
2142
|
|
2148
2143
|
function replaceIdentifiers ( body, node, identifierReplacements, scope ) {
|
2149
2144
|
var name = node.name;
|
2150
|
-
var replacement =
|
2145
|
+
var replacement = hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
|
2151
2146
|
|
2152
2147
|
// TODO unchanged identifiers shouldn't have got this far -
|
2153
2148
|
// remove the `replacement !== name` safeguard once that's the case
|
@@ -2178,7 +2173,7 @@
|
|
2178
2173
|
return; // shadows an export
|
2179
2174
|
}
|
2180
2175
|
|
2181
|
-
if ( exports &&
|
2176
|
+
if ( exports && hasOwnProp.call( exports, name ) ) {
|
2182
2177
|
var exportAs = exports[ name ];
|
2183
2178
|
|
2184
2179
|
if ( !!capturedUpdates ) {
|
@@ -2366,7 +2361,7 @@
|
|
2366
2361
|
}
|
2367
2362
|
|
2368
2363
|
function deconflict ( name, declared ) {
|
2369
|
-
while (
|
2364
|
+
while ( hasOwnProp.call( declared, name ) ) {
|
2370
2365
|
name = '_' + name;
|
2371
2366
|
}
|
2372
2367
|
|
@@ -2397,7 +2392,7 @@
|
|
2397
2392
|
|
2398
2393
|
// Create block of require statements
|
2399
2394
|
var importBlock = mod.imports.map( function(x ) {
|
2400
|
-
if ( !
|
2395
|
+
if ( !hasOwnProp.call( seen, x.path ) ) {
|
2401
2396
|
seen[ x.path ] = true;
|
2402
2397
|
|
2403
2398
|
if ( x.isEmpty ) {
|
@@ -2455,7 +2450,7 @@
|
|
2455
2450
|
strictMode: strictMode
|
2456
2451
|
};
|
2457
2452
|
|
2458
|
-
function
|
2453
|
+
function defaultsMode_amd__amd ( bundle, options ) {
|
2459
2454
|
var defaultName = bundle.entryModule.identifierReplacements.default;
|
2460
2455
|
if ( defaultName ) {
|
2461
2456
|
bundle.body.append( (("\n\nreturn " + defaultName) + ";") );
|
@@ -2472,7 +2467,7 @@
|
|
2472
2467
|
return packageResult( bundle, bundle.body, options, 'toAmd', true );
|
2473
2468
|
}
|
2474
2469
|
|
2475
|
-
function
|
2470
|
+
function defaultsMode_cjs__cjs ( bundle, options ) {
|
2476
2471
|
var importBlock = bundle.externalModules.map( function(x ) {
|
2477
2472
|
return (("var " + (x.name)) + (" = " + (req(x.id))) + ";");
|
2478
2473
|
}).join( '\n' );
|
@@ -2493,7 +2488,7 @@
|
|
2493
2488
|
return packageResult( bundle, bundle.body, options, 'toCjs', true );
|
2494
2489
|
}
|
2495
2490
|
|
2496
|
-
function
|
2491
|
+
function defaultsMode_umd__umd ( bundle, options ) {
|
2497
2492
|
requireName( options );
|
2498
2493
|
|
2499
2494
|
var entry = bundle.entryModule;
|
@@ -2517,9 +2512,9 @@
|
|
2517
2512
|
}
|
2518
2513
|
|
2519
2514
|
var builders_defaultsMode = {
|
2520
|
-
amd:
|
2521
|
-
cjs:
|
2522
|
-
umd:
|
2515
|
+
amd: defaultsMode_amd__amd,
|
2516
|
+
cjs: defaultsMode_cjs__cjs,
|
2517
|
+
umd: defaultsMode_umd__umd
|
2523
2518
|
};
|
2524
2519
|
|
2525
2520
|
function getExportBlock ( entry ) {
|
@@ -2731,7 +2726,7 @@
|
|
2731
2726
|
|
2732
2727
|
bundle.modules.forEach( function(mod ) {
|
2733
2728
|
mod.imports.forEach( function(x ) {
|
2734
|
-
if (
|
2729
|
+
if ( hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
|
2735
2730
|
throw new Error( 'You can only have named external imports in strict mode (pass `strict: true`)' );
|
2736
2731
|
}
|
2737
2732
|
});
|
data/vendor/esperanto.js
CHANGED
@@ -9,11 +9,10 @@
|
|
9
9
|
|
10
10
|
var acorn = require('acorn');
|
11
11
|
var MagicString = require('magic-string');
|
12
|
-
var
|
12
|
+
var path = require('path');
|
13
13
|
var sander = require('sander');
|
14
14
|
|
15
15
|
var hasOwnProp = Object.prototype.hasOwnProperty;
|
16
|
-
var utils_hasOwnProp = hasOwnProp;
|
17
16
|
|
18
17
|
function hasNamedImports ( mod ) {
|
19
18
|
var i = mod.imports.length;
|
@@ -39,29 +38,29 @@ function walk ( ast, leave) {var enter = leave.enter, leave = leave.leave;
|
|
39
38
|
visit( ast, null, enter, leave );
|
40
39
|
}
|
41
40
|
|
42
|
-
var
|
43
|
-
skip: function() {return
|
41
|
+
var walk__context = {
|
42
|
+
skip: function() {return walk__context.shouldSkip = true}
|
44
43
|
};
|
45
44
|
|
46
|
-
var
|
45
|
+
var walk__childKeys = {};
|
47
46
|
|
48
|
-
var
|
47
|
+
var walk__toString = Object.prototype.toString;
|
49
48
|
|
50
49
|
function isArray ( thing ) {
|
51
|
-
return
|
50
|
+
return walk__toString.call( thing ) === '[object Array]';
|
52
51
|
}
|
53
52
|
|
54
53
|
function visit ( node, parent, enter, leave ) {
|
55
54
|
if ( !node ) return;
|
56
55
|
|
57
56
|
if ( enter ) {
|
58
|
-
|
59
|
-
enter.call(
|
60
|
-
if (
|
57
|
+
walk__context.shouldSkip = false;
|
58
|
+
enter.call( walk__context, node, parent );
|
59
|
+
if ( walk__context.shouldSkip ) return;
|
61
60
|
}
|
62
61
|
|
63
|
-
var keys =
|
64
|
-
|
62
|
+
var keys = walk__childKeys[ node.type ] || (
|
63
|
+
walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
|
65
64
|
);
|
66
65
|
|
67
66
|
var key, value, i, j;
|
@@ -512,7 +511,7 @@ function getUnscopedNames ( mod ) {
|
|
512
511
|
});
|
513
512
|
});
|
514
513
|
}
|
515
|
-
return
|
514
|
+
return hasOwnProp.call( importedNames, name );
|
516
515
|
}
|
517
516
|
|
518
517
|
walk( mod.ast, {
|
@@ -564,7 +563,7 @@ function disallowConflictingImports ( imports ) {
|
|
564
563
|
}
|
565
564
|
|
566
565
|
function checkName ( name ) {
|
567
|
-
if (
|
566
|
+
if ( hasOwnProp.call( usedNames, name ) ) {
|
568
567
|
throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
|
569
568
|
}
|
570
569
|
|
@@ -660,7 +659,7 @@ function determineImportNames ( imports, userFn, usedNames ) {
|
|
660
659
|
moduleId = x.path;
|
661
660
|
|
662
661
|
// use existing value
|
663
|
-
if (
|
662
|
+
if ( hasOwnProp.call( nameById, moduleId ) ) {
|
664
663
|
x.name = nameById[ moduleId ];
|
665
664
|
return;
|
666
665
|
}
|
@@ -669,7 +668,7 @@ function determineImportNames ( imports, userFn, usedNames ) {
|
|
669
668
|
if ( userFn && ( name = userFn( moduleId ) ) ) {
|
670
669
|
name = sanitize( name );
|
671
670
|
|
672
|
-
if (
|
671
|
+
if ( hasOwnProp.call( usedNames, name ) ) {
|
673
672
|
// TODO write a test for this
|
674
673
|
throw new Error( (("Naming collision: module " + moduleId) + (" cannot be called " + name) + "") );
|
675
674
|
}
|
@@ -686,7 +685,7 @@ function determineImportNames ( imports, userFn, usedNames ) {
|
|
686
685
|
while ( i-- > 0 ) {
|
687
686
|
candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
|
688
687
|
|
689
|
-
if ( !
|
688
|
+
if ( !hasOwnProp.call( usedNames, candidate ) ) {
|
690
689
|
name = candidate;
|
691
690
|
break;
|
692
691
|
}
|
@@ -705,13 +704,13 @@ function determineImportNames ( imports, userFn, usedNames ) {
|
|
705
704
|
// use inferred names for default imports, wherever they
|
706
705
|
// don't clash with path-based names
|
707
706
|
imports.forEach( function(x ) {
|
708
|
-
if ( x.as && !
|
707
|
+
if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
|
709
708
|
inferredNames[ x.path ] = x.as;
|
710
709
|
}
|
711
710
|
});
|
712
711
|
|
713
712
|
imports.forEach( function(x ) {
|
714
|
-
if (
|
713
|
+
if ( hasOwnProp.call( inferredNames, x.path ) ) {
|
715
714
|
x.name = inferredNames[ x.path ];
|
716
715
|
}
|
717
716
|
});
|
@@ -743,7 +742,7 @@ function resolveId ( importPath, importerPath ) {
|
|
743
742
|
resolved = importerParts.concat( importParts ).join( '/' );
|
744
743
|
}
|
745
744
|
|
746
|
-
return resolved
|
745
|
+
return resolved;
|
747
746
|
}
|
748
747
|
|
749
748
|
function resolveAgainst ( importerPath ) {
|
@@ -766,7 +765,7 @@ function sortModules ( entry, moduleLookup ) {
|
|
766
765
|
if ( !imported ) return;
|
767
766
|
|
768
767
|
// ignore modules we've already included
|
769
|
-
if (
|
768
|
+
if ( hasOwnProp.call( seen, imported.id ) ) {
|
770
769
|
if ( shouldSwap( imported, mod ) ) {
|
771
770
|
swapPairs.push([ imported, mod ]);
|
772
771
|
}
|
@@ -795,12 +794,12 @@ function sortModules ( entry, moduleLookup ) {
|
|
795
794
|
|
796
795
|
function shouldSwap ( a, b ) {
|
797
796
|
// if these modules don't import each other, abort
|
798
|
-
if ( !(
|
797
|
+
if ( !( sortModules__imports( a, b ) && sortModules__imports( b, a ) ) ) return;
|
799
798
|
|
800
799
|
return usesAtTopLevel( b, a ) && !usesAtTopLevel( a, b );
|
801
800
|
}
|
802
801
|
|
803
|
-
function
|
802
|
+
function sortModules__imports ( a, b ) {
|
804
803
|
var i = a.imports.length;
|
805
804
|
while ( i-- ) {
|
806
805
|
if ( a.imports[i].id === b.id ) {
|
@@ -854,7 +853,7 @@ function resolveChains ( modules, moduleLookup ) {
|
|
854
853
|
if ( s.isBatch ) {
|
855
854
|
// if this is an internal module, we need to tell that module that
|
856
855
|
// it needs to export an object full of getters
|
857
|
-
if (
|
856
|
+
if ( hasOwnProp.call( moduleLookup, x.id ) ) {
|
858
857
|
moduleLookup[ x.id ]._exportsNamespace = true;
|
859
858
|
}
|
860
859
|
|
@@ -869,7 +868,7 @@ function resolveChains ( modules, moduleLookup ) {
|
|
869
868
|
if ( !x.specifiers ) return;
|
870
869
|
|
871
870
|
x.specifiers.forEach( function(s ) {
|
872
|
-
if (
|
871
|
+
if ( hasOwnProp.call( origin, s.name ) ) {
|
873
872
|
chains[ (("" + (mod.id)) + ("@" + (s.name)) + "") ] = origin[ s.name ];
|
874
873
|
}
|
875
874
|
});
|
@@ -907,7 +906,7 @@ function getUniqueNames ( bundle ) {
|
|
907
906
|
// infer names from default imports - e.g. with `import _ from './utils'`,
|
908
907
|
// use '_' instead of generating a name from 'utils'
|
909
908
|
function inferName ( x ) {
|
910
|
-
if ( x.isDefault && !
|
909
|
+
if ( x.isDefault && !hasOwnProp.call( names, x.id ) && !hasOwnProp.call( used, x.as ) ) {
|
911
910
|
names[ x.id ] = x.as;
|
912
911
|
used[ x.as ] = true;
|
913
912
|
}
|
@@ -920,7 +919,7 @@ function getUniqueNames ( bundle ) {
|
|
920
919
|
// introducing conflicts
|
921
920
|
modules.concat( externalModules ).forEach( function(mod ) {
|
922
921
|
// is this already named?
|
923
|
-
if (
|
922
|
+
if ( hasOwnProp.call( names, mod.id ) ) {
|
924
923
|
mod.name = names[ mod.id ];
|
925
924
|
return;
|
926
925
|
}
|
@@ -932,12 +931,12 @@ function getUniqueNames ( bundle ) {
|
|
932
931
|
while ( i-- ) {
|
933
932
|
name = sanitize( parts.slice( i ).join( '_' ) );
|
934
933
|
|
935
|
-
if ( !
|
934
|
+
if ( !hasOwnProp.call( used, name ) ) {
|
936
935
|
break;
|
937
936
|
}
|
938
937
|
}
|
939
938
|
|
940
|
-
while (
|
939
|
+
while ( hasOwnProp.call( used, name ) ) {
|
941
940
|
name = '_' + name;
|
942
941
|
}
|
943
942
|
|
@@ -1008,7 +1007,7 @@ function topLevelScopeConflicts ( bundle ) {
|
|
1008
1007
|
|
1009
1008
|
// merge this module's top scope with bundle top scope
|
1010
1009
|
names.forEach( function(name ) {
|
1011
|
-
if (
|
1010
|
+
if ( hasOwnProp.call( inBundle, name ) ) {
|
1012
1011
|
conflicts[ name ] = true;
|
1013
1012
|
} else {
|
1014
1013
|
inBundle[ name ] = true;
|
@@ -1032,11 +1031,11 @@ function populateIdentifierReplacements ( bundle ) {
|
|
1032
1031
|
var result;
|
1033
1032
|
|
1034
1033
|
if ( x.hasDeclaration && x.name ) {
|
1035
|
-
result =
|
1034
|
+
result = hasOwnProp.call( conflicts, x.name ) || otherModulesDeclare( mod, x.name ) ?
|
1036
1035
|
(("" + (mod.name)) + ("__" + (x.name)) + "") :
|
1037
1036
|
x.name;
|
1038
1037
|
} else {
|
1039
|
-
result =
|
1038
|
+
result = hasOwnProp.call( conflicts, mod.name ) || ( x.value !== mod.name && ~mod.ast._topLevelNames.indexOf( mod.name )) || otherModulesDeclare( mod, mod.name ) ?
|
1040
1039
|
(("" + (mod.name)) + "__default") :
|
1041
1040
|
mod.name;
|
1042
1041
|
}
|
@@ -1051,7 +1050,7 @@ function populateIdentifierReplacements ( bundle ) {
|
|
1051
1050
|
var moduleIdentifiers = mod.identifierReplacements;
|
1052
1051
|
|
1053
1052
|
mod.ast._topLevelNames.forEach( function(n ) {
|
1054
|
-
moduleIdentifiers[n] =
|
1053
|
+
moduleIdentifiers[n] = hasOwnProp.call( conflicts, n ) ?
|
1055
1054
|
(("" + (mod.name)) + ("__" + n) + "") :
|
1056
1055
|
n;
|
1057
1056
|
});
|
@@ -1063,7 +1062,7 @@ function populateIdentifierReplacements ( bundle ) {
|
|
1063
1062
|
return;
|
1064
1063
|
}
|
1065
1064
|
|
1066
|
-
externalModule =
|
1065
|
+
externalModule = hasOwnProp.call( bundle.externalModuleLookup, x.id ) && bundle.externalModuleLookup[ x.id ];
|
1067
1066
|
|
1068
1067
|
x.specifiers.forEach( function(s ) {
|
1069
1068
|
var moduleId, mod, moduleName, specifierName, replacement, hash, isChained, separatorIndex;
|
@@ -1079,7 +1078,7 @@ function populateIdentifierReplacements ( bundle ) {
|
|
1079
1078
|
|
1080
1079
|
// If this is a chained import, get the origin
|
1081
1080
|
hash = (("" + moduleId) + ("@" + specifierName) + "");
|
1082
|
-
while (
|
1081
|
+
while ( hasOwnProp.call( bundle.chains, hash ) ) {
|
1083
1082
|
hash = bundle.chains[ hash ];
|
1084
1083
|
isChained = true;
|
1085
1084
|
}
|
@@ -1107,7 +1106,7 @@ function populateIdentifierReplacements ( bundle ) {
|
|
1107
1106
|
replacement = mod.identifierReplacements.default;
|
1108
1107
|
}
|
1109
1108
|
} else if ( !externalModule ) {
|
1110
|
-
replacement =
|
1109
|
+
replacement = hasOwnProp.call( conflicts, specifierName ) ?
|
1111
1110
|
(("" + moduleName) + ("__" + specifierName) + "") :
|
1112
1111
|
specifierName;
|
1113
1112
|
} else {
|
@@ -1133,7 +1132,7 @@ function populateIdentifierReplacements ( bundle ) {
|
|
1133
1132
|
continue;
|
1134
1133
|
}
|
1135
1134
|
|
1136
|
-
if (
|
1135
|
+
if ( hasOwnProp.call( otherMod.ast._declared, replacement ) ) {
|
1137
1136
|
return true;
|
1138
1137
|
}
|
1139
1138
|
}
|
@@ -1225,14 +1224,14 @@ function disallowIllegalReassignment ( node, importedBindings, importedNamespace
|
|
1225
1224
|
|
1226
1225
|
var name = assignee.name;
|
1227
1226
|
|
1228
|
-
if (
|
1227
|
+
if ( hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
|
1229
1228
|
throw new Error( ( isNamespaceAssignment ? namespaceMessage : bindingMessage ) + '`' + name + '`' );
|
1230
1229
|
}
|
1231
1230
|
}
|
1232
1231
|
|
1233
1232
|
function replaceIdentifiers ( body, node, identifierReplacements, scope ) {
|
1234
1233
|
var name = node.name;
|
1235
|
-
var replacement =
|
1234
|
+
var replacement = hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
|
1236
1235
|
|
1237
1236
|
// TODO unchanged identifiers shouldn't have got this far -
|
1238
1237
|
// remove the `replacement !== name` safeguard once that's the case
|
@@ -1263,7 +1262,7 @@ function rewriteExportAssignments ( body, node, parent, exports, scope, captured
|
|
1263
1262
|
return; // shadows an export
|
1264
1263
|
}
|
1265
1264
|
|
1266
|
-
if ( exports &&
|
1265
|
+
if ( exports && hasOwnProp.call( exports, name ) ) {
|
1267
1266
|
var exportAs = exports[ name ];
|
1268
1267
|
|
1269
1268
|
if ( !!capturedUpdates ) {
|
@@ -1360,11 +1359,11 @@ function exportCapturedUpdate ( c ) {
|
|
1360
1359
|
return ((" exports." + (c.exportAs)) + (" = " + (c.name)) + ";");
|
1361
1360
|
}
|
1362
1361
|
|
1363
|
-
function
|
1362
|
+
function transformBody__transformBody ( bundle, mod, body ) {
|
1364
1363
|
var identifierReplacements = mod.identifierReplacements;
|
1365
1364
|
var importedBindings = (importedNamespaces = getReadOnlyIdentifiers( mod.imports ))[0], importedNamespaces = importedNamespaces[1];
|
1366
1365
|
|
1367
|
-
var exportNames =
|
1366
|
+
var exportNames = hasOwnProp.call( bundle.exports, mod.id ) && bundle.exports[ mod.id ];
|
1368
1367
|
|
1369
1368
|
traverseAst( mod.ast, body, identifierReplacements, importedBindings, importedNamespaces, exportNames );
|
1370
1369
|
|
@@ -1402,7 +1401,7 @@ function combine_transformBody__transformBody ( bundle, mod, body ) {
|
|
1402
1401
|
if ( name === identifierReplacements.default ) {
|
1403
1402
|
body.remove( x.start, x.end );
|
1404
1403
|
} else {
|
1405
|
-
var original =
|
1404
|
+
var original = hasOwnProp.call( identifierReplacements, name ) ? identifierReplacements[ name ] : name;
|
1406
1405
|
body.replace( x.start, x.end, (("var " + (identifierReplacements.default)) + (" = " + original) + ";") );
|
1407
1406
|
}
|
1408
1407
|
}
|
@@ -1508,8 +1507,8 @@ function combine ( bundle ) {
|
|
1508
1507
|
});
|
1509
1508
|
|
1510
1509
|
bundle.body.addSource({
|
1511
|
-
filename:
|
1512
|
-
content:
|
1510
|
+
filename: path.resolve( bundle.base, mod.relativePath ),
|
1511
|
+
content: transformBody__transformBody( bundle, mod, mod.body ),
|
1513
1512
|
indentExclusionRanges: mod.ast._templateLiteralRanges
|
1514
1513
|
});
|
1515
1514
|
});
|
@@ -1582,7 +1581,7 @@ function getModule ( mod ) {
|
|
1582
1581
|
return mod;
|
1583
1582
|
}
|
1584
1583
|
|
1585
|
-
var
|
1584
|
+
var getBundle__Promise = sander.Promise;
|
1586
1585
|
|
1587
1586
|
function getBundle ( options ) {
|
1588
1587
|
var entry = options.entry.replace( /\.js$/, '' );
|
@@ -1592,7 +1591,7 @@ function getBundle ( options ) {
|
|
1592
1591
|
var promiseByPath = {};
|
1593
1592
|
var skip = options.skip;
|
1594
1593
|
var names = options.names;
|
1595
|
-
var base = ( options.base ?
|
1594
|
+
var base = ( options.base ? path.resolve( options.base ) : process.cwd() ) + '/';
|
1596
1595
|
var externalModules = [];
|
1597
1596
|
var externalModuleLookup = {};
|
1598
1597
|
|
@@ -1631,12 +1630,12 @@ function getBundle ( options ) {
|
|
1631
1630
|
});
|
1632
1631
|
|
1633
1632
|
function fetchModule ( moduleId, relativePath ) {
|
1634
|
-
var absolutePath =
|
1633
|
+
var absolutePath = path.resolve( base, relativePath );
|
1635
1634
|
|
1636
|
-
if ( !
|
1635
|
+
if ( !hasOwnProp.call( promiseByPath, relativePath ) ) {
|
1637
1636
|
promiseByPath[ relativePath ] = (
|
1638
|
-
|
1639
|
-
|
1637
|
+
hasOwnProp.call( userModules, relativePath ) ?
|
1638
|
+
getBundle__Promise.resolve( userModules[ relativePath ] ) :
|
1640
1639
|
sander.readFile( absolutePath ).then( String )
|
1641
1640
|
).then( function ( source ) {
|
1642
1641
|
var code, ast;
|
@@ -1683,7 +1682,7 @@ function getBundle ( options ) {
|
|
1683
1682
|
|
1684
1683
|
return resolvePath( base, userModules, x.id, absolutePath, options.resolvePath ).then( function(relativePath ) {
|
1685
1684
|
// short-circuit cycles
|
1686
|
-
if (
|
1685
|
+
if ( hasOwnProp.call( promiseByPath, relativePath ) ) {
|
1687
1686
|
return;
|
1688
1687
|
}
|
1689
1688
|
|
@@ -1691,7 +1690,7 @@ function getBundle ( options ) {
|
|
1691
1690
|
}, function handleError ( err ) {
|
1692
1691
|
if ( err.code === 'ENOENT' ) {
|
1693
1692
|
// Most likely an external module
|
1694
|
-
if ( !
|
1693
|
+
if ( !hasOwnProp.call( externalModuleLookup, x.id ) ) {
|
1695
1694
|
var externalModule = {
|
1696
1695
|
id: x.id
|
1697
1696
|
};
|
@@ -1705,7 +1704,7 @@ function getBundle ( options ) {
|
|
1705
1704
|
} );
|
1706
1705
|
});
|
1707
1706
|
|
1708
|
-
return
|
1707
|
+
return getBundle__Promise.all( promises );
|
1709
1708
|
});
|
1710
1709
|
}
|
1711
1710
|
|
@@ -1714,10 +1713,12 @@ function getBundle ( options ) {
|
|
1714
1713
|
}
|
1715
1714
|
|
1716
1715
|
function resolvePath ( base, userModules, moduleId, importerPath, resolver ) {
|
1717
|
-
|
1718
|
-
|
1716
|
+
var noExt = moduleId.replace( /\.js$/, '' );
|
1717
|
+
|
1718
|
+
return tryPath( base, noExt + '.js', userModules )
|
1719
|
+
.catch( function() {return tryPath( base, noExt + path.sep + 'index.js', userModules )} )
|
1719
1720
|
.catch( function ( err ) {
|
1720
|
-
var resolvedPromise = resolver &&
|
1721
|
+
var resolvedPromise = resolver && getBundle__Promise.resolve( resolver( moduleId, importerPath ) );
|
1721
1722
|
|
1722
1723
|
if ( resolvedPromise ) {
|
1723
1724
|
return resolvedPromise.then( function(resolvedPath ) {
|
@@ -1737,8 +1738,8 @@ function resolvePath ( base, userModules, moduleId, importerPath, resolver ) {
|
|
1737
1738
|
}
|
1738
1739
|
|
1739
1740
|
function tryPath ( base, filename, userModules ) {
|
1740
|
-
if (
|
1741
|
-
return
|
1741
|
+
if ( hasOwnProp.call( userModules, filename ) ) {
|
1742
|
+
return getBundle__Promise.resolve( filename );
|
1742
1743
|
}
|
1743
1744
|
return sander.stat( base, filename ).then( function() {return filename} );
|
1744
1745
|
}
|
@@ -1795,7 +1796,7 @@ function transformExportDeclaration ( declaration, body ) {
|
|
1795
1796
|
|
1796
1797
|
var ABSOLUTE_PATH = /^(?:[A-Z]:)?[\/\\]/i;
|
1797
1798
|
|
1798
|
-
var
|
1799
|
+
var packageResult__warned = {};
|
1799
1800
|
|
1800
1801
|
function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
|
1801
1802
|
// wrap output
|
@@ -1847,9 +1848,9 @@ function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
|
|
1847
1848
|
code: code,
|
1848
1849
|
map: map,
|
1849
1850
|
toString: function () {
|
1850
|
-
if ( !
|
1851
|
+
if ( !packageResult__warned[ methodName ] ) {
|
1851
1852
|
console.log( (("Warning: esperanto." + methodName) + "() returns an object with a 'code' property. You should use this instead of using the returned value directly") );
|
1852
|
-
|
1853
|
+
packageResult__warned[ methodName ] = true;
|
1853
1854
|
}
|
1854
1855
|
|
1855
1856
|
return code;
|
@@ -1965,7 +1966,7 @@ function amdIntro (useStrict) {var name = useStrict.name, imports = useStrict.im
|
|
1965
1966
|
return intro;
|
1966
1967
|
}
|
1967
1968
|
|
1968
|
-
function
|
1969
|
+
function amd__amd ( mod, options ) {
|
1969
1970
|
mod.imports.forEach( function(x ) {
|
1970
1971
|
mod.body.remove( x.start, x.next );
|
1971
1972
|
});
|
@@ -1989,11 +1990,11 @@ function defaultsMode_amd__amd ( mod, options ) {
|
|
1989
1990
|
return packageResult( mod, mod.body, options, 'toAmd' );
|
1990
1991
|
}
|
1991
1992
|
|
1992
|
-
function
|
1993
|
+
function cjs__cjs ( mod, options ) {
|
1993
1994
|
var seen = {};
|
1994
1995
|
|
1995
1996
|
mod.imports.forEach( function(x ) {
|
1996
|
-
if ( !
|
1997
|
+
if ( !hasOwnProp.call( seen, x.path ) ) {
|
1997
1998
|
var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
|
1998
1999
|
mod.body.replace( x.start, x.end, replacement );
|
1999
2000
|
|
@@ -2103,17 +2104,15 @@ EsperantoError.prototype = new Error();
|
|
2103
2104
|
EsperantoError.prototype.constructor = EsperantoError;
|
2104
2105
|
EsperantoError.prototype.name = 'EsperantoError';
|
2105
2106
|
|
2106
|
-
var utils_EsperantoError = EsperantoError;
|
2107
|
-
|
2108
2107
|
function requireName ( options ) {
|
2109
2108
|
if ( !options.name ) {
|
2110
|
-
throw new
|
2109
|
+
throw new EsperantoError( 'You must supply a `name` option for UMD modules', {
|
2111
2110
|
code: 'MISSING_NAME'
|
2112
2111
|
});
|
2113
2112
|
}
|
2114
2113
|
}
|
2115
2114
|
|
2116
|
-
function
|
2115
|
+
function umd__umd ( mod, options ) {
|
2117
2116
|
requireName( options );
|
2118
2117
|
|
2119
2118
|
mod.imports.forEach( function(x ) {
|
@@ -2138,9 +2137,9 @@ function defaultsMode_umd__umd ( mod, options ) {
|
|
2138
2137
|
}
|
2139
2138
|
|
2140
2139
|
var defaultsMode = {
|
2141
|
-
amd:
|
2142
|
-
cjs:
|
2143
|
-
umd:
|
2140
|
+
amd: amd__amd,
|
2141
|
+
cjs: cjs__cjs,
|
2142
|
+
umd: umd__umd
|
2144
2143
|
};
|
2145
2144
|
|
2146
2145
|
function gatherImports ( imports ) {
|
@@ -2277,7 +2276,7 @@ function utils_transformBody__transformBody ( mod, body, options ) {
|
|
2277
2276
|
}
|
2278
2277
|
|
2279
2278
|
function deconflict ( name, declared ) {
|
2280
|
-
while (
|
2279
|
+
while ( hasOwnProp.call( declared, name ) ) {
|
2281
2280
|
name = '_' + name;
|
2282
2281
|
}
|
2283
2282
|
|
@@ -2308,7 +2307,7 @@ function strictMode_cjs__cjs ( mod, options ) {
|
|
2308
2307
|
|
2309
2308
|
// Create block of require statements
|
2310
2309
|
var importBlock = mod.imports.map( function(x ) {
|
2311
|
-
if ( !
|
2310
|
+
if ( !hasOwnProp.call( seen, x.path ) ) {
|
2312
2311
|
seen[ x.path ] = true;
|
2313
2312
|
|
2314
2313
|
if ( x.isEmpty ) {
|
@@ -2366,7 +2365,7 @@ var moduleBuilders = {
|
|
2366
2365
|
strictMode: strictMode
|
2367
2366
|
};
|
2368
2367
|
|
2369
|
-
function
|
2368
|
+
function defaultsMode_amd__amd ( bundle, options ) {
|
2370
2369
|
var defaultName = bundle.entryModule.identifierReplacements.default;
|
2371
2370
|
if ( defaultName ) {
|
2372
2371
|
bundle.body.append( (("\n\nreturn " + defaultName) + ";") );
|
@@ -2383,7 +2382,7 @@ function builders_defaultsMode_amd__amd ( bundle, options ) {
|
|
2383
2382
|
return packageResult( bundle, bundle.body, options, 'toAmd', true );
|
2384
2383
|
}
|
2385
2384
|
|
2386
|
-
function
|
2385
|
+
function defaultsMode_cjs__cjs ( bundle, options ) {
|
2387
2386
|
var importBlock = bundle.externalModules.map( function(x ) {
|
2388
2387
|
return (("var " + (x.name)) + (" = " + (req(x.id))) + ";");
|
2389
2388
|
}).join( '\n' );
|
@@ -2404,7 +2403,7 @@ function builders_defaultsMode_cjs__cjs ( bundle, options ) {
|
|
2404
2403
|
return packageResult( bundle, bundle.body, options, 'toCjs', true );
|
2405
2404
|
}
|
2406
2405
|
|
2407
|
-
function
|
2406
|
+
function defaultsMode_umd__umd ( bundle, options ) {
|
2408
2407
|
requireName( options );
|
2409
2408
|
|
2410
2409
|
var entry = bundle.entryModule;
|
@@ -2428,9 +2427,9 @@ function builders_defaultsMode_umd__umd ( bundle, options ) {
|
|
2428
2427
|
}
|
2429
2428
|
|
2430
2429
|
var builders_defaultsMode = {
|
2431
|
-
amd:
|
2432
|
-
cjs:
|
2433
|
-
umd:
|
2430
|
+
amd: defaultsMode_amd__amd,
|
2431
|
+
cjs: defaultsMode_cjs__cjs,
|
2432
|
+
umd: defaultsMode_umd__umd
|
2434
2433
|
};
|
2435
2434
|
|
2436
2435
|
function getExportBlock ( entry ) {
|
@@ -2642,7 +2641,7 @@ var esperanto = {
|
|
2642
2641
|
|
2643
2642
|
bundle.modules.forEach( function(mod ) {
|
2644
2643
|
mod.imports.forEach( function(x ) {
|
2645
|
-
if (
|
2644
|
+
if ( hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
|
2646
2645
|
throw new Error( 'You can only have named external imports in strict mode (pass `strict: true`)' );
|
2647
2646
|
}
|
2648
2647
|
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: esperanto-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|