js2 0.3.16 → 0.3.17

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.
Files changed (4) hide show
  1. data/CHANGELOG +4 -0
  2. data/lib/js2/browser.js +3 -1
  3. data/lib/js2/js2.js +11 -4
  4. metadata +4 -4
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.3.17
2
+ * CORE: Adding counter to foreach "foreach (var item:i in items) { }"
3
+ * COMMAND: Fixing compile to use targetDir instead of outDir
4
+
1
5
  0.3.16
2
6
  * JSML: Support dashes in classes and id
3
7
  * GEM: Took out debug info in rack.rb
data/lib/js2/browser.js CHANGED
@@ -19,7 +19,7 @@ function mainFunction (arg) {
19
19
 
20
20
  var JS2 = root.JS2 = mainFunction;
21
21
  var js2 = root.js2 = JS2;
22
- js2.VERSION = "0.3.16";
22
+ js2.VERSION = "0.3.17";
23
23
 
24
24
  JS2.ROOT = JS2;
25
25
 
@@ -269,6 +269,7 @@ JS2.Array.prototype.any = function() {
269
269
  return this.length > 0;
270
270
  };
271
271
 
272
+
272
273
  JS2.Class.extend('JSML', function(KLASS, OO){
273
274
  OO.addStaticMember("process",function (txt) {
274
275
  return new KLASS(txt);
@@ -458,6 +459,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
458
459
  });
459
460
  });
460
461
 
462
+
461
463
  JS2.TEMPLATES = { jsml: JS2.JSML };
462
464
 
463
465
 
data/lib/js2/js2.js CHANGED
@@ -14,7 +14,7 @@ function mainFunction (arg) {
14
14
 
15
15
  var JS2 = root.JS2 = mainFunction;
16
16
  var js2 = root.js2 = JS2;
17
- js2.VERSION = "0.3.16";
17
+ js2.VERSION = "0.3.17";
18
18
 
19
19
  JS2.ROOT = JS2;
20
20
 
@@ -901,12 +901,12 @@ function mainFunction (arg) {
901
901
 
902
902
  getBrace: function(brace) {
903
903
  var n = this.cache.count;
904
- var iteratorName = "_i" + n;
905
904
  var collectionName = "_c" + n;
906
905
  var l = "_l" + n;
907
906
 
908
- var v = brace.validate(/(\()(\s*)(var)(\s+)(I)(\s+)(in)(\s+)/);
907
+ var v = brace.validate(/(\()(\s*)(var)(\s+)(I)(\s*\:\s*(I))?(\s+)(in)(\s+)/);
909
908
  if (!v) return '';
909
+ var iteratorName = v[7] || "_i" + n;
910
910
 
911
911
  var holder = v[5];
912
912
  var collection = v.last.replace(/\)$/, '');
@@ -1124,6 +1124,7 @@ JS2.Array.prototype.any = function() {
1124
1124
  return this.length > 0;
1125
1125
  };
1126
1126
 
1127
+
1127
1128
  JS2.Class.extend('FileSystem', function(KLASS, OO){
1128
1129
  OO.addMember("initialize",function (adapter) {
1129
1130
  this.adapter = adapter;
@@ -1233,6 +1234,7 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
1233
1234
  });
1234
1235
  });
1235
1236
 
1237
+
1236
1238
  JS2.Class.extend('Updater', function(KLASS, OO){
1237
1239
  OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
1238
1240
  this.recursive = recursive;
@@ -1278,6 +1280,7 @@ JS2.Class.extend('Updater', function(KLASS, OO){
1278
1280
  });
1279
1281
  });
1280
1282
 
1283
+
1281
1284
  JS2.Class.extend('Config', function(KLASS, OO){
1282
1285
  OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
1283
1286
  OO.addMember("optsLookup",{
@@ -1349,6 +1352,7 @@ JS2.Class.extend('Config', function(KLASS, OO){
1349
1352
 
1350
1353
  });
1351
1354
 
1355
+
1352
1356
  JS2.Class.extend('Commander', function(KLASS, OO){
1353
1357
  OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
1354
1358
  "VERSION: " + JS2.VERSION + "\n" +
@@ -1412,7 +1416,7 @@ JS2.Class.extend('Commander', function(KLASS, OO){
1412
1416
 
1413
1417
  OO.addMember("getUpdater",function () {
1414
1418
  var inDir = this.config.args[0] || this.config.sourceDir || '.';
1415
- var targetDir = this.config.args[1] || this.config.outDir || inDir;
1419
+ var targetDir = this.config.args[1] || this.config.targetDir || inDir;
1416
1420
  return new JS2.Updater(this.fs, inDir, targetDir, this.config.recursive);
1417
1421
  });
1418
1422
 
@@ -1435,6 +1439,7 @@ JS2.Class.extend('Commander', function(KLASS, OO){
1435
1439
  });
1436
1440
 
1437
1441
 
1442
+
1438
1443
  JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
1439
1444
  OO.addMember("file",function (code) {
1440
1445
  return code;
@@ -1479,6 +1484,7 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
1479
1484
 
1480
1485
  JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
1481
1486
 
1487
+
1482
1488
  JS2.Class.extend('JSML', function(KLASS, OO){
1483
1489
  OO.addStaticMember("process",function (txt) {
1484
1490
  return new KLASS(txt);
@@ -1667,6 +1673,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
1667
1673
  return (out.length ? ' ' : '') + out.join(' ');
1668
1674
  });
1669
1675
  });
1676
+
1670
1677
  JS2.TEMPLATES = { jsml: JS2.JSML };
1671
1678
 
1672
1679
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: js2
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.16
5
+ version: 0.3.17
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jeff Su
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-09 00:00:00 +08:00
13
+ date: 2011-04-13 00:00:00 +08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  version: "0"
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
- description: A superset of the Javascript language to make development easier.
27
+ description: "Javascript Sugar: A superset of the Javascript language to make development easier."
28
28
  email: me@jeffsu.com
29
29
  executables:
30
30
  - js2-ruby
@@ -71,6 +71,6 @@ rubyforge_project:
71
71
  rubygems_version: 1.5.2
72
72
  signing_key:
73
73
  specification_version: 3
74
- summary: Javascript Syntactic Sugar
74
+ summary: Javascript Sugar
75
75
  test_files: []
76
76