esperanto-source 0.6.28.1 → 0.6.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e4da7e1cd667816bc4501bcb9b2dcecd3cc1c78
4
- data.tar.gz: f4ecbad33ffca09e0ecfb8850001ba52e87667ca
3
+ metadata.gz: aaec92025cd191eec899a49cd50dd2cb159c7e6d
4
+ data.tar.gz: f79025a53a948de7ad6aed4d0f739d4ef037d893
5
5
  SHA512:
6
- metadata.gz: f0c21fc108e915862730a392a72f0c7267873e790bfab98f9d1e9681d9f76120c5242555b67cd6136770261b45634367b2c99aa056bb108a5f673a3d9bd3c4bb
7
- data.tar.gz: a4332af663a7c4399ebd1eb5cff14563d50dff6bdbf88dee4b3d2378a743c1dad7668bc84adfccdb40e423b90f10ac80e1217561122a4c444fc2261a5da88546
6
+ metadata.gz: 3032498d98e7fe6228f6946c0703bc0286cafc903c8e7dd134f440b1c5dba8ca1d4d7eda2c3cbfa7b05f36331ca7eb1eb8df905e6b1a4edc19bc6456b560cad4
7
+ data.tar.gz: 0c52015a2813f6abdf7671510806bc0618f1d5e727cf4e3a240615b0a4e8f3f560430feeb87cf5d922ce45b563ff012349a57b283577bf292ae9a649fe079816
@@ -1,5 +1,5 @@
1
1
  module Esperanto
2
2
  module Source
3
- VERSION = '0.6.28.1'
3
+ VERSION = '0.6.29'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*
2
- esperanto.js v0.6.28 - 2015-04-15
2
+ esperanto.js v0.6.29 - 2015-04-18
3
3
  http://esperantojs.org
4
4
 
5
5
  Released under the MIT License.
@@ -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
- var src_SourceMap = SourceMap;
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 src_SourceMap({
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 ? utils_getRelativePath__getRelativePath( options.file, source.filename ) : source.filename;
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
- var src_Bundle = Bundle;
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, i;
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
- for ( i = 0; i < value.length; i += 1 ) {
355
- result += encodeInteger( value[i] );
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 utils_encode = encode;
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 utils_encode( arr );
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 src_SourceMap({
559
+ return new SourceMap({
561
560
  file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
562
- sources: [ options.source ? utils_getRelativePath__getRelativePath( options.file || '', options.source ) : null ],
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 = src_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 ast_walk__context = {
941
- skip: function() {return ast_walk__context.shouldSkip = true}
937
+ var walk__context = {
938
+ skip: function() {return walk__context.shouldSkip = true}
942
939
  };
943
940
 
944
- var ast_walk__childKeys = {};
941
+ var walk__childKeys = {};
945
942
 
946
- var ast_walk__toString = Object.prototype.toString;
943
+ var walk__toString = Object.prototype.toString;
947
944
 
948
945
  function isArray ( thing ) {
949
- return ast_walk__toString.call( thing ) === '[object Array]';
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
- ast_walk__context.shouldSkip = false;
957
- enter.call( ast_walk__context, node, parent );
958
- if ( ast_walk__context.shouldSkip ) return;
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 = ast_walk__childKeys[ node.type ] || (
962
- ast_walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
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;
@@ -1412,7 +1409,7 @@
1412
1409
  });
1413
1410
  });
1414
1411
  }
1415
- return utils_hasOwnProp.call( importedNames, name );
1412
+ return hasOwnProp.call( importedNames, name );
1416
1413
  }
1417
1414
 
1418
1415
  walk( mod.ast, {
@@ -1464,7 +1461,7 @@
1464
1461
  }
1465
1462
 
1466
1463
  function checkName ( name ) {
1467
- if ( utils_hasOwnProp.call( usedNames, name ) ) {
1464
+ if ( hasOwnProp.call( usedNames, name ) ) {
1468
1465
  throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
1469
1466
  }
1470
1467
 
@@ -1511,7 +1508,7 @@
1511
1508
  var toRemove = [];
1512
1509
 
1513
1510
  var mod = {
1514
- body: new magic_string( code ),
1511
+ body: new MagicString( code ),
1515
1512
  ast: ast || ( acorn.parse( code, {
1516
1513
  ecmaVersion: 6,
1517
1514
  sourceType: 'module',
@@ -1560,7 +1557,7 @@
1560
1557
  moduleId = x.path;
1561
1558
 
1562
1559
  // use existing value
1563
- if ( utils_hasOwnProp.call( nameById, moduleId ) ) {
1560
+ if ( hasOwnProp.call( nameById, moduleId ) ) {
1564
1561
  x.name = nameById[ moduleId ];
1565
1562
  return;
1566
1563
  }
@@ -1569,7 +1566,7 @@
1569
1566
  if ( userFn && ( name = userFn( moduleId ) ) ) {
1570
1567
  name = sanitize( name );
1571
1568
 
1572
- if ( utils_hasOwnProp.call( usedNames, name ) ) {
1569
+ if ( hasOwnProp.call( usedNames, name ) ) {
1573
1570
  // TODO write a test for this
1574
1571
  throw new Error( (("Naming collision: module " + moduleId) + (" cannot be called " + name) + "") );
1575
1572
  }
@@ -1586,7 +1583,7 @@
1586
1583
  while ( i-- > 0 ) {
1587
1584
  candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
1588
1585
 
1589
- if ( !utils_hasOwnProp.call( usedNames, candidate ) ) {
1586
+ if ( !hasOwnProp.call( usedNames, candidate ) ) {
1590
1587
  name = candidate;
1591
1588
  break;
1592
1589
  }
@@ -1605,13 +1602,13 @@
1605
1602
  // use inferred names for default imports, wherever they
1606
1603
  // don't clash with path-based names
1607
1604
  imports.forEach( function(x ) {
1608
- if ( x.as && !utils_hasOwnProp.call( usedNames, x.as ) ) {
1605
+ if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
1609
1606
  inferredNames[ x.path ] = x.as;
1610
1607
  }
1611
1608
  });
1612
1609
 
1613
1610
  imports.forEach( function(x ) {
1614
- if ( utils_hasOwnProp.call( inferredNames, x.path ) ) {
1611
+ if ( hasOwnProp.call( inferredNames, x.path ) ) {
1615
1612
  x.name = inferredNames[ x.path ];
1616
1613
  }
1617
1614
  });
@@ -1665,7 +1662,7 @@
1665
1662
 
1666
1663
  var ABSOLUTE_PATH = /^(?:[A-Z]:)?[\/\\]/i;
1667
1664
 
1668
- var utils_packageResult__warned = {};
1665
+ var packageResult__warned = {};
1669
1666
 
1670
1667
  function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
1671
1668
  // wrap output
@@ -1700,7 +1697,7 @@
1700
1697
  map = body.generateMap({
1701
1698
  includeContent: true,
1702
1699
  file: sourceMapFile,
1703
- source: ( sourceMapFile && !isBundle ) ? utils_packageResult__getRelativePath( sourceMapFile, options.sourceMapSource ) : null
1700
+ source: ( sourceMapFile && !isBundle ) ? packageResult__getRelativePath( sourceMapFile, options.sourceMapSource ) : null
1704
1701
  });
1705
1702
 
1706
1703
  if ( options.sourceMap === 'inline' ) {
@@ -1717,9 +1714,9 @@
1717
1714
  code: code,
1718
1715
  map: map,
1719
1716
  toString: function () {
1720
- if ( !utils_packageResult__warned[ methodName ] ) {
1717
+ if ( !packageResult__warned[ methodName ] ) {
1721
1718
  console.log( (("Warning: esperanto." + methodName) + "() returns an object with a 'code' property. You should use this instead of using the returned value directly") );
1722
- utils_packageResult__warned[ methodName ] = true;
1719
+ packageResult__warned[ methodName ] = true;
1723
1720
  }
1724
1721
 
1725
1722
  return code;
@@ -1727,7 +1724,7 @@
1727
1724
  };
1728
1725
  }
1729
1726
 
1730
- function utils_packageResult__getRelativePath ( from, to ) {
1727
+ function packageResult__getRelativePath ( from, to ) {
1731
1728
  var fromParts, toParts, i;
1732
1729
 
1733
1730
  fromParts = splitPath( from );
@@ -1735,6 +1732,10 @@
1735
1732
 
1736
1733
  fromParts.pop(); // get dirname
1737
1734
 
1735
+ while ( fromParts[0] === '.' ) {
1736
+ fromParts.shift();
1737
+ }
1738
+
1738
1739
  while ( fromParts[0] === toParts[0] ) {
1739
1740
  fromParts.shift();
1740
1741
  toParts.shift();
@@ -1855,9 +1856,9 @@
1855
1856
  }
1856
1857
 
1857
1858
  var intro = (("\
1858
- \ndefine(" + (processName(name))) + ("" + (processIds(ids))) + ("function (" + (names.join( ', ' ))) + ") {\
1859
+ \n define(" + (processName(name))) + ("" + (processIds(ids))) + ("function (" + (names.join( ', ' ))) + ") {\
1859
1860
  \n\
1860
- \n");
1861
+ \n ");
1861
1862
 
1862
1863
  if ( useStrict ) {
1863
1864
  intro += (("" + indentStr) + "'use strict';\n\n");
@@ -1866,7 +1867,7 @@
1866
1867
  return intro;
1867
1868
  }
1868
1869
 
1869
- function defaultsMode_amd__amd ( mod, options ) {
1870
+ function amd__amd ( mod, options ) {
1870
1871
  mod.imports.forEach( function(x ) {
1871
1872
  mod.body.remove( x.start, x.next );
1872
1873
  });
@@ -1890,11 +1891,11 @@
1890
1891
  return packageResult( mod, mod.body, options, 'toAmd' );
1891
1892
  }
1892
1893
 
1893
- function defaultsMode_cjs__cjs ( mod, options ) {
1894
+ function cjs__cjs ( mod, options ) {
1894
1895
  var seen = {};
1895
1896
 
1896
1897
  mod.imports.forEach( function(x ) {
1897
- if ( !utils_hasOwnProp.call( seen, x.path ) ) {
1898
+ if ( !hasOwnProp.call( seen, x.path ) ) {
1898
1899
  var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
1899
1900
  mod.body.replace( x.start, x.end, replacement );
1900
1901
 
@@ -1934,12 +1935,12 @@
1934
1935
  if ( !hasExports && !imports.length ) {
1935
1936
  intro =
1936
1937
  (("(function (factory) {\
1937
- \n !(typeof exports === 'object' && typeof module !== 'undefined') &&\
1938
- \n typeof define === 'function' && define.amd ? define(" + (processName(amdName))) + ("factory) :\
1939
- \n factory()\
1940
- \n }(function () {" + useStrictPragma) + "\
1938
+ \n !(typeof exports === 'object' && typeof module !== 'undefined') &&\
1939
+ \n typeof define === 'function' && define.amd ? define(" + (processName(amdName))) + ("factory) :\
1940
+ \n factory()\
1941
+ \n }(function () {" + useStrictPragma) + "\
1941
1942
  \n\
1942
- \n ");
1943
+ \n ");
1943
1944
  }
1944
1945
 
1945
1946
  else {
@@ -1963,7 +1964,7 @@
1963
1964
  defaultsBlock = externalDefaults.map( function(x )
1964
1965
  {return '\t' + ( x.needsNamed ? (("var " + (x.name)) + "__default") : x.name ) +
1965
1966
  ((" = ('default' in " + (x.name)) + (" ? " + (x.name)) + ("['default'] : " + (x.name)) + ");")}
1966
- ).join('\n') + '\n\n';
1967
+ ).join('\n') + '\n\n';
1967
1968
  }
1968
1969
  } else {
1969
1970
  amdExport = (("define(" + (processName(amdName))) + ("" + (processIds(ids))) + "factory)");
@@ -1975,12 +1976,12 @@
1975
1976
 
1976
1977
  intro =
1977
1978
  (("(function (global, factory) {\
1978
- \n typeof exports === 'object' && typeof module !== 'undefined' ? " + cjsExport) + (" :\
1979
- \n typeof define === 'function' && define.amd ? " + amdExport) + (" :\
1980
- \n " + globalExport) + ("\
1981
- \n }(this, function (" + (names.join( ', ' ))) + (") {" + useStrictPragma) + ("\
1979
+ \n typeof exports === 'object' && typeof module !== 'undefined' ? " + cjsExport) + (" :\
1980
+ \n typeof define === 'function' && define.amd ? " + amdExport) + (" :\
1981
+ \n " + globalExport) + ("\
1982
+ \n }(this, function (" + (names.join( ', ' ))) + (") {" + useStrictPragma) + ("\
1982
1983
  \n\
1983
- \n " + defaultsBlock) + "");
1984
+ \n " + defaultsBlock) + "");
1984
1985
 
1985
1986
  }
1986
1987
 
@@ -2004,17 +2005,15 @@
2004
2005
  EsperantoError.prototype.constructor = EsperantoError;
2005
2006
  EsperantoError.prototype.name = 'EsperantoError';
2006
2007
 
2007
- var utils_EsperantoError = EsperantoError;
2008
-
2009
2008
  function requireName ( options ) {
2010
2009
  if ( !options.name ) {
2011
- throw new utils_EsperantoError( 'You must supply a `name` option for UMD modules', {
2010
+ throw new EsperantoError( 'You must supply a `name` option for UMD modules', {
2012
2011
  code: 'MISSING_NAME'
2013
2012
  });
2014
2013
  }
2015
2014
  }
2016
2015
 
2017
- function defaultsMode_umd__umd ( mod, options ) {
2016
+ function umd__umd ( mod, options ) {
2018
2017
  requireName( options );
2019
2018
 
2020
2019
  mod.imports.forEach( function(x ) {
@@ -2039,9 +2038,9 @@
2039
2038
  }
2040
2039
 
2041
2040
  var defaultsMode = {
2042
- amd: defaultsMode_amd__amd,
2043
- cjs: defaultsMode_cjs__cjs,
2044
- umd: defaultsMode_umd__umd
2041
+ amd: amd__amd,
2042
+ cjs: cjs__cjs,
2043
+ umd: umd__umd
2045
2044
  };
2046
2045
 
2047
2046
  function gatherImports ( imports ) {
@@ -2138,14 +2137,14 @@
2138
2137
 
2139
2138
  var name = assignee.name;
2140
2139
 
2141
- if ( utils_hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
2140
+ if ( hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
2142
2141
  throw new Error( ( isNamespaceAssignment ? namespaceMessage : bindingMessage ) + '`' + name + '`' );
2143
2142
  }
2144
2143
  }
2145
2144
 
2146
2145
  function replaceIdentifiers ( body, node, identifierReplacements, scope ) {
2147
2146
  var name = node.name;
2148
- var replacement = utils_hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
2147
+ var replacement = hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
2149
2148
 
2150
2149
  // TODO unchanged identifiers shouldn't have got this far -
2151
2150
  // remove the `replacement !== name` safeguard once that's the case
@@ -2176,7 +2175,7 @@
2176
2175
  return; // shadows an export
2177
2176
  }
2178
2177
 
2179
- if ( exports && utils_hasOwnProp.call( exports, name ) ) {
2178
+ if ( exports && hasOwnProp.call( exports, name ) ) {
2180
2179
  var exportAs = exports[ name ];
2181
2180
 
2182
2181
  if ( !!capturedUpdates ) {
@@ -2191,7 +2190,7 @@
2191
2190
  if ( parent.type !== 'ExpressionStatement' ) {
2192
2191
  if ( !node.prefix ) {
2193
2192
  suffix += ((", " + name) + (" " + (node.operator === '++' ? '-' : '+')) + " 1")
2194
- }
2193
+ }
2195
2194
  prefix += ("( ");
2196
2195
  suffix += (" )");
2197
2196
  }
@@ -2364,7 +2363,7 @@
2364
2363
  }
2365
2364
 
2366
2365
  function deconflict ( name, declared ) {
2367
- while ( utils_hasOwnProp.call( declared, name ) ) {
2366
+ while ( hasOwnProp.call( declared, name ) ) {
2368
2367
  name = '_' + name;
2369
2368
  }
2370
2369
 
@@ -2395,7 +2394,7 @@
2395
2394
 
2396
2395
  // Create block of require statements
2397
2396
  var importBlock = mod.imports.map( function(x ) {
2398
- if ( !utils_hasOwnProp.call( seen, x.path ) ) {
2397
+ if ( !hasOwnProp.call( seen, x.path ) ) {
2399
2398
  seen[ x.path ] = true;
2400
2399
 
2401
2400
  if ( x.isEmpty ) {
@@ -2453,7 +2452,7 @@
2453
2452
  strictMode: strictMode
2454
2453
  };
2455
2454
 
2456
- function builders_defaultsMode_amd__amd ( bundle, options ) {
2455
+ function defaultsMode_amd__amd ( bundle, options ) {
2457
2456
  var defaultName = bundle.entryModule.identifierReplacements.default;
2458
2457
  if ( defaultName ) {
2459
2458
  bundle.body.append( (("\n\nreturn " + defaultName) + ";") );
@@ -2470,7 +2469,7 @@
2470
2469
  return packageResult( bundle, bundle.body, options, 'toAmd', true );
2471
2470
  }
2472
2471
 
2473
- function builders_defaultsMode_cjs__cjs ( bundle, options ) {
2472
+ function defaultsMode_cjs__cjs ( bundle, options ) {
2474
2473
  var importBlock = bundle.externalModules.map( function(x ) {
2475
2474
  return (("var " + (x.name)) + (" = " + (req(x.id))) + ";");
2476
2475
  }).join( '\n' );
@@ -2491,7 +2490,7 @@
2491
2490
  return packageResult( bundle, bundle.body, options, 'toCjs', true );
2492
2491
  }
2493
2492
 
2494
- function builders_defaultsMode_umd__umd ( bundle, options ) {
2493
+ function defaultsMode_umd__umd ( bundle, options ) {
2495
2494
  requireName( options );
2496
2495
 
2497
2496
  var entry = bundle.entryModule;
@@ -2515,9 +2514,9 @@
2515
2514
  }
2516
2515
 
2517
2516
  var builders_defaultsMode = {
2518
- amd: builders_defaultsMode_amd__amd,
2519
- cjs: builders_defaultsMode_cjs__cjs,
2520
- umd: builders_defaultsMode_umd__umd
2517
+ amd: defaultsMode_amd__amd,
2518
+ cjs: defaultsMode_cjs__cjs,
2519
+ umd: defaultsMode_umd__umd
2521
2520
  };
2522
2521
 
2523
2522
  function getExportBlock ( entry ) {
@@ -2729,7 +2728,7 @@
2729
2728
 
2730
2729
  bundle.modules.forEach( function(mod ) {
2731
2730
  mod.imports.forEach( function(x ) {
2732
- if ( utils_hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
2731
+ if ( hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
2733
2732
  throw new Error( 'You can only have named external imports in strict mode (pass `strict: true`)' );
2734
2733
  }
2735
2734
  });
data/vendor/esperanto.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- esperanto.js v0.6.28 - 2015-04-15
2
+ esperanto.js v0.6.29 - 2015-04-18
3
3
  http://esperantojs.org
4
4
 
5
5
  Released under the MIT License.
@@ -7,13 +7,12 @@
7
7
 
8
8
  'use strict';
9
9
 
10
+ var path = require('path');
11
+ var sander = require('sander');
10
12
  var acorn = require('acorn');
11
13
  var MagicString = require('magic-string');
12
- var _path = require('path');
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 ast_walk__context = {
43
- skip: function() {return ast_walk__context.shouldSkip = true}
41
+ var walk__context = {
42
+ skip: function() {return walk__context.shouldSkip = true}
44
43
  };
45
44
 
46
- var ast_walk__childKeys = {};
45
+ var walk__childKeys = {};
47
46
 
48
- var ast_walk__toString = Object.prototype.toString;
47
+ var walk__toString = Object.prototype.toString;
49
48
 
50
49
  function isArray ( thing ) {
51
- return ast_walk__toString.call( thing ) === '[object Array]';
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
- ast_walk__context.shouldSkip = false;
59
- enter.call( ast_walk__context, node, parent );
60
- if ( ast_walk__context.shouldSkip ) return;
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 = ast_walk__childKeys[ node.type ] || (
64
- ast_walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
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;
@@ -514,7 +513,7 @@ function getUnscopedNames ( mod ) {
514
513
  });
515
514
  });
516
515
  }
517
- return utils_hasOwnProp.call( importedNames, name );
516
+ return hasOwnProp.call( importedNames, name );
518
517
  }
519
518
 
520
519
  walk( mod.ast, {
@@ -566,7 +565,7 @@ function disallowConflictingImports ( imports ) {
566
565
  }
567
566
 
568
567
  function checkName ( name ) {
569
- if ( utils_hasOwnProp.call( usedNames, name ) ) {
568
+ if ( hasOwnProp.call( usedNames, name ) ) {
570
569
  throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
571
570
  }
572
571
 
@@ -662,7 +661,7 @@ function determineImportNames ( imports, userFn, usedNames ) {
662
661
  moduleId = x.path;
663
662
 
664
663
  // use existing value
665
- if ( utils_hasOwnProp.call( nameById, moduleId ) ) {
664
+ if ( hasOwnProp.call( nameById, moduleId ) ) {
666
665
  x.name = nameById[ moduleId ];
667
666
  return;
668
667
  }
@@ -671,7 +670,7 @@ function determineImportNames ( imports, userFn, usedNames ) {
671
670
  if ( userFn && ( name = userFn( moduleId ) ) ) {
672
671
  name = sanitize( name );
673
672
 
674
- if ( utils_hasOwnProp.call( usedNames, name ) ) {
673
+ if ( hasOwnProp.call( usedNames, name ) ) {
675
674
  // TODO write a test for this
676
675
  throw new Error( (("Naming collision: module " + moduleId) + (" cannot be called " + name) + "") );
677
676
  }
@@ -688,7 +687,7 @@ function determineImportNames ( imports, userFn, usedNames ) {
688
687
  while ( i-- > 0 ) {
689
688
  candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
690
689
 
691
- if ( !utils_hasOwnProp.call( usedNames, candidate ) ) {
690
+ if ( !hasOwnProp.call( usedNames, candidate ) ) {
692
691
  name = candidate;
693
692
  break;
694
693
  }
@@ -707,13 +706,13 @@ function determineImportNames ( imports, userFn, usedNames ) {
707
706
  // use inferred names for default imports, wherever they
708
707
  // don't clash with path-based names
709
708
  imports.forEach( function(x ) {
710
- if ( x.as && !utils_hasOwnProp.call( usedNames, x.as ) ) {
709
+ if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
711
710
  inferredNames[ x.path ] = x.as;
712
711
  }
713
712
  });
714
713
 
715
714
  imports.forEach( function(x ) {
716
- if ( utils_hasOwnProp.call( inferredNames, x.path ) ) {
715
+ if ( hasOwnProp.call( inferredNames, x.path ) ) {
717
716
  x.name = inferredNames[ x.path ];
718
717
  }
719
718
  });
@@ -761,7 +760,7 @@ function sortModules ( entry, moduleLookup ) {
761
760
  function visit ( mod ) {
762
761
  // ignore external modules, and modules we've
763
762
  // already included
764
- if ( !mod || utils_hasOwnProp.call( seen, mod.id ) ) {
763
+ if ( !mod || hasOwnProp.call( seen, mod.id ) ) {
765
764
  return;
766
765
  }
767
766
 
@@ -791,7 +790,7 @@ function resolveChains ( modules, moduleLookup ) {
791
790
  if ( s.isBatch ) {
792
791
  // if this is an internal module, we need to tell that module that
793
792
  // it needs to export an object full of getters
794
- if ( utils_hasOwnProp.call( moduleLookup, x.id ) ) {
793
+ if ( hasOwnProp.call( moduleLookup, x.id ) ) {
795
794
  moduleLookup[ x.id ]._exportsNamespace = true;
796
795
  }
797
796
 
@@ -806,7 +805,7 @@ function resolveChains ( modules, moduleLookup ) {
806
805
  if ( !x.specifiers ) return;
807
806
 
808
807
  x.specifiers.forEach( function(s ) {
809
- if ( utils_hasOwnProp.call( origin, s.name ) ) {
808
+ if ( hasOwnProp.call( origin, s.name ) ) {
810
809
  chains[ (("" + (mod.id)) + ("@" + (s.name)) + "") ] = origin[ s.name ];
811
810
  }
812
811
  });
@@ -844,7 +843,7 @@ function getUniqueNames ( bundle ) {
844
843
  // infer names from default imports - e.g. with `import _ from './utils'`,
845
844
  // use '_' instead of generating a name from 'utils'
846
845
  function inferName ( x ) {
847
- if ( x.isDefault && !utils_hasOwnProp.call( names, x.id ) && !utils_hasOwnProp.call( used, x.as ) ) {
846
+ if ( x.isDefault && !hasOwnProp.call( names, x.id ) && !hasOwnProp.call( used, x.as ) ) {
848
847
  names[ x.id ] = x.as;
849
848
  used[ x.as ] = true;
850
849
  }
@@ -857,7 +856,7 @@ function getUniqueNames ( bundle ) {
857
856
  // introducing conflicts
858
857
  modules.concat( externalModules ).forEach( function(mod ) {
859
858
  // is this already named?
860
- if ( utils_hasOwnProp.call( names, mod.id ) ) {
859
+ if ( hasOwnProp.call( names, mod.id ) ) {
861
860
  mod.name = names[ mod.id ];
862
861
  return;
863
862
  }
@@ -869,12 +868,12 @@ function getUniqueNames ( bundle ) {
869
868
  while ( i-- ) {
870
869
  name = sanitize( parts.slice( i ).join( '_' ) );
871
870
 
872
- if ( !utils_hasOwnProp.call( used, name ) ) {
871
+ if ( !hasOwnProp.call( used, name ) ) {
873
872
  break;
874
873
  }
875
874
  }
876
875
 
877
- while ( utils_hasOwnProp.call( used, name ) ) {
876
+ while ( hasOwnProp.call( used, name ) ) {
878
877
  name = '_' + name;
879
878
  }
880
879
 
@@ -945,7 +944,7 @@ function topLevelScopeConflicts ( bundle ) {
945
944
 
946
945
  // merge this module's top scope with bundle top scope
947
946
  names.forEach( function(name ) {
948
- if ( utils_hasOwnProp.call( inBundle, name ) ) {
947
+ if ( hasOwnProp.call( inBundle, name ) ) {
949
948
  conflicts[ name ] = true;
950
949
  } else {
951
950
  inBundle[ name ] = true;
@@ -969,11 +968,11 @@ function populateIdentifierReplacements ( bundle ) {
969
968
  var result;
970
969
 
971
970
  if ( x.hasDeclaration && x.name ) {
972
- result = utils_hasOwnProp.call( conflicts, x.name ) || otherModulesDeclare( mod, x.name ) ?
971
+ result = hasOwnProp.call( conflicts, x.name ) || otherModulesDeclare( mod, x.name ) ?
973
972
  (("" + (mod.name)) + ("__" + (x.name)) + "") :
974
973
  x.name;
975
974
  } else {
976
- result = utils_hasOwnProp.call( conflicts, mod.name ) || ( x.value !== mod.name && ~mod.ast._topLevelNames.indexOf( mod.name )) || otherModulesDeclare( mod, mod.name ) ?
975
+ result = hasOwnProp.call( conflicts, mod.name ) || ( x.value !== mod.name && ~mod.ast._topLevelNames.indexOf( mod.name )) || otherModulesDeclare( mod, mod.name ) ?
977
976
  (("" + (mod.name)) + "__default") :
978
977
  mod.name;
979
978
  }
@@ -988,7 +987,7 @@ function populateIdentifierReplacements ( bundle ) {
988
987
  var moduleIdentifiers = mod.identifierReplacements;
989
988
 
990
989
  mod.ast._topLevelNames.forEach( function(n ) {
991
- moduleIdentifiers[n] = utils_hasOwnProp.call( conflicts, n ) ?
990
+ moduleIdentifiers[n] = hasOwnProp.call( conflicts, n ) ?
992
991
  (("" + (mod.name)) + ("__" + n) + "") :
993
992
  n;
994
993
  });
@@ -1000,7 +999,7 @@ function populateIdentifierReplacements ( bundle ) {
1000
999
  return;
1001
1000
  }
1002
1001
 
1003
- externalModule = utils_hasOwnProp.call( bundle.externalModuleLookup, x.id ) && bundle.externalModuleLookup[ x.id ];
1002
+ externalModule = hasOwnProp.call( bundle.externalModuleLookup, x.id ) && bundle.externalModuleLookup[ x.id ];
1004
1003
 
1005
1004
  x.specifiers.forEach( function(s ) {
1006
1005
  var moduleId, mod, moduleName, specifierName, replacement, hash, isChained, separatorIndex;
@@ -1016,7 +1015,7 @@ function populateIdentifierReplacements ( bundle ) {
1016
1015
 
1017
1016
  // If this is a chained import, get the origin
1018
1017
  hash = (("" + moduleId) + ("@" + specifierName) + "");
1019
- while ( utils_hasOwnProp.call( bundle.chains, hash ) ) {
1018
+ while ( hasOwnProp.call( bundle.chains, hash ) ) {
1020
1019
  hash = bundle.chains[ hash ];
1021
1020
  isChained = true;
1022
1021
  }
@@ -1044,7 +1043,7 @@ function populateIdentifierReplacements ( bundle ) {
1044
1043
  replacement = mod.identifierReplacements.default;
1045
1044
  }
1046
1045
  } else if ( !externalModule ) {
1047
- replacement = utils_hasOwnProp.call( conflicts, specifierName ) ?
1046
+ replacement = hasOwnProp.call( conflicts, specifierName ) ?
1048
1047
  (("" + moduleName) + ("__" + specifierName) + "") :
1049
1048
  specifierName;
1050
1049
  } else {
@@ -1070,7 +1069,7 @@ function populateIdentifierReplacements ( bundle ) {
1070
1069
  continue;
1071
1070
  }
1072
1071
 
1073
- if ( utils_hasOwnProp.call( otherMod.ast._declared, replacement ) ) {
1072
+ if ( hasOwnProp.call( otherMod.ast._declared, replacement ) ) {
1074
1073
  return true;
1075
1074
  }
1076
1075
  }
@@ -1162,14 +1161,14 @@ function disallowIllegalReassignment ( node, importedBindings, importedNamespace
1162
1161
 
1163
1162
  var name = assignee.name;
1164
1163
 
1165
- if ( utils_hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
1164
+ if ( hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
1166
1165
  throw new Error( ( isNamespaceAssignment ? namespaceMessage : bindingMessage ) + '`' + name + '`' );
1167
1166
  }
1168
1167
  }
1169
1168
 
1170
1169
  function replaceIdentifiers ( body, node, identifierReplacements, scope ) {
1171
1170
  var name = node.name;
1172
- var replacement = utils_hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
1171
+ var replacement = hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
1173
1172
 
1174
1173
  // TODO unchanged identifiers shouldn't have got this far -
1175
1174
  // remove the `replacement !== name` safeguard once that's the case
@@ -1200,7 +1199,7 @@ function rewriteExportAssignments ( body, node, parent, exports, scope, captured
1200
1199
  return; // shadows an export
1201
1200
  }
1202
1201
 
1203
- if ( exports && utils_hasOwnProp.call( exports, name ) ) {
1202
+ if ( exports && hasOwnProp.call( exports, name ) ) {
1204
1203
  var exportAs = exports[ name ];
1205
1204
 
1206
1205
  if ( !!capturedUpdates ) {
@@ -1297,11 +1296,11 @@ function exportCapturedUpdate ( c ) {
1297
1296
  return ((" exports." + (c.exportAs)) + (" = " + (c.name)) + ";");
1298
1297
  }
1299
1298
 
1300
- function combine_transformBody__transformBody ( bundle, mod, body ) {
1299
+ function transformBody__transformBody ( bundle, mod, body ) {
1301
1300
  var identifierReplacements = mod.identifierReplacements;
1302
1301
  var importedBindings = (importedNamespaces = getReadOnlyIdentifiers( mod.imports ))[0], importedNamespaces = importedNamespaces[1];
1303
1302
 
1304
- var exportNames = utils_hasOwnProp.call( bundle.exports, mod.id ) && bundle.exports[ mod.id ];
1303
+ var exportNames = hasOwnProp.call( bundle.exports, mod.id ) && bundle.exports[ mod.id ];
1305
1304
 
1306
1305
  traverseAst( mod.ast, body, identifierReplacements, importedBindings, importedNamespaces, exportNames );
1307
1306
 
@@ -1339,7 +1338,7 @@ function combine_transformBody__transformBody ( bundle, mod, body ) {
1339
1338
  if ( name === identifierReplacements.default ) {
1340
1339
  body.remove( x.start, x.end );
1341
1340
  } else {
1342
- var original = utils_hasOwnProp.call( identifierReplacements, name ) ? identifierReplacements[ name ] : name;
1341
+ var original = hasOwnProp.call( identifierReplacements, name ) ? identifierReplacements[ name ] : name;
1343
1342
  body.replace( x.start, x.end, (("var " + (identifierReplacements.default)) + (" = " + original) + ";") );
1344
1343
  }
1345
1344
  }
@@ -1445,8 +1444,8 @@ function combine ( bundle ) {
1445
1444
  });
1446
1445
 
1447
1446
  bundle.body.addSource({
1448
- filename: _path.resolve( bundle.base, mod.relativePath ),
1449
- content: combine_transformBody__transformBody( bundle, mod, mod.body ),
1447
+ filename: path.resolve( bundle.base, mod.relativePath ),
1448
+ content: transformBody__transformBody( bundle, mod, mod.body ),
1450
1449
  indentExclusionRanges: mod.ast._templateLiteralRanges
1451
1450
  });
1452
1451
  });
@@ -1519,7 +1518,7 @@ function getModule ( mod ) {
1519
1518
  return mod;
1520
1519
  }
1521
1520
 
1522
- var bundler_getBundle__Promise = sander.Promise;
1521
+ var getBundle__Promise = sander.Promise;
1523
1522
 
1524
1523
  function getBundle ( options ) {
1525
1524
  var entry = options.entry.replace( /\.js$/, '' );
@@ -1529,7 +1528,7 @@ function getBundle ( options ) {
1529
1528
  var promiseByPath = {};
1530
1529
  var skip = options.skip;
1531
1530
  var names = options.names;
1532
- var base = ( options.base ? _path.resolve( options.base ) : process.cwd() ) + '/';
1531
+ var base = ( options.base ? path.resolve( options.base ) : process.cwd() ) + '/';
1533
1532
  var externalModules = [];
1534
1533
  var externalModuleLookup = {};
1535
1534
 
@@ -1568,12 +1567,12 @@ function getBundle ( options ) {
1568
1567
  });
1569
1568
 
1570
1569
  function fetchModule ( moduleId, relativePath ) {
1571
- var absolutePath = _path.resolve( base, relativePath );
1570
+ var absolutePath = path.resolve( base, relativePath );
1572
1571
 
1573
- if ( !utils_hasOwnProp.call( promiseByPath, relativePath ) ) {
1572
+ if ( !hasOwnProp.call( promiseByPath, relativePath ) ) {
1574
1573
  promiseByPath[ relativePath ] = (
1575
- utils_hasOwnProp.call( userModules, relativePath ) ?
1576
- bundler_getBundle__Promise.resolve( userModules[ relativePath ] ) :
1574
+ hasOwnProp.call( userModules, relativePath ) ?
1575
+ getBundle__Promise.resolve( userModules[ relativePath ] ) :
1577
1576
  sander.readFile( absolutePath ).then( String )
1578
1577
  ).then( function ( source ) {
1579
1578
  var code, ast;
@@ -1620,7 +1619,7 @@ function getBundle ( options ) {
1620
1619
 
1621
1620
  return resolvePath( base, userModules, x.id, absolutePath, options.resolvePath ).then( function(relativePath ) {
1622
1621
  // short-circuit cycles
1623
- if ( utils_hasOwnProp.call( promiseByPath, relativePath ) ) {
1622
+ if ( hasOwnProp.call( promiseByPath, relativePath ) ) {
1624
1623
  return;
1625
1624
  }
1626
1625
 
@@ -1628,7 +1627,7 @@ function getBundle ( options ) {
1628
1627
  }, function handleError ( err ) {
1629
1628
  if ( err.code === 'ENOENT' ) {
1630
1629
  // Most likely an external module
1631
- if ( !utils_hasOwnProp.call( externalModuleLookup, x.id ) ) {
1630
+ if ( !hasOwnProp.call( externalModuleLookup, x.id ) ) {
1632
1631
  var externalModule = {
1633
1632
  id: x.id
1634
1633
  };
@@ -1642,7 +1641,7 @@ function getBundle ( options ) {
1642
1641
  } );
1643
1642
  });
1644
1643
 
1645
- return bundler_getBundle__Promise.all( promises );
1644
+ return getBundle__Promise.all( promises );
1646
1645
  });
1647
1646
  }
1648
1647
 
@@ -1652,9 +1651,9 @@ function getBundle ( options ) {
1652
1651
 
1653
1652
  function resolvePath ( base, userModules, moduleId, importerPath, resolver ) {
1654
1653
  return tryPath( base, moduleId + '.js', userModules )
1655
- .catch( function() {return tryPath( base, moduleId + _path.sep + 'index.js', userModules )} )
1654
+ .catch( function() {return tryPath( base, moduleId + path.sep + 'index.js', userModules )} )
1656
1655
  .catch( function ( err ) {
1657
- var resolvedPromise = resolver && bundler_getBundle__Promise.resolve( resolver( moduleId, importerPath ) );
1656
+ var resolvedPromise = resolver && getBundle__Promise.resolve( resolver( moduleId, importerPath ) );
1658
1657
 
1659
1658
  if ( resolvedPromise ) {
1660
1659
  return resolvedPromise.then( function(resolvedPath ) {
@@ -1674,8 +1673,8 @@ function resolvePath ( base, userModules, moduleId, importerPath, resolver ) {
1674
1673
  }
1675
1674
 
1676
1675
  function tryPath ( base, filename, userModules ) {
1677
- if ( utils_hasOwnProp.call( userModules, filename ) ) {
1678
- return bundler_getBundle__Promise.resolve( filename );
1676
+ if ( hasOwnProp.call( userModules, filename ) ) {
1677
+ return getBundle__Promise.resolve( filename );
1679
1678
  }
1680
1679
  return sander.stat( base, filename ).then( function() {return filename} );
1681
1680
  }
@@ -1732,7 +1731,7 @@ function transformExportDeclaration ( declaration, body ) {
1732
1731
 
1733
1732
  var ABSOLUTE_PATH = /^(?:[A-Z]:)?[\/\\]/i;
1734
1733
 
1735
- var utils_packageResult__warned = {};
1734
+ var packageResult__warned = {};
1736
1735
 
1737
1736
  function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
1738
1737
  // wrap output
@@ -1784,9 +1783,9 @@ function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
1784
1783
  code: code,
1785
1784
  map: map,
1786
1785
  toString: function () {
1787
- if ( !utils_packageResult__warned[ methodName ] ) {
1786
+ if ( !packageResult__warned[ methodName ] ) {
1788
1787
  console.log( (("Warning: esperanto." + methodName) + "() returns an object with a 'code' property. You should use this instead of using the returned value directly") );
1789
- utils_packageResult__warned[ methodName ] = true;
1788
+ packageResult__warned[ methodName ] = true;
1790
1789
  }
1791
1790
 
1792
1791
  return code;
@@ -1802,6 +1801,10 @@ function getRelativePath ( from, to ) {
1802
1801
 
1803
1802
  fromParts.pop(); // get dirname
1804
1803
 
1804
+ while ( fromParts[0] === '.' ) {
1805
+ fromParts.shift();
1806
+ }
1807
+
1805
1808
  while ( fromParts[0] === toParts[0] ) {
1806
1809
  fromParts.shift();
1807
1810
  toParts.shift();
@@ -1898,7 +1901,7 @@ function amdIntro (useStrict) {var name = useStrict.name, imports = useStrict.im
1898
1901
  return intro;
1899
1902
  }
1900
1903
 
1901
- function defaultsMode_amd__amd ( mod, options ) {
1904
+ function amd__amd ( mod, options ) {
1902
1905
  mod.imports.forEach( function(x ) {
1903
1906
  mod.body.remove( x.start, x.next );
1904
1907
  });
@@ -1922,11 +1925,11 @@ function defaultsMode_amd__amd ( mod, options ) {
1922
1925
  return packageResult( mod, mod.body, options, 'toAmd' );
1923
1926
  }
1924
1927
 
1925
- function defaultsMode_cjs__cjs ( mod, options ) {
1928
+ function cjs__cjs ( mod, options ) {
1926
1929
  var seen = {};
1927
1930
 
1928
1931
  mod.imports.forEach( function(x ) {
1929
- if ( !utils_hasOwnProp.call( seen, x.path ) ) {
1932
+ if ( !hasOwnProp.call( seen, x.path ) ) {
1930
1933
  var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
1931
1934
  mod.body.replace( x.start, x.end, replacement );
1932
1935
 
@@ -2036,17 +2039,15 @@ EsperantoError.prototype = new Error();
2036
2039
  EsperantoError.prototype.constructor = EsperantoError;
2037
2040
  EsperantoError.prototype.name = 'EsperantoError';
2038
2041
 
2039
- var utils_EsperantoError = EsperantoError;
2040
-
2041
2042
  function requireName ( options ) {
2042
2043
  if ( !options.name ) {
2043
- throw new utils_EsperantoError( 'You must supply a `name` option for UMD modules', {
2044
+ throw new EsperantoError( 'You must supply a `name` option for UMD modules', {
2044
2045
  code: 'MISSING_NAME'
2045
2046
  });
2046
2047
  }
2047
2048
  }
2048
2049
 
2049
- function defaultsMode_umd__umd ( mod, options ) {
2050
+ function umd__umd ( mod, options ) {
2050
2051
  requireName( options );
2051
2052
 
2052
2053
  mod.imports.forEach( function(x ) {
@@ -2071,9 +2072,9 @@ function defaultsMode_umd__umd ( mod, options ) {
2071
2072
  }
2072
2073
 
2073
2074
  var defaultsMode = {
2074
- amd: defaultsMode_amd__amd,
2075
- cjs: defaultsMode_cjs__cjs,
2076
- umd: defaultsMode_umd__umd
2075
+ amd: amd__amd,
2076
+ cjs: cjs__cjs,
2077
+ umd: umd__umd
2077
2078
  };
2078
2079
 
2079
2080
  function gatherImports ( imports ) {
@@ -2210,7 +2211,7 @@ function utils_transformBody__transformBody ( mod, body, options ) {
2210
2211
  }
2211
2212
 
2212
2213
  function deconflict ( name, declared ) {
2213
- while ( utils_hasOwnProp.call( declared, name ) ) {
2214
+ while ( hasOwnProp.call( declared, name ) ) {
2214
2215
  name = '_' + name;
2215
2216
  }
2216
2217
 
@@ -2241,7 +2242,7 @@ function strictMode_cjs__cjs ( mod, options ) {
2241
2242
 
2242
2243
  // Create block of require statements
2243
2244
  var importBlock = mod.imports.map( function(x ) {
2244
- if ( !utils_hasOwnProp.call( seen, x.path ) ) {
2245
+ if ( !hasOwnProp.call( seen, x.path ) ) {
2245
2246
  seen[ x.path ] = true;
2246
2247
 
2247
2248
  if ( x.isEmpty ) {
@@ -2299,7 +2300,7 @@ var moduleBuilders = {
2299
2300
  strictMode: strictMode
2300
2301
  };
2301
2302
 
2302
- function builders_defaultsMode_amd__amd ( bundle, options ) {
2303
+ function defaultsMode_amd__amd ( bundle, options ) {
2303
2304
  var defaultName = bundle.entryModule.identifierReplacements.default;
2304
2305
  if ( defaultName ) {
2305
2306
  bundle.body.append( (("\n\nreturn " + defaultName) + ";") );
@@ -2316,7 +2317,7 @@ function builders_defaultsMode_amd__amd ( bundle, options ) {
2316
2317
  return packageResult( bundle, bundle.body, options, 'toAmd', true );
2317
2318
  }
2318
2319
 
2319
- function builders_defaultsMode_cjs__cjs ( bundle, options ) {
2320
+ function defaultsMode_cjs__cjs ( bundle, options ) {
2320
2321
  var importBlock = bundle.externalModules.map( function(x ) {
2321
2322
  return (("var " + (x.name)) + (" = " + (req(x.id))) + ";");
2322
2323
  }).join( '\n' );
@@ -2337,7 +2338,7 @@ function builders_defaultsMode_cjs__cjs ( bundle, options ) {
2337
2338
  return packageResult( bundle, bundle.body, options, 'toCjs', true );
2338
2339
  }
2339
2340
 
2340
- function builders_defaultsMode_umd__umd ( bundle, options ) {
2341
+ function defaultsMode_umd__umd ( bundle, options ) {
2341
2342
  requireName( options );
2342
2343
 
2343
2344
  var entry = bundle.entryModule;
@@ -2361,9 +2362,9 @@ function builders_defaultsMode_umd__umd ( bundle, options ) {
2361
2362
  }
2362
2363
 
2363
2364
  var builders_defaultsMode = {
2364
- amd: builders_defaultsMode_amd__amd,
2365
- cjs: builders_defaultsMode_cjs__cjs,
2366
- umd: builders_defaultsMode_umd__umd
2365
+ amd: defaultsMode_amd__amd,
2366
+ cjs: defaultsMode_cjs__cjs,
2367
+ umd: defaultsMode_umd__umd
2367
2368
  };
2368
2369
 
2369
2370
  function getExportBlock ( entry ) {
@@ -2575,7 +2576,7 @@ var esperanto = {
2575
2576
 
2576
2577
  bundle.modules.forEach( function(mod ) {
2577
2578
  mod.imports.forEach( function(x ) {
2578
- if ( utils_hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
2579
+ if ( hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
2579
2580
  throw new Error( 'You can only have named external imports in strict mode (pass `strict: true`)' );
2580
2581
  }
2581
2582
  });
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.28.1
4
+ version: 0.6.29
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-04-16 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler