esperanto-source 0.6.31 → 0.6.32

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: 93187dc47b5708726735e42b9f323c6c2db3765a
4
- data.tar.gz: 7b5ebf1e30fefec34fecc41287a3edefb57d1be7
3
+ metadata.gz: fe03e0d4deb6d31d40cb2bc3a14ae685852d053b
4
+ data.tar.gz: 7b7a81937d5974e6267d3fc3292bd7d29ced3153
5
5
  SHA512:
6
- metadata.gz: c15eb97c1e1900df87cbfe4f4587b824a5e6a86d42792fa4748b836707244ad5954f314210d1bc05de7f5d83247023620f8c15b9b7394bc410856063931e0b8e
7
- data.tar.gz: 699ec2c9d140367d5abb7729b003277aeb610630586037ae11e0bd445256d9bb6d68acf2d056cccea37982d3b25c235608e0c45658b20d3b9fead33b7449e86e
6
+ metadata.gz: 45b2a01768c493de4370af15bc815428517cffe3a689300c2ba984bee5cdaaef53bcfe1b14fbc224fe47286d694afd999eb59a5913e52e367b0b7af34654c2ab
7
+ data.tar.gz: f8c2ad1a95e2d110a9e4849a65e712d61b0b059eb0dfbc1a107310ef618db63510c1c9e989a95d3005571bea1b0cd362d628fe123610b5beb7bfc21c68f4ce24
@@ -1,5 +1,5 @@
1
1
  module Esperanto
2
2
  module Source
3
- VERSION = '0.6.31'
3
+ VERSION = '0.6.32'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  /*
2
- esperanto.js v0.6.30 - 2015-04-26
2
+ esperanto.js v0.6.32 - 2015-05-07
3
3
  http://esperantojs.org
4
4
 
5
5
  Released under the MIT License.
@@ -11,8 +11,6 @@
11
11
  global.esperanto = factory(global.acorn)
12
12
  }(this, function (acorn) { 'use strict';
13
13
 
14
- var hasOwnProp = Object.prototype.hasOwnProperty;
15
-
16
14
  function hasNamedImports ( mod ) {
17
15
  var i = mod.imports.length;
18
16
 
@@ -67,7 +65,9 @@
67
65
  }
68
66
  };
69
67
 
70
- function getRelativePath__getRelativePath ( from, to ) {
68
+ var src_SourceMap = SourceMap;
69
+
70
+ function utils_getRelativePath__getRelativePath ( from, to ) {
71
71
  var fromParts, toParts, i;
72
72
 
73
73
  fromParts = from.split( /[\/\\]/ );
@@ -143,10 +143,10 @@
143
143
  getSemis( this.outro )
144
144
  );
145
145
 
146
- return new SourceMap({
146
+ return new src_SourceMap({
147
147
  file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
148
148
  sources: this.sources.map( function ( source ) {
149
- return options.file ? getRelativePath__getRelativePath( options.file, source.filename ) : source.filename;
149
+ return options.file ? utils_getRelativePath__getRelativePath( options.file, source.filename ) : source.filename;
150
150
  }),
151
151
  sourcesContent: this.sources.map( function ( source ) {
152
152
  return options.includeContent ? source.content.original : null;
@@ -252,7 +252,7 @@
252
252
  }
253
253
  };
254
254
 
255
-
255
+ var src_Bundle = Bundle;
256
256
 
257
257
  function stringify ( source ) {
258
258
  return source.content.toString();
@@ -342,17 +342,15 @@
342
342
  }
343
343
 
344
344
  function encode ( value ) {
345
- var result;
345
+ var result, i;
346
346
 
347
347
  if ( typeof value === 'number' ) {
348
348
  result = encodeInteger( value );
349
- } else if ( Array.isArray( value ) ) {
350
- result = '';
351
- value.forEach( function ( num ) {
352
- result += encodeInteger( num );
353
- });
354
349
  } else {
355
- throw new Error( 'vlq.encode accepts an integer or an array of integers' );
350
+ result = '';
351
+ for ( i = 0; i < value.length; i += 1 ) {
352
+ result += encodeInteger( value[i] );
353
+ }
356
354
  }
357
355
 
358
356
  return result;
@@ -381,7 +379,7 @@
381
379
  return result;
382
380
  }
383
381
 
384
- var encode__default = encode;
382
+ var utils_encode = encode;
385
383
 
386
384
  function encodeMappings ( original, str, mappings, hires, sourcemapLocations, sourceIndex, offsets ) {
387
385
  var lineStart,
@@ -472,7 +470,7 @@
472
470
 
473
471
  firstSegment = false;
474
472
 
475
- return encode__default( arr );
473
+ return utils_encode( arr );
476
474
  }).join( ',' );
477
475
  }).join( ';' );
478
476
 
@@ -556,9 +554,9 @@
556
554
  generateMap: function ( options ) {
557
555
  options = options || {};
558
556
 
559
- return new SourceMap({
557
+ return new src_SourceMap({
560
558
  file: ( options.file ? options.file.split( /[\/\\]/ ).pop() : null ),
561
- sources: [ options.source ? getRelativePath__getRelativePath( options.file || '', options.source ) : null ],
559
+ sources: [ options.source ? utils_getRelativePath__getRelativePath( options.file || '', options.source ) : null ],
562
560
  sourcesContent: options.includeContent ? [ this.original ] : [ null ],
563
561
  names: [],
564
562
  mappings: this.getMappings( options.hires, 0 )
@@ -879,7 +877,7 @@
879
877
  }
880
878
  };
881
879
 
882
- MagicString.Bundle = Bundle;
880
+ MagicString.Bundle = src_Bundle;
883
881
 
884
882
  function adjust ( mappings, start, end, d ) {
885
883
  var i = end;
@@ -930,33 +928,35 @@
930
928
  return result;
931
929
  }
932
930
 
931
+ var magic_string = MagicString;
932
+
933
933
  function walk ( ast, leave) {var enter = leave.enter, leave = leave.leave;
934
934
  visit( ast, null, enter, leave );
935
935
  }
936
936
 
937
- var walk__context = {
938
- skip: function() {return walk__context.shouldSkip = true}
937
+ var ast_walk__context = {
938
+ skip: function() {return ast_walk__context.shouldSkip = true}
939
939
  };
940
940
 
941
- var walk__childKeys = {};
941
+ var ast_walk__childKeys = {};
942
942
 
943
- var walk__toString = Object.prototype.toString;
943
+ var ast_walk__toString = Object.prototype.toString;
944
944
 
945
945
  function isArray ( thing ) {
946
- return walk__toString.call( thing ) === '[object Array]';
946
+ return ast_walk__toString.call( thing ) === '[object Array]';
947
947
  }
948
948
 
949
949
  function visit ( node, parent, enter, leave ) {
950
950
  if ( !node ) return;
951
951
 
952
952
  if ( enter ) {
953
- walk__context.shouldSkip = false;
954
- enter.call( walk__context, node, parent );
955
- if ( walk__context.shouldSkip ) return;
953
+ ast_walk__context.shouldSkip = false;
954
+ enter.call( ast_walk__context, node, parent );
955
+ if ( ast_walk__context.shouldSkip ) return;
956
956
  }
957
957
 
958
- var keys = walk__childKeys[ node.type ] || (
959
- walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
958
+ var keys = ast_walk__childKeys[ node.type ] || (
959
+ ast_walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
960
960
  );
961
961
 
962
962
  var key, value, i, j;
@@ -1245,7 +1245,7 @@
1245
1245
  */
1246
1246
  function processImport ( node, passthrough ) {
1247
1247
  var x = {
1248
- id: null, // used by bundler - filled in later
1248
+ module: null, // used by bundler - filled in later
1249
1249
  node: node,
1250
1250
  start: node.start,
1251
1251
  end: node.end,
@@ -1395,6 +1395,9 @@
1395
1395
  return result;
1396
1396
  }
1397
1397
 
1398
+ var hasOwnProp = Object.prototype.hasOwnProperty;
1399
+ var utils_hasOwnProp = hasOwnProp;
1400
+
1398
1401
  function getUnscopedNames ( mod ) {
1399
1402
  var unscoped = [], importedNames, scope;
1400
1403
 
@@ -1407,7 +1410,7 @@
1407
1410
  });
1408
1411
  });
1409
1412
  }
1410
- return hasOwnProp.call( importedNames, name );
1413
+ return utils_hasOwnProp.call( importedNames, name );
1411
1414
  }
1412
1415
 
1413
1416
  walk( mod.ast, {
@@ -1459,7 +1462,7 @@
1459
1462
  }
1460
1463
 
1461
1464
  function checkName ( name ) {
1462
- if ( hasOwnProp.call( usedNames, name ) ) {
1465
+ if ( utils_hasOwnProp.call( usedNames, name ) ) {
1463
1466
  throw new SyntaxError( (("Duplicated import ('" + name) + "')") );
1464
1467
  }
1465
1468
 
@@ -1506,7 +1509,7 @@
1506
1509
  var toRemove = [];
1507
1510
 
1508
1511
  var mod = {
1509
- body: new MagicString( code ),
1512
+ body: new magic_string( code ),
1510
1513
  ast: ast || ( acorn.parse( code, {
1511
1514
  ecmaVersion: 6,
1512
1515
  sourceType: 'module',
@@ -1555,7 +1558,7 @@
1555
1558
  moduleId = x.path;
1556
1559
 
1557
1560
  // use existing value
1558
- if ( hasOwnProp.call( nameById, moduleId ) ) {
1561
+ if ( utils_hasOwnProp.call( nameById, moduleId ) ) {
1559
1562
  x.name = nameById[ moduleId ];
1560
1563
  return;
1561
1564
  }
@@ -1564,7 +1567,7 @@
1564
1567
  if ( userFn && ( name = userFn( moduleId ) ) ) {
1565
1568
  name = sanitize( name );
1566
1569
 
1567
- if ( hasOwnProp.call( usedNames, name ) ) {
1570
+ if ( utils_hasOwnProp.call( usedNames, name ) ) {
1568
1571
  // TODO write a test for this
1569
1572
  throw new Error( (("Naming collision: module " + moduleId) + (" cannot be called " + name) + "") );
1570
1573
  }
@@ -1581,7 +1584,7 @@
1581
1584
  while ( i-- > 0 ) {
1582
1585
  candidate = prefix + sanitize( parts.slice( i ).join( '__' ) );
1583
1586
 
1584
- if ( !hasOwnProp.call( usedNames, candidate ) ) {
1587
+ if ( !utils_hasOwnProp.call( usedNames, candidate ) ) {
1585
1588
  name = candidate;
1586
1589
  break;
1587
1590
  }
@@ -1600,13 +1603,13 @@
1600
1603
  // use inferred names for default imports, wherever they
1601
1604
  // don't clash with path-based names
1602
1605
  imports.forEach( function(x ) {
1603
- if ( x.as && !hasOwnProp.call( usedNames, x.as ) ) {
1606
+ if ( x.as && !utils_hasOwnProp.call( usedNames, x.as ) ) {
1604
1607
  inferredNames[ x.path ] = x.as;
1605
1608
  }
1606
1609
  });
1607
1610
 
1608
1611
  imports.forEach( function(x ) {
1609
- if ( hasOwnProp.call( inferredNames, x.path ) ) {
1612
+ if ( utils_hasOwnProp.call( inferredNames, x.path ) ) {
1610
1613
  x.name = inferredNames[ x.path ];
1611
1614
  }
1612
1615
  });
@@ -1660,7 +1663,7 @@
1660
1663
 
1661
1664
  var ABSOLUTE_PATH = /^(?:[A-Z]:)?[\/\\]/i;
1662
1665
 
1663
- var packageResult__warned = {};
1666
+ var utils_packageResult__warned = {};
1664
1667
 
1665
1668
  function packageResult ( bundleOrModule, body, options, methodName, isBundle ) {
1666
1669
  // wrap output
@@ -1695,7 +1698,7 @@
1695
1698
  map = body.generateMap({
1696
1699
  includeContent: true,
1697
1700
  file: sourceMapFile,
1698
- source: ( sourceMapFile && !isBundle ) ? packageResult__getRelativePath( sourceMapFile, options.sourceMapSource ) : null
1701
+ source: ( sourceMapFile && !isBundle ) ? utils_packageResult__getRelativePath( sourceMapFile, options.sourceMapSource ) : null
1699
1702
  });
1700
1703
 
1701
1704
  if ( options.sourceMap === 'inline' ) {
@@ -1712,9 +1715,9 @@
1712
1715
  code: code,
1713
1716
  map: map,
1714
1717
  toString: function () {
1715
- if ( !packageResult__warned[ methodName ] ) {
1718
+ if ( !utils_packageResult__warned[ methodName ] ) {
1716
1719
  console.log( (("Warning: esperanto." + methodName) + "() returns an object with a 'code' property. You should use this instead of using the returned value directly") );
1717
- packageResult__warned[ methodName ] = true;
1720
+ utils_packageResult__warned[ methodName ] = true;
1718
1721
  }
1719
1722
 
1720
1723
  return code;
@@ -1722,7 +1725,7 @@
1722
1725
  };
1723
1726
  }
1724
1727
 
1725
- function packageResult__getRelativePath ( from, to ) {
1728
+ function utils_packageResult__getRelativePath ( from, to ) {
1726
1729
  var fromParts, toParts, i;
1727
1730
 
1728
1731
  fromParts = splitPath( from );
@@ -1854,9 +1857,9 @@
1854
1857
  }
1855
1858
 
1856
1859
  var intro = (("\
1857
- \n define(" + (processName(name))) + ("" + (processIds(ids))) + ("function (" + (names.join( ', ' ))) + ") {\
1860
+ \ndefine(" + (processName(name))) + ("" + (processIds(ids))) + ("function (" + (names.join( ', ' ))) + ") {\
1858
1861
  \n\
1859
- \n ");
1862
+ \n");
1860
1863
 
1861
1864
  if ( useStrict ) {
1862
1865
  intro += (("" + indentStr) + "'use strict';\n\n");
@@ -1865,7 +1868,7 @@
1865
1868
  return intro;
1866
1869
  }
1867
1870
 
1868
- function amd__amd ( mod, options ) {
1871
+ function defaultsMode_amd__amd ( mod, options ) {
1869
1872
  mod.imports.forEach( function(x ) {
1870
1873
  mod.body.remove( x.start, x.next );
1871
1874
  });
@@ -1889,11 +1892,11 @@
1889
1892
  return packageResult( mod, mod.body, options, 'toAmd' );
1890
1893
  }
1891
1894
 
1892
- function cjs__cjs ( mod, options ) {
1895
+ function defaultsMode_cjs__cjs ( mod, options ) {
1893
1896
  var seen = {};
1894
1897
 
1895
1898
  mod.imports.forEach( function(x ) {
1896
- if ( !hasOwnProp.call( seen, x.path ) ) {
1899
+ if ( !utils_hasOwnProp.call( seen, x.path ) ) {
1897
1900
  var replacement = x.isEmpty ? (("" + (req(x.path))) + ";") : (("var " + (x.as)) + (" = " + (req(x.path))) + ";");
1898
1901
  mod.body.replace( x.start, x.end, replacement );
1899
1902
 
@@ -1933,12 +1936,12 @@
1933
1936
  if ( !hasExports && !imports.length ) {
1934
1937
  intro =
1935
1938
  (("(function (factory) {\
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) + "\
1939
+ \n !(typeof exports === 'object' && typeof module !== 'undefined') &&\
1940
+ \n typeof define === 'function' && define.amd ? define(" + (processName(amdName))) + ("factory) :\
1941
+ \n factory()\
1942
+ \n }(function () {" + useStrictPragma) + "\
1940
1943
  \n\
1941
- \n ");
1944
+ \n ");
1942
1945
  }
1943
1946
 
1944
1947
  else {
@@ -1962,7 +1965,7 @@
1962
1965
  defaultsBlock = externalDefaults.map( function(x )
1963
1966
  {return '\t' + ( x.needsNamed ? (("var " + (x.name)) + "__default") : x.name ) +
1964
1967
  ((" = ('default' in " + (x.name)) + (" ? " + (x.name)) + ("['default'] : " + (x.name)) + ");")}
1965
- ).join('\n') + '\n\n';
1968
+ ).join('\n') + '\n\n';
1966
1969
  }
1967
1970
  } else {
1968
1971
  amdExport = (("define(" + (processName(amdName))) + ("" + (processIds(ids))) + "factory)");
@@ -1974,12 +1977,12 @@
1974
1977
 
1975
1978
  intro =
1976
1979
  (("(function (global, factory) {\
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) + ("\
1980
+ \n typeof exports === 'object' && typeof module !== 'undefined' ? " + cjsExport) + (" :\
1981
+ \n typeof define === 'function' && define.amd ? " + amdExport) + (" :\
1982
+ \n " + globalExport) + ("\
1983
+ \n }(this, function (" + (names.join( ', ' ))) + (") {" + useStrictPragma) + ("\
1981
1984
  \n\
1982
- \n " + defaultsBlock) + "");
1985
+ \n " + defaultsBlock) + "");
1983
1986
 
1984
1987
  }
1985
1988
 
@@ -2003,15 +2006,17 @@
2003
2006
  EsperantoError.prototype.constructor = EsperantoError;
2004
2007
  EsperantoError.prototype.name = 'EsperantoError';
2005
2008
 
2009
+ var utils_EsperantoError = EsperantoError;
2010
+
2006
2011
  function requireName ( options ) {
2007
2012
  if ( !options.name ) {
2008
- throw new EsperantoError( 'You must supply a `name` option for UMD modules', {
2013
+ throw new utils_EsperantoError( 'You must supply a `name` option for UMD modules', {
2009
2014
  code: 'MISSING_NAME'
2010
2015
  });
2011
2016
  }
2012
2017
  }
2013
2018
 
2014
- function umd__umd ( mod, options ) {
2019
+ function defaultsMode_umd__umd ( mod, options ) {
2015
2020
  requireName( options );
2016
2021
 
2017
2022
  mod.imports.forEach( function(x ) {
@@ -2036,9 +2041,9 @@
2036
2041
  }
2037
2042
 
2038
2043
  var defaultsMode = {
2039
- amd: amd__amd,
2040
- cjs: cjs__cjs,
2041
- umd: umd__umd
2044
+ amd: defaultsMode_amd__amd,
2045
+ cjs: defaultsMode_cjs__cjs,
2046
+ umd: defaultsMode_umd__umd
2042
2047
  };
2043
2048
 
2044
2049
  function gatherImports ( imports ) {
@@ -2135,14 +2140,14 @@
2135
2140
 
2136
2141
  var name = assignee.name;
2137
2142
 
2138
- if ( hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
2143
+ if ( utils_hasOwnProp.call( isNamespaceAssignment ? importedNamespaces : importedBindings, name ) && !scope.contains( name ) ) {
2139
2144
  throw new Error( ( isNamespaceAssignment ? namespaceMessage : bindingMessage ) + '`' + name + '`' );
2140
2145
  }
2141
2146
  }
2142
2147
 
2143
2148
  function replaceIdentifiers ( body, node, identifierReplacements, scope ) {
2144
2149
  var name = node.name;
2145
- var replacement = hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
2150
+ var replacement = utils_hasOwnProp.call( identifierReplacements, name ) && identifierReplacements[ name ];
2146
2151
 
2147
2152
  // TODO unchanged identifiers shouldn't have got this far -
2148
2153
  // remove the `replacement !== name` safeguard once that's the case
@@ -2173,7 +2178,7 @@
2173
2178
  return; // shadows an export
2174
2179
  }
2175
2180
 
2176
- if ( exports && hasOwnProp.call( exports, name ) ) {
2181
+ if ( exports && utils_hasOwnProp.call( exports, name ) ) {
2177
2182
  var exportAs = exports[ name ];
2178
2183
 
2179
2184
  if ( !!capturedUpdates ) {
@@ -2361,7 +2366,7 @@
2361
2366
  }
2362
2367
 
2363
2368
  function deconflict ( name, declared ) {
2364
- while ( hasOwnProp.call( declared, name ) ) {
2369
+ while ( utils_hasOwnProp.call( declared, name ) ) {
2365
2370
  name = '_' + name;
2366
2371
  }
2367
2372
 
@@ -2392,7 +2397,7 @@
2392
2397
 
2393
2398
  // Create block of require statements
2394
2399
  var importBlock = mod.imports.map( function(x ) {
2395
- if ( !hasOwnProp.call( seen, x.path ) ) {
2400
+ if ( !utils_hasOwnProp.call( seen, x.path ) ) {
2396
2401
  seen[ x.path ] = true;
2397
2402
 
2398
2403
  if ( x.isEmpty ) {
@@ -2450,7 +2455,7 @@
2450
2455
  strictMode: strictMode
2451
2456
  };
2452
2457
 
2453
- function defaultsMode_amd__amd ( bundle, options ) {
2458
+ function builders_defaultsMode_amd__amd ( bundle, options ) {
2454
2459
  var defaultName = bundle.entryModule.identifierReplacements.default;
2455
2460
  if ( defaultName ) {
2456
2461
  bundle.body.append( (("\n\nreturn " + defaultName) + ";") );
@@ -2467,7 +2472,7 @@
2467
2472
  return packageResult( bundle, bundle.body, options, 'toAmd', true );
2468
2473
  }
2469
2474
 
2470
- function defaultsMode_cjs__cjs ( bundle, options ) {
2475
+ function builders_defaultsMode_cjs__cjs ( bundle, options ) {
2471
2476
  var importBlock = bundle.externalModules.map( function(x ) {
2472
2477
  return (("var " + (x.name)) + (" = " + (req(x.id))) + ";");
2473
2478
  }).join( '\n' );
@@ -2488,7 +2493,7 @@
2488
2493
  return packageResult( bundle, bundle.body, options, 'toCjs', true );
2489
2494
  }
2490
2495
 
2491
- function defaultsMode_umd__umd ( bundle, options ) {
2496
+ function builders_defaultsMode_umd__umd ( bundle, options ) {
2492
2497
  requireName( options );
2493
2498
 
2494
2499
  var entry = bundle.entryModule;
@@ -2512,9 +2517,9 @@
2512
2517
  }
2513
2518
 
2514
2519
  var builders_defaultsMode = {
2515
- amd: defaultsMode_amd__amd,
2516
- cjs: defaultsMode_cjs__cjs,
2517
- umd: defaultsMode_umd__umd
2520
+ amd: builders_defaultsMode_amd__amd,
2521
+ cjs: builders_defaultsMode_cjs__cjs,
2522
+ umd: builders_defaultsMode_umd__umd
2518
2523
  };
2519
2524
 
2520
2525
  function getExportBlock ( entry ) {
@@ -2726,7 +2731,7 @@
2726
2731
 
2727
2732
  bundle.modules.forEach( function(mod ) {
2728
2733
  mod.imports.forEach( function(x ) {
2729
- if ( hasOwnProp.call( bundle.externalModuleLookup, x.id ) && ( !x.isDefault && !x.isBatch ) ) {
2734
+ if ( x.module.isExternal && ( !x.isDefault && !x.isBatch ) ) {
2730
2735
  throw new Error( 'You can only have named external imports in strict mode (pass `strict: true`)' );
2731
2736
  }
2732
2737
  });
@@ -2765,4 +2770,5 @@
2765
2770
 
2766
2771
  return esperanto;
2767
2772
 
2768
- }));
2773
+ }));
2774
+ //# sourceMappingURL=/Users/tricknotes/src/github.com/esperantojs/esperanto/test/.gobble-build/02-esperantoBundle/1/esperanto.browser.js.map