esperanto-source 0.6.9.1 → 0.6.10
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 +4 -4
- data/lib/esperanto/source/version.rb +1 -1
- data/vendor/esperanto.browser.js +2 -2
- data/vendor/esperanto.js +61 -55
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2d37c4a2dc23e02b47dd28844b868f49023385
|
4
|
+
data.tar.gz: 2ec273351482319b1c82da3c09f8b9a22e05cbe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8e61eaab45153c2be2c5458aa21e7b819b52605525ece29b0ca5c7db4fb021fc368308789f516885841a6bba5a051f1ca6d3236575a88ec463b787d23ac0ee6
|
7
|
+
data.tar.gz: 8fd331d6f149b88b11160fa3df0e237a6627d9e163fcd4fd5011be63ca28ef88c14448fdc111175427c98d6a39e4c7426a0853540fd7a6edcad7dffcc2857cce
|
data/vendor/esperanto.browser.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
esperanto.js v0.6.
|
2
|
+
esperanto.js v0.6.10 - 2015-02-09
|
3
3
|
http://esperantojs.org
|
4
4
|
|
5
5
|
Released under the MIT License.
|
@@ -1766,7 +1766,7 @@
|
|
1766
1766
|
toUmd: transpileMethod( 'umd' ),
|
1767
1767
|
|
1768
1768
|
bundle: function ( options ) {
|
1769
|
-
return
|
1769
|
+
return getBundle( options ).then( function ( bundle ) {
|
1770
1770
|
return {
|
1771
1771
|
imports: bundle.externalModules.map( function(mod ) {return mod.id} ),
|
1772
1772
|
exports: flattenExports( bundle.entryModule.exports ),
|
data/vendor/esperanto.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
esperanto.js v0.6.
|
2
|
+
esperanto.js v0.6.10 - 2015-02-09
|
3
3
|
http://esperantojs.org
|
4
4
|
|
5
5
|
Released under the MIT License.
|
@@ -805,7 +805,7 @@ function populateIdentifierReplacements ( bundle ) {
|
|
805
805
|
// then determine which existing identifiers
|
806
806
|
// need to be replaced
|
807
807
|
bundle.modules.forEach( function(mod ) {
|
808
|
-
var moduleIdentifiers
|
808
|
+
var moduleIdentifiers;
|
809
809
|
|
810
810
|
moduleIdentifiers = mod.identifierReplacements;
|
811
811
|
|
@@ -1179,7 +1179,8 @@ function transformBody__transformBody ( bundle, mod, body ) {var $D$1;
|
|
1179
1179
|
if ( name === identifierReplacements.default ) {
|
1180
1180
|
body.remove( x.start, x.end );
|
1181
1181
|
} else {
|
1182
|
-
|
1182
|
+
var original = hasOwnProp.call( identifierReplacements, name ) ? identifierReplacements[ name ] : name;
|
1183
|
+
body.replace( x.start, x.end, (("var " + (identifierReplacements.default)) + (" = " + original) + ";") );
|
1183
1184
|
}
|
1184
1185
|
}
|
1185
1186
|
|
@@ -1360,7 +1361,7 @@ function getModule ( mod ) {var $D$2;
|
|
1360
1361
|
return mod;
|
1361
1362
|
;$D$2 = void 0}
|
1362
1363
|
|
1363
|
-
var
|
1364
|
+
var getBundle__Promise = sander.Promise;
|
1364
1365
|
|
1365
1366
|
function getBundle ( options ) {
|
1366
1367
|
var entry = options.entry.replace( /\.js$/, '' ),
|
@@ -1377,7 +1378,7 @@ function getBundle ( options ) {
|
|
1377
1378
|
entry = entry.substring( base.length );
|
1378
1379
|
}
|
1379
1380
|
|
1380
|
-
return fetchModule( entry ).then( function() {
|
1381
|
+
return fetchModule( entry, null ).then( function() {
|
1381
1382
|
var entryModule, bundle;
|
1382
1383
|
|
1383
1384
|
entryModule = moduleLookup[ entry ];
|
@@ -1401,68 +1402,53 @@ function getBundle ( options ) {
|
|
1401
1402
|
return bundle;
|
1402
1403
|
});
|
1403
1404
|
|
1404
|
-
function fetchModule ( moduleId ) {
|
1405
|
-
var modulePath;
|
1406
|
-
|
1407
|
-
modulePath = path.resolve( base, moduleId + '.js' );
|
1408
|
-
|
1405
|
+
function fetchModule ( moduleId, importerPath ) {
|
1409
1406
|
if ( !hasOwnProp.call( promiseById, moduleId ) ) {
|
1410
|
-
promiseById[ moduleId ] =
|
1411
|
-
|
1412
|
-
|
1413
|
-
return sander.readFile( modulePath );
|
1414
|
-
}
|
1407
|
+
promiseById[ moduleId ] = resolvePath( base, moduleId, importerPath, options.resolvePath ).then( function(modulePath ) {
|
1408
|
+
return sander.readFile( modulePath ).then( String ).then( function ( source ) {
|
1409
|
+
var module, promises;
|
1415
1410
|
|
1416
|
-
|
1417
|
-
|
1418
|
-
source = String( source );
|
1419
|
-
|
1420
|
-
if ( options.transform ) {
|
1421
|
-
source = options.transform( source, modulePath );
|
1411
|
+
if ( options.transform ) {
|
1412
|
+
source = options.transform( source, modulePath );
|
1422
1413
|
|
1423
|
-
|
1424
|
-
|
1414
|
+
if ( typeof source !== 'string' && !isThenable( source ) ) {
|
1415
|
+
throw new Error( 'transform should return String or Promise' );
|
1416
|
+
}
|
1425
1417
|
}
|
1426
|
-
}
|
1427
1418
|
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1419
|
+
module = getModule({
|
1420
|
+
source: source,
|
1421
|
+
id: moduleId,
|
1422
|
+
file: modulePath.substring( base.length ),
|
1423
|
+
path: modulePath
|
1424
|
+
});
|
1431
1425
|
|
1432
|
-
|
1433
|
-
|
1434
|
-
id: moduleId,
|
1435
|
-
file: modulePath.substring( base.length ),
|
1436
|
-
path: modulePath
|
1437
|
-
});
|
1426
|
+
modules.push( module );
|
1427
|
+
moduleLookup[ moduleId ] = module;
|
1438
1428
|
|
1439
|
-
|
1440
|
-
|
1429
|
+
promises = module.imports.map( function(x ) {
|
1430
|
+
x.id = resolveId( x.path, module.file );
|
1441
1431
|
|
1442
|
-
|
1443
|
-
|
1432
|
+
if ( x.id === moduleId ) {
|
1433
|
+
throw new Error( 'A module (' + moduleId + ') cannot import itself' );
|
1434
|
+
}
|
1444
1435
|
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1436
|
+
// Some modules can be skipped
|
1437
|
+
if ( skip && ~skip.indexOf( x.id ) ) {
|
1438
|
+
return;
|
1439
|
+
}
|
1448
1440
|
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1441
|
+
// short-circuit cycles
|
1442
|
+
if ( hasOwnProp.call( promiseById, x.id ) ) {
|
1443
|
+
return;
|
1444
|
+
}
|
1453
1445
|
|
1454
|
-
|
1455
|
-
|
1456
|
-
return;
|
1457
|
-
}
|
1446
|
+
return fetchModule( x.id, modulePath );
|
1447
|
+
});
|
1458
1448
|
|
1459
|
-
return
|
1449
|
+
return getBundle__Promise.all( promises );
|
1460
1450
|
});
|
1461
|
-
|
1462
|
-
return Promise.all( promises );
|
1463
|
-
}).catch( function ( err ) {
|
1464
|
-
var externalModule;
|
1465
|
-
|
1451
|
+
}, function ( err ) {
|
1466
1452
|
if ( err.code === 'ENOENT' ) {
|
1467
1453
|
if ( moduleId === entry ) {
|
1468
1454
|
throw new Error( 'Could not find entry module (' + entry + ')' );
|
@@ -1470,7 +1456,7 @@ function getBundle ( options ) {
|
|
1470
1456
|
|
1471
1457
|
// Most likely an external module
|
1472
1458
|
if ( !hasOwnProp.call( externalModuleLookup, moduleId ) ) {
|
1473
|
-
externalModule = {
|
1459
|
+
var externalModule = {
|
1474
1460
|
id: moduleId
|
1475
1461
|
};
|
1476
1462
|
|
@@ -1487,6 +1473,26 @@ function getBundle ( options ) {
|
|
1487
1473
|
}
|
1488
1474
|
}
|
1489
1475
|
|
1476
|
+
function resolvePath ( base, moduleId, importerPath, resolver ) {
|
1477
|
+
return tryPath( base + moduleId + '.js' )
|
1478
|
+
.catch( function () {
|
1479
|
+
return tryPath( base + moduleId + path.sep + 'index.js' );
|
1480
|
+
})
|
1481
|
+
.catch( function ( err ) {
|
1482
|
+
if ( resolver ) {
|
1483
|
+
return resolver( moduleId, importerPath );
|
1484
|
+
} else {
|
1485
|
+
throw err;
|
1486
|
+
}
|
1487
|
+
});
|
1488
|
+
}
|
1489
|
+
|
1490
|
+
function tryPath ( path ) {
|
1491
|
+
return sander.stat( path ).then( function () {
|
1492
|
+
return path;
|
1493
|
+
});
|
1494
|
+
}
|
1495
|
+
|
1490
1496
|
function isThenable ( obj ) {
|
1491
1497
|
return obj && typeof obj.then === 'function';
|
1492
1498
|
}
|