esperanto-source 0.6.15 → 0.6.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 073c79d73032cfa4bc9254ddee3bc518d1b23c9b
4
- data.tar.gz: 2745f24714e53b4349b4a40392ed8568f8621ae9
3
+ metadata.gz: 2db1faeb981d396e1cf561a554bbcb58c5eec0f0
4
+ data.tar.gz: 812893bfa15d0277c92035235d59884ce01d616d
5
5
  SHA512:
6
- metadata.gz: 3c94906168751c248259d34c8a3ff5fe3f2cab5828fa01fea6c786d571442018752c83d2e3636e5b917c6e92dffb6dd2deb93504f9384fac10d5c6d817d907f5
7
- data.tar.gz: 51b20b23bdfabd50989b65e0cc27e794580ab22a4018ec4d94d464dc40549e9ae00865654f32cd72e224dd057d719cca46560e8776789db90f02de509dd4c7eb
6
+ metadata.gz: 96bea70d8e01aa0d862c9742b1ce3e447d7bc3e53d3bc0471ea47e016c608a443dd85fc568fae6982691d59c4705c25383b0938b6c17ed3aff045fcd1e7ea278
7
+ data.tar.gz: 50bfb8581beeef06828199996e7f44a5a3016cc45931900d877f598780728f296bc842691f93d2d521f364c89401a6bcdbb64dbd4501d34f37030c7fd01c0822
@@ -1,5 +1,5 @@
1
1
  module Esperanto
2
2
  module Source
3
- VERSION = '0.6.15'
3
+ VERSION = '0.6.16'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*
2
- esperanto.js v0.6.15 - 2015-02-26
2
+ esperanto.js v0.6.16 - 2015-03-02
3
3
  http://esperantojs.org
4
4
 
5
5
  Released under the MIT License.
@@ -1148,11 +1148,11 @@
1148
1148
  x.isEmpty = true;
1149
1149
  } else if ( x.specifiers.length === 1 && x.specifiers[0].isDefault ) {
1150
1150
  x.isDefault = true;
1151
- x.name = x.specifiers[0].as;
1151
+ x.as = x.specifiers[0].as;
1152
1152
 
1153
1153
  } else if ( x.specifiers.length === 1 && x.specifiers[0].isBatch ) {
1154
1154
  x.isBatch = true;
1155
- x.name = x.specifiers[0].name;
1155
+ x.as = x.specifiers[0].name;
1156
1156
  } else {
1157
1157
  x.isNamed = true;
1158
1158
  }
@@ -1297,6 +1297,32 @@
1297
1297
  return unscoped;
1298
1298
  }
1299
1299
 
1300
+ function disallowConflictingImports ( imports ) {
1301
+ var usedNames = {};
1302
+
1303
+ imports.forEach( function(x ) {
1304
+ if ( x.as ) {
1305
+ checkName( x.as );
1306
+ }
1307
+
1308
+ else {
1309
+ x.specifiers.forEach( checkSpecifier );
1310
+ }
1311
+ });
1312
+
1313
+ function checkSpecifier ( s ) {
1314
+ checkName( s.as );
1315
+ }
1316
+
1317
+ function checkName ( name ) {
1318
+ if ( hasOwnProp.call( usedNames, name ) ) {
1319
+ throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
1320
+ }
1321
+
1322
+ usedNames[ name ] = true;
1323
+ }
1324
+ }
1325
+
1300
1326
  var reserved = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield'.split( ' ' );
1301
1327
 
1302
1328
  /**
@@ -1322,17 +1348,52 @@
1322
1348
  return path.split( pathSplitRE );
1323
1349
  }
1324
1350
 
1325
- function getModuleNameHelper ( userFn ) {var usedNames = arguments[1];if(usedNames === void 0)usedNames = {};
1326
- var nameById = {}, getModuleName;
1351
+ function getStandaloneModule ( options ) {var $D$0;
1352
+ var mod, imports, exports, conflicts = {};
1353
+
1354
+ mod = {
1355
+ body: new MagicString( options.source ),
1356
+ ast: acorn.parse( options.source, {
1357
+ ecmaVersion: 6,
1358
+ locations: true
1359
+ })
1360
+ };
1361
+
1362
+ imports = ($D$0 = findImportsAndExports( mod, options.source, mod.ast ))[0], exports = $D$0[1], $D$0;
1363
+
1364
+ disallowConflictingImports( imports );
1365
+
1366
+ mod.imports = imports;
1367
+ mod.exports = exports;
1368
+
1369
+ if ( options.strict ) {
1370
+ annotateAst( mod.ast );
1371
+
1372
+ // TODO there's probably an easier way to get this array
1373
+ Object.keys( mod.ast._declared ).concat( getUnscopedNames( mod ) ).forEach( function(n ) {
1374
+ conflicts[n] = true;
1375
+ });
1376
+ }
1377
+
1378
+ determineImportNames( imports, options.getModuleName, conflicts );
1379
+
1380
+ return mod;
1381
+ ;$D$0 = void 0}
1382
+
1383
+ function determineImportNames ( imports, userFn, usedNames ) {
1384
+ var nameById = {}, inferredNames = {};
1385
+
1386
+ usedNames = usedNames || {};
1327
1387
 
1328
- getModuleName = function(x ) {
1388
+ imports.forEach( function(x ) {
1329
1389
  var moduleId, parts, i, prefix = '', name, candidate;
1330
1390
 
1331
1391
  moduleId = x.path;
1332
1392
 
1333
1393
  // use existing value
1334
1394
  if ( hasOwnProp.call( nameById, moduleId ) ) {
1335
- return nameById[ moduleId ];
1395
+ x.name = nameById[ moduleId ];
1396
+ return;
1336
1397
  }
1337
1398
 
1338
1399
  // if user supplied a function, defer to it
@@ -1345,16 +1406,12 @@
1345
1406
  }
1346
1407
  }
1347
1408
 
1348
- else if ( x.isDefault || x.isBatch ) {
1349
- name = x.name;
1350
- }
1351
-
1352
1409
  else {
1353
1410
  parts = splitPath( moduleId );
1354
- i = parts.length;
1355
1411
 
1356
1412
  do {
1357
- while ( i-- ) {
1413
+ i = parts.length;
1414
+ while ( i-- > 0 ) {
1358
1415
  candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
1359
1416
 
1360
1417
  if ( !hasOwnProp.call( usedNames, candidate ) ) {
@@ -1370,44 +1427,23 @@
1370
1427
  usedNames[ name ] = true;
1371
1428
  nameById[ moduleId ] = name;
1372
1429
 
1373
- return name;
1374
- };
1375
-
1376
- return getModuleName;
1377
- }
1378
-
1379
- function getStandaloneModule ( options ) {var $D$0;
1380
- var mod, imports, exports, conflicts = {};
1381
-
1382
- mod = {
1383
- body: new MagicString( options.source ),
1384
- ast: acorn.parse( options.source, {
1385
- ecmaVersion: 6,
1386
- locations: true
1387
- })
1388
- };
1389
-
1390
- imports = ($D$0 = findImportsAndExports( mod, options.source, mod.ast ))[0], exports = $D$0[1], $D$0;
1391
-
1392
-
1393
- mod.imports = imports;
1394
- mod.exports = exports;
1395
-
1396
- if ( options.strict ) {
1397
- annotateAst( mod.ast );
1398
-
1399
- // TODO there's probably an easier way to get this array
1400
- Object.keys( mod.ast._declared ).concat( getUnscopedNames( mod ) ).forEach( function(n ) {
1401
- conflicts[n] = true;
1402
- });
1403
- } else {
1404
- conflicts = mod.ast._declared;
1405
- }
1430
+ x.name = name;
1431
+ });
1406
1432
 
1407
- mod.getName = getModuleNameHelper( options.getModuleName, conflicts );
1433
+ // use inferred names for default imports, wherever they
1434
+ // don't clash with path-based names
1435
+ imports.forEach( function(x ) {
1436
+ if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
1437
+ inferredNames[ x.path ] = x.as;
1438
+ }
1439
+ });
1408
1440
 
1409
- return mod;
1410
- ;$D$0 = void 0}
1441
+ imports.forEach( function(x ) {
1442
+ if ( hasOwnProp.call( inferredNames, x.path ) ) {
1443
+ x.name = inferredNames[ x.path ];
1444
+ }
1445
+ });
1446
+ }
1411
1447
 
1412
1448
  function transformExportDeclaration ( declaration, body ) {
1413
1449
  var exportedValue;
@@ -1627,12 +1663,12 @@
1627
1663
  if ( !hasOwnProp.call( seen, path ) ) {
1628
1664
  importPaths.push( path );
1629
1665
 
1630
- if ( x.name ) {
1666
+ if ( x.as ) {
1631
1667
  while ( placeholders ) {
1632
1668
  importNames.push( '__dep' + importNames.length + '__' );
1633
1669
  placeholders--;
1634
1670
  }
1635
- importNames.push( x.name );
1671
+ importNames.push( x.as );
1636
1672
  } else {
1637
1673
  placeholders++;
1638
1674
  }
@@ -1666,7 +1702,7 @@
1666
1702
 
1667
1703
  mod.imports.forEach( function(x ) {
1668
1704
  if ( !hasOwnProp.call( seen, x.path ) ) {
1669
- var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.name)) + (" = " + (req(x.path))) + ";");
1705
+ var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
1670
1706
  body.replace( x.start, x.end, replacement );
1671
1707
 
1672
1708
  seen[ x.path ] = true;
@@ -1797,12 +1833,12 @@
1797
1833
  if ( !hasOwnProp.call( seen, x.path ) ) {
1798
1834
  importPaths.push( x.path );
1799
1835
 
1800
- if ( x.name ) {
1836
+ if ( x.as ) {
1801
1837
  while ( placeholders ) {
1802
1838
  importNames.push( '__dep' + importNames.length + '__' );
1803
1839
  placeholders--;
1804
1840
  }
1805
- importNames.push( x.name );
1841
+ importNames.push( x.as );
1806
1842
  } else {
1807
1843
  placeholders++;
1808
1844
  }
@@ -1836,12 +1872,10 @@
1836
1872
  umd: umd__umd
1837
1873
  };
1838
1874
 
1839
- function gatherImports ( imports, getName ) {
1875
+ function gatherImports ( imports ) {
1840
1876
  var chains = {}, identifierReplacements = {};
1841
1877
 
1842
1878
  imports.forEach( function(x ) {
1843
- var moduleName = getName( x );
1844
-
1845
1879
  x.specifiers.forEach( function(s ) {
1846
1880
  var name, replacement;
1847
1881
 
@@ -1850,7 +1884,7 @@
1850
1884
  }
1851
1885
 
1852
1886
  name = s.as;
1853
- replacement = moduleName + ( s.isDefault ? ("['default']") : ("." + (s.name)) );
1887
+ replacement = x.name + ( s.isDefault ? ("['default']") : ("." + (s.name)) );
1854
1888
 
1855
1889
  if ( !x.passthrough ) {
1856
1890
  identifierReplacements[ name ] = replacement;
@@ -2077,7 +2111,7 @@
2077
2111
  earlyExports,
2078
2112
  lateExports;
2079
2113
 
2080
- chains = ($D$1 = gatherImports( mod.imports, mod.getName ))[0], identifierReplacements = $D$1[1], $D$1;
2114
+ chains = ($D$1 = gatherImports( mod.imports ))[0], identifierReplacements = $D$1[1], $D$1;
2081
2115
  exportNames = getExportNames( mod.exports );
2082
2116
 
2083
2117
  importedBindings = ($D$1 = getReadOnlyIdentifiers( mod.imports ))[0], importedNamespaces = $D$1[1], $D$1;
@@ -2195,7 +2229,7 @@
2195
2229
  importNames.push( '__dep' + importNames.length + '__' );
2196
2230
  placeholders--;
2197
2231
  }
2198
- importNames.push( mod.getName( x ) );
2232
+ importNames.push( x.name );
2199
2233
  } else {
2200
2234
  placeholders++;
2201
2235
  }
@@ -2249,8 +2283,7 @@
2249
2283
  if ( x.isEmpty ) {
2250
2284
  replacement = (("" + (req(x.path))) + ";");
2251
2285
  } else {
2252
- name = mod.getName( x );
2253
- replacement = (("var " + name) + (" = " + (req(x.path))) + ";");
2286
+ replacement = (("var " + (x.name)) + (" = " + (req(x.path))) + ";");
2254
2287
  }
2255
2288
 
2256
2289
  seen[ x.path ] = true;
data/vendor/esperanto.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- esperanto.js v0.6.15 - 2015-02-26
2
+ esperanto.js v0.6.16 - 2015-03-02
3
3
  http://esperantojs.org
4
4
 
5
5
  Released under the MIT License.
@@ -295,11 +295,11 @@ function processImport ( node, passthrough ) {
295
295
  x.isEmpty = true;
296
296
  } else if ( x.specifiers.length === 1 && x.specifiers[0].isDefault ) {
297
297
  x.isDefault = true;
298
- x.name = x.specifiers[0].as;
298
+ x.as = x.specifiers[0].as;
299
299
 
300
300
  } else if ( x.specifiers.length === 1 && x.specifiers[0].isBatch ) {
301
301
  x.isBatch = true;
302
- x.name = x.specifiers[0].name;
302
+ x.as = x.specifiers[0].name;
303
303
  } else {
304
304
  x.isNamed = true;
305
305
  }
@@ -444,6 +444,32 @@ function getUnscopedNames ( mod ) {
444
444
  return unscoped;
445
445
  }
446
446
 
447
+ function disallowConflictingImports ( imports ) {
448
+ var usedNames = {};
449
+
450
+ imports.forEach( function(x ) {
451
+ if ( x.as ) {
452
+ checkName( x.as );
453
+ }
454
+
455
+ else {
456
+ x.specifiers.forEach( checkSpecifier );
457
+ }
458
+ });
459
+
460
+ function checkSpecifier ( s ) {
461
+ checkName( s.as );
462
+ }
463
+
464
+ function checkName ( name ) {
465
+ if ( hasOwnProp.call( usedNames, name ) ) {
466
+ throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
467
+ }
468
+
469
+ usedNames[ name ] = true;
470
+ }
471
+ }
472
+
447
473
  var reserved = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield'.split( ' ' );
448
474
 
449
475
  /**
@@ -469,17 +495,52 @@ function splitPath ( path ) {
469
495
  return path.split( pathSplitRE );
470
496
  }
471
497
 
472
- function getModuleNameHelper ( userFn ) {var usedNames = arguments[1];if(usedNames === void 0)usedNames = {};
473
- var nameById = {}, getModuleName;
498
+ function getStandaloneModule ( options ) {var $D$0;
499
+ var mod, imports, exports, conflicts = {};
474
500
 
475
- getModuleName = function(x ) {
501
+ mod = {
502
+ body: new MagicString( options.source ),
503
+ ast: acorn.parse( options.source, {
504
+ ecmaVersion: 6,
505
+ locations: true
506
+ })
507
+ };
508
+
509
+ imports = ($D$0 = findImportsAndExports( mod, options.source, mod.ast ))[0], exports = $D$0[1], $D$0;
510
+
511
+ disallowConflictingImports( imports );
512
+
513
+ mod.imports = imports;
514
+ mod.exports = exports;
515
+
516
+ if ( options.strict ) {
517
+ annotateAst( mod.ast );
518
+
519
+ // TODO there's probably an easier way to get this array
520
+ Object.keys( mod.ast._declared ).concat( getUnscopedNames( mod ) ).forEach( function(n ) {
521
+ conflicts[n] = true;
522
+ });
523
+ }
524
+
525
+ determineImportNames( imports, options.getModuleName, conflicts );
526
+
527
+ return mod;
528
+ ;$D$0 = void 0}
529
+
530
+ function determineImportNames ( imports, userFn, usedNames ) {
531
+ var nameById = {}, inferredNames = {};
532
+
533
+ usedNames = usedNames || {};
534
+
535
+ imports.forEach( function(x ) {
476
536
  var moduleId, parts, i, prefix = '', name, candidate;
477
537
 
478
538
  moduleId = x.path;
479
539
 
480
540
  // use existing value
481
541
  if ( hasOwnProp.call( nameById, moduleId ) ) {
482
- return nameById[ moduleId ];
542
+ x.name = nameById[ moduleId ];
543
+ return;
483
544
  }
484
545
 
485
546
  // if user supplied a function, defer to it
@@ -492,16 +553,12 @@ function getModuleNameHelper ( userFn ) {var usedNames = arguments[1];if(usedNam
492
553
  }
493
554
  }
494
555
 
495
- else if ( x.isDefault || x.isBatch ) {
496
- name = x.name;
497
- }
498
-
499
556
  else {
500
557
  parts = splitPath( moduleId );
501
- i = parts.length;
502
558
 
503
559
  do {
504
- while ( i-- ) {
560
+ i = parts.length;
561
+ while ( i-- > 0 ) {
505
562
  candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
506
563
 
507
564
  if ( !hasOwnProp.call( usedNames, candidate ) ) {
@@ -517,44 +574,23 @@ function getModuleNameHelper ( userFn ) {var usedNames = arguments[1];if(usedNam
517
574
  usedNames[ name ] = true;
518
575
  nameById[ moduleId ] = name;
519
576
 
520
- return name;
521
- };
522
-
523
- return getModuleName;
524
- }
525
-
526
- function getStandaloneModule ( options ) {var $D$0;
527
- var mod, imports, exports, conflicts = {};
528
-
529
- mod = {
530
- body: new MagicString( options.source ),
531
- ast: acorn.parse( options.source, {
532
- ecmaVersion: 6,
533
- locations: true
534
- })
535
- };
536
-
537
- imports = ($D$0 = findImportsAndExports( mod, options.source, mod.ast ))[0], exports = $D$0[1], $D$0;
538
-
539
-
540
- mod.imports = imports;
541
- mod.exports = exports;
542
-
543
- if ( options.strict ) {
544
- annotateAst( mod.ast );
545
-
546
- // TODO there's probably an easier way to get this array
547
- Object.keys( mod.ast._declared ).concat( getUnscopedNames( mod ) ).forEach( function(n ) {
548
- conflicts[n] = true;
549
- });
550
- } else {
551
- conflicts = mod.ast._declared;
552
- }
577
+ x.name = name;
578
+ });
553
579
 
554
- mod.getName = getModuleNameHelper( options.getModuleName, conflicts );
580
+ // use inferred names for default imports, wherever they
581
+ // don't clash with path-based names
582
+ imports.forEach( function(x ) {
583
+ if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
584
+ inferredNames[ x.path ] = x.as;
585
+ }
586
+ });
555
587
 
556
- return mod;
557
- ;$D$0 = void 0}
588
+ imports.forEach( function(x ) {
589
+ if ( hasOwnProp.call( inferredNames, x.path ) ) {
590
+ x.name = inferredNames[ x.path ];
591
+ }
592
+ });
593
+ }
558
594
 
559
595
  function resolveId ( importPath, importerPath ) {
560
596
  var resolved, importerParts, importParts;
@@ -674,9 +710,9 @@ function getUniqueNames ( modules, externalModules, userNames ) {
674
710
  // infer names from default imports
675
711
  modules.forEach( function(mod ) {
676
712
  mod.imports.forEach( function(x ) {
677
- if ( x.isDefault && !hasOwnProp.call( names, x.id ) && !hasOwnProp.call( used, x.name ) ) {
678
- names[ x.id ] = x.name;
679
- used[ x.name ] = true;
713
+ if ( x.isDefault && !hasOwnProp.call( names, x.id ) && !hasOwnProp.call( used, x.as ) ) {
714
+ names[ x.id ] = x.as;
715
+ used[ x.as ] = true;
680
716
  }
681
717
  });
682
718
  });
@@ -814,18 +850,22 @@ function populateIdentifierReplacements ( bundle ) {
814
850
  // then figure out what identifiers need to be created
815
851
  // for default exports
816
852
  bundle.modules.forEach( function(mod ) {
817
- var x;
853
+ var x = mod.defaultExport;
854
+
855
+ if ( x ) {
856
+ var result;
818
857
 
819
- if ( x = mod.defaultExport ) {
820
858
  if ( x.hasDeclaration && x.name ) {
821
- mod.identifierReplacements.default = hasOwnProp.call( conflicts, x.name ) || otherModulesDeclare( mod, x.name ) ?
822
- mod.name + '__' + x.name :
859
+ result = hasOwnProp.call( conflicts, x.name ) || otherModulesDeclare( mod, x.name ) ?
860
+ (("" + (mod.name)) + ("__" + (x.name)) + "") :
823
861
  x.name;
824
862
  } else {
825
- mod.identifierReplacements.default = hasOwnProp.call( conflicts, mod.name ) || otherModulesDeclare( mod, mod.name ) ?
826
- mod.name + '__default' :
863
+ result = hasOwnProp.call( conflicts, mod.name ) || ( x.value !== mod.name && ~mod.ast._topLevelNames.indexOf( mod.name )) || otherModulesDeclare( mod, mod.name ) ?
864
+ (("" + (mod.name)) + "__default") :
827
865
  mod.name;
828
866
  }
867
+
868
+ mod.identifierReplacements.default = result;
829
869
  }
830
870
  });
831
871
 
@@ -1354,6 +1394,8 @@ function getModule ( mod ) {var $D$2;
1354
1394
 
1355
1395
  imports = ($D$2 = findImportsAndExports( mod, mod.source, mod.ast ))[0], exports = $D$2[1], $D$2;
1356
1396
 
1397
+ disallowConflictingImports( imports );
1398
+
1357
1399
  mod.imports = imports;
1358
1400
  mod.exports = exports;
1359
1401
 
@@ -1687,12 +1729,12 @@ function amd__amd ( mod, body, options ) {
1687
1729
  if ( !hasOwnProp.call( seen, path ) ) {
1688
1730
  importPaths.push( path );
1689
1731
 
1690
- if ( x.name ) {
1732
+ if ( x.as ) {
1691
1733
  while ( placeholders ) {
1692
1734
  importNames.push( '__dep' + importNames.length + '__' );
1693
1735
  placeholders--;
1694
1736
  }
1695
- importNames.push( x.name );
1737
+ importNames.push( x.as );
1696
1738
  } else {
1697
1739
  placeholders++;
1698
1740
  }
@@ -1726,7 +1768,7 @@ function cjs__cjs ( mod, body, options ) {
1726
1768
 
1727
1769
  mod.imports.forEach( function(x ) {
1728
1770
  if ( !hasOwnProp.call( seen, x.path ) ) {
1729
- var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.name)) + (" = " + (req(x.path))) + ";");
1771
+ var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
1730
1772
  body.replace( x.start, x.end, replacement );
1731
1773
 
1732
1774
  seen[ x.path ] = true;
@@ -1857,12 +1899,12 @@ function umd__umd ( mod, body, options ) {
1857
1899
  if ( !hasOwnProp.call( seen, x.path ) ) {
1858
1900
  importPaths.push( x.path );
1859
1901
 
1860
- if ( x.name ) {
1902
+ if ( x.as ) {
1861
1903
  while ( placeholders ) {
1862
1904
  importNames.push( '__dep' + importNames.length + '__' );
1863
1905
  placeholders--;
1864
1906
  }
1865
- importNames.push( x.name );
1907
+ importNames.push( x.as );
1866
1908
  } else {
1867
1909
  placeholders++;
1868
1910
  }
@@ -1896,12 +1938,10 @@ var defaultsMode = {
1896
1938
  umd: umd__umd
1897
1939
  };
1898
1940
 
1899
- function gatherImports ( imports, getName ) {
1941
+ function gatherImports ( imports ) {
1900
1942
  var chains = {}, identifierReplacements = {};
1901
1943
 
1902
1944
  imports.forEach( function(x ) {
1903
- var moduleName = getName( x );
1904
-
1905
1945
  x.specifiers.forEach( function(s ) {
1906
1946
  var name, replacement;
1907
1947
 
@@ -1910,7 +1950,7 @@ function gatherImports ( imports, getName ) {
1910
1950
  }
1911
1951
 
1912
1952
  name = s.as;
1913
- replacement = moduleName + ( s.isDefault ? ("['default']") : ("." + (s.name)) );
1953
+ replacement = x.name + ( s.isDefault ? ("['default']") : ("." + (s.name)) );
1914
1954
 
1915
1955
  if ( !x.passthrough ) {
1916
1956
  identifierReplacements[ name ] = replacement;
@@ -1952,7 +1992,7 @@ function utils_transformBody__transformBody ( mod, body, options ) {var $D$3;
1952
1992
  earlyExports,
1953
1993
  lateExports;
1954
1994
 
1955
- chains = ($D$3 = gatherImports( mod.imports, mod.getName ))[0], identifierReplacements = $D$3[1], $D$3;
1995
+ chains = ($D$3 = gatherImports( mod.imports ))[0], identifierReplacements = $D$3[1], $D$3;
1956
1996
  exportNames = getExportNames( mod.exports );
1957
1997
 
1958
1998
  importedBindings = ($D$3 = getReadOnlyIdentifiers( mod.imports ))[0], importedNamespaces = $D$3[1], $D$3;
@@ -2070,7 +2110,7 @@ function getImportSummary ( mod ) {
2070
2110
  importNames.push( '__dep' + importNames.length + '__' );
2071
2111
  placeholders--;
2072
2112
  }
2073
- importNames.push( mod.getName( x ) );
2113
+ importNames.push( x.name );
2074
2114
  } else {
2075
2115
  placeholders++;
2076
2116
  }
@@ -2124,8 +2164,7 @@ function strictMode_cjs__cjs ( mod, body, options ) {
2124
2164
  if ( x.isEmpty ) {
2125
2165
  replacement = (("" + (req(x.path))) + ";");
2126
2166
  } else {
2127
- name = mod.getName( x );
2128
- replacement = (("var " + name) + (" = " + (req(x.path))) + ";");
2167
+ replacement = (("var " + (x.name)) + (" = " + (req(x.path))) + ";");
2129
2168
  }
2130
2169
 
2131
2170
  seen[ x.path ] = true;
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.15
4
+ version: 0.6.16
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-02-26 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler