esperanto-source 0.6.19 → 0.6.20
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 +62 -11
- data/vendor/esperanto.js +58 -8
- 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: a0eb6ec5e1f7f8c3bf48912dbb967b4b8fb9df9b
|
4
|
+
data.tar.gz: d07a32879d1a0db15781b69c417a13266b282a08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 358b60b657fc1bb4c6605443ab527ffef38d4c4438f6199436d45ac054cc7c006da464eddabd1f8aed48e96399e0002f59a9359c2dfc283c0f6e803c2e534560
|
7
|
+
data.tar.gz: 3087f035f3090fa1aada5e9f32d4af004aa0426cd7f4e9e31186ee6bca693deab9b3923fa263e3e99a41f4289ef214fd9e7a7dc2380c6de89c10a3b64bf5e089
|
data/vendor/esperanto.browser.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
/*
|
2
|
-
esperanto.js v0.6.
|
2
|
+
esperanto.js v0.6.20 - 2015-03-30
|
3
3
|
http://esperantojs.org
|
4
4
|
|
5
5
|
Released under the MIT License.
|
6
6
|
*/
|
7
7
|
|
8
8
|
(function (global, factory) {
|
9
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('acorn')
|
10
|
-
typeof define === 'function' && define.amd ? define(['acorn'
|
11
|
-
global.esperanto = factory(global.acorn
|
12
|
-
}(this, function (acorn
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('acorn')) :
|
10
|
+
typeof define === 'function' && define.amd ? define(['acorn'], factory) :
|
11
|
+
global.esperanto = factory(global.acorn)
|
12
|
+
}(this, function (acorn) { 'use strict';
|
13
13
|
|
14
14
|
var hasOwnProp = Object.prototype.hasOwnProperty;
|
15
15
|
|
@@ -930,6 +930,57 @@
|
|
930
930
|
return result;
|
931
931
|
}
|
932
932
|
|
933
|
+
function walk ( ast, leave) {var enter = leave.enter, leave = leave.leave;
|
934
|
+
visit( ast, null, enter, leave );
|
935
|
+
}
|
936
|
+
|
937
|
+
var walk__context = {
|
938
|
+
skip: function() {return walk__context.shouldSkip = true}
|
939
|
+
};
|
940
|
+
|
941
|
+
var walk__childKeys = {};
|
942
|
+
|
943
|
+
var walk__toString = Object.prototype.toString;
|
944
|
+
|
945
|
+
function isArray ( thing ) {
|
946
|
+
return walk__toString.call( thing ) === '[object Array]';
|
947
|
+
}
|
948
|
+
|
949
|
+
function visit ( node, parent, enter, leave ) {
|
950
|
+
if ( enter ) {
|
951
|
+
walk__context.shouldSkip = false;
|
952
|
+
enter.call( walk__context, node, parent );
|
953
|
+
if ( walk__context.shouldSkip ) return;
|
954
|
+
}
|
955
|
+
|
956
|
+
var keys = walk__childKeys[ node.type ] || (
|
957
|
+
walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
|
958
|
+
);
|
959
|
+
|
960
|
+
var key, value, i, j;
|
961
|
+
|
962
|
+
i = keys.length;
|
963
|
+
while ( i-- ) {
|
964
|
+
key = keys[i];
|
965
|
+
value = node[ key ];
|
966
|
+
|
967
|
+
if ( isArray( value ) ) {
|
968
|
+
j = value.length;
|
969
|
+
while ( j-- ) {
|
970
|
+
visit( value[j], node, enter, leave );
|
971
|
+
}
|
972
|
+
}
|
973
|
+
|
974
|
+
else if ( value && value.type ) {
|
975
|
+
visit( value, node, enter, leave );
|
976
|
+
}
|
977
|
+
}
|
978
|
+
|
979
|
+
if ( leave ) {
|
980
|
+
leave( node, parent );
|
981
|
+
}
|
982
|
+
}
|
983
|
+
|
933
984
|
/*
|
934
985
|
This module traverse a module's AST, attaching scope information
|
935
986
|
to nodes as it goes, which is later used to determine which
|
@@ -970,7 +1021,7 @@
|
|
970
1021
|
|
971
1022
|
var envDepth = 0;
|
972
1023
|
|
973
|
-
|
1024
|
+
walk( ast, {
|
974
1025
|
enter: function ( node ) {
|
975
1026
|
if ( node.type === 'ImportDeclaration' || node.type === 'ExportSpecifier' ) {
|
976
1027
|
node._skip = true;
|
@@ -1324,7 +1375,7 @@
|
|
1324
1375
|
return hasOwnProp.call( importedNames, name );
|
1325
1376
|
}
|
1326
1377
|
|
1327
|
-
|
1378
|
+
walk( mod.ast, {
|
1328
1379
|
enter: function ( node ) {
|
1329
1380
|
// we're only interested in references, not property names etc
|
1330
1381
|
if ( node._skip ) return this.skip();
|
@@ -1654,16 +1705,16 @@
|
|
1654
1705
|
|
1655
1706
|
function markBundleSourcemapLocations ( bundle ) {
|
1656
1707
|
bundle.modules.forEach( function(mod ) {
|
1657
|
-
|
1708
|
+
walk( mod.ast, {
|
1658
1709
|
enter: function(node ) {
|
1659
1710
|
mod.body.addSourcemapLocation( node.start );
|
1660
1711
|
}
|
1661
1712
|
});
|
1662
|
-
})
|
1713
|
+
});
|
1663
1714
|
}
|
1664
1715
|
|
1665
1716
|
function markModuleSourcemapLocations ( mod ) {
|
1666
|
-
|
1717
|
+
walk( mod.ast, {
|
1667
1718
|
enter: function(node ) {
|
1668
1719
|
mod.body.addSourcemapLocation( node.start );
|
1669
1720
|
}
|
@@ -2127,7 +2178,7 @@
|
|
2127
2178
|
capturedUpdates = null,
|
2128
2179
|
previousCapturedUpdates = null;
|
2129
2180
|
|
2130
|
-
|
2181
|
+
walk( ast, {
|
2131
2182
|
enter: function ( node, parent ) {
|
2132
2183
|
// we're only interested in references, not property names etc
|
2133
2184
|
if ( node._skip ) return this.skip();
|
data/vendor/esperanto.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
esperanto.js v0.6.
|
2
|
+
esperanto.js v0.6.20 - 2015-03-30
|
3
3
|
http://esperantojs.org
|
4
4
|
|
5
5
|
Released under the MIT License.
|
@@ -11,7 +11,6 @@ var acorn = require('acorn');
|
|
11
11
|
var MagicString = require('magic-string');
|
12
12
|
var path = require('path');
|
13
13
|
var sander = require('sander');
|
14
|
-
var estraverse = require('estraverse');
|
15
14
|
|
16
15
|
var hasOwnProp = Object.prototype.hasOwnProperty;
|
17
16
|
|
@@ -35,6 +34,57 @@ function hasNamedExports ( mod ) {
|
|
35
34
|
}
|
36
35
|
}
|
37
36
|
|
37
|
+
function walk ( ast, leave) {var enter = leave.enter, leave = leave.leave;
|
38
|
+
visit( ast, null, enter, leave );
|
39
|
+
}
|
40
|
+
|
41
|
+
var walk__context = {
|
42
|
+
skip: function() {return walk__context.shouldSkip = true}
|
43
|
+
};
|
44
|
+
|
45
|
+
var walk__childKeys = {};
|
46
|
+
|
47
|
+
var walk__toString = Object.prototype.toString;
|
48
|
+
|
49
|
+
function isArray ( thing ) {
|
50
|
+
return walk__toString.call( thing ) === '[object Array]';
|
51
|
+
}
|
52
|
+
|
53
|
+
function visit ( node, parent, enter, leave ) {
|
54
|
+
if ( enter ) {
|
55
|
+
walk__context.shouldSkip = false;
|
56
|
+
enter.call( walk__context, node, parent );
|
57
|
+
if ( walk__context.shouldSkip ) return;
|
58
|
+
}
|
59
|
+
|
60
|
+
var keys = walk__childKeys[ node.type ] || (
|
61
|
+
walk__childKeys[ node.type ] = Object.keys( node ).filter( function(key ) {return typeof node[ key ] === 'object'} )
|
62
|
+
);
|
63
|
+
|
64
|
+
var key, value, i, j;
|
65
|
+
|
66
|
+
i = keys.length;
|
67
|
+
while ( i-- ) {
|
68
|
+
key = keys[i];
|
69
|
+
value = node[ key ];
|
70
|
+
|
71
|
+
if ( isArray( value ) ) {
|
72
|
+
j = value.length;
|
73
|
+
while ( j-- ) {
|
74
|
+
visit( value[j], node, enter, leave );
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
else if ( value && value.type ) {
|
79
|
+
visit( value, node, enter, leave );
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
if ( leave ) {
|
84
|
+
leave( node, parent );
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
38
88
|
/*
|
39
89
|
This module traverse a module's AST, attaching scope information
|
40
90
|
to nodes as it goes, which is later used to determine which
|
@@ -75,7 +125,7 @@ function annotateAst ( ast ) {
|
|
75
125
|
|
76
126
|
var envDepth = 0;
|
77
127
|
|
78
|
-
|
128
|
+
walk( ast, {
|
79
129
|
enter: function ( node ) {
|
80
130
|
if ( node.type === 'ImportDeclaration' || node.type === 'ExportSpecifier' ) {
|
81
131
|
node._skip = true;
|
@@ -429,7 +479,7 @@ function getUnscopedNames ( mod ) {
|
|
429
479
|
return hasOwnProp.call( importedNames, name );
|
430
480
|
}
|
431
481
|
|
432
|
-
|
482
|
+
walk( mod.ast, {
|
433
483
|
enter: function ( node ) {
|
434
484
|
// we're only interested in references, not property names etc
|
435
485
|
if ( node._skip ) return this.skip();
|
@@ -1160,7 +1210,7 @@ function traverseAst ( ast, body, identifierReplacements, importedBindings, impo
|
|
1160
1210
|
capturedUpdates = null,
|
1161
1211
|
previousCapturedUpdates = null;
|
1162
1212
|
|
1163
|
-
|
1213
|
+
walk( ast, {
|
1164
1214
|
enter: function ( node, parent ) {
|
1165
1215
|
// we're only interested in references, not property names etc
|
1166
1216
|
if ( node._skip ) return this.skip();
|
@@ -1743,16 +1793,16 @@ function getRelativePath ( from, to ) {
|
|
1743
1793
|
|
1744
1794
|
function markBundleSourcemapLocations ( bundle ) {
|
1745
1795
|
bundle.modules.forEach( function(mod ) {
|
1746
|
-
|
1796
|
+
walk( mod.ast, {
|
1747
1797
|
enter: function(node ) {
|
1748
1798
|
mod.body.addSourcemapLocation( node.start );
|
1749
1799
|
}
|
1750
1800
|
});
|
1751
|
-
})
|
1801
|
+
});
|
1752
1802
|
}
|
1753
1803
|
|
1754
1804
|
function markModuleSourcemapLocations ( mod ) {
|
1755
|
-
|
1805
|
+
walk( mod.ast, {
|
1756
1806
|
enter: function(node ) {
|
1757
1807
|
mod.body.addSourcemapLocation( node.start );
|
1758
1808
|
}
|