Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

see changelog

  • Loading branch information...
commit d5fae5b453670a47143e04b021c1bd760e8fb9f9 1 parent 917f685
Jeff Su authored
6 CHANGELOG
View
@@ -1,3 +1,7 @@
+0.3.16
+ * JSML: Support dashes in classes and id
+ * GEM: Took out debug info in rack.rb
+
0.3.15
* JSML: added "eval'd" attribute handling
* JSML: fixed browser js2 file
@@ -52,5 +56,3 @@
0.3.3
* using closure for classes instead of hashes
* adding static methods
-
-
11 dist/browser/js2-full.js
View
@@ -1128,7 +1128,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1238,7 +1237,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1284,7 +1282,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1356,7 +1353,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1443,7 +1439,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1488,7 +1483,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1551,8 +1545,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1677,7 +1671,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
(function (undefined, JS2) {
6 dist/browser/js2.js
View
@@ -269,7 +269,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -332,8 +331,8 @@ JS2.Array.prototype.any = function() {
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -459,7 +458,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
11 dist/gem/lib/js2/js2.js
View
@@ -1124,7 +1124,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1234,7 +1233,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1280,7 +1278,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1352,7 +1349,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1439,7 +1435,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1484,7 +1479,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1547,8 +1541,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1673,7 +1667,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
1  dist/gem/lib/js2/rack.rb
View
@@ -5,7 +5,6 @@ module JS2
class Rack
def get_root
@root ||= defined?(Rails) ? Rails.root : File.expand_path(Dir.getwd)
- puts "ROOT:#{@root}"
return @root
end
12 dist/npm/lib/js2.js
View
@@ -1124,7 +1124,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1234,7 +1233,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1280,7 +1278,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1352,7 +1349,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1439,7 +1435,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1484,7 +1479,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1547,8 +1541,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1673,7 +1667,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
@@ -1728,7 +1721,6 @@ JS2.TEMPLATES = { jsml: JS2.JSML };
});
});
-
JS2.fs = new JS2.FileSystem(new JS2.NodeFileAdapter());
js2.DECORATOR = new JS2.NodeDecorator();
11 flavors/browser-full.js
View
@@ -1128,7 +1128,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1238,7 +1237,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1284,7 +1282,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1356,7 +1353,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1443,7 +1439,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1488,7 +1483,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1551,8 +1545,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1677,7 +1671,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
(function (undefined, JS2) {
6 flavors/browser.js
View
@@ -269,7 +269,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -332,8 +331,8 @@ JS2.Array.prototype.any = function() {
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -459,7 +458,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
12 flavors/node.js
View
@@ -1124,7 +1124,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1234,7 +1233,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1280,7 +1278,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1352,7 +1349,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1439,7 +1435,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1484,7 +1479,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1547,8 +1541,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1673,7 +1667,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
@@ -1728,7 +1721,6 @@ JS2.TEMPLATES = { jsml: JS2.JSML };
});
});
-
JS2.fs = new JS2.FileSystem(new JS2.NodeFileAdapter());
js2.DECORATOR = new JS2.NodeDecorator();
12 flavors/ringo-full.js
View
@@ -1126,7 +1126,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1236,7 +1235,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1282,7 +1280,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1354,7 +1351,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1441,7 +1437,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1486,7 +1481,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1549,8 +1543,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1675,7 +1669,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
@@ -1731,7 +1724,6 @@ JS2.TEMPLATES = { jsml: JS2.JSML };
});
});
-
JS2.fs = new FileSystem(new RingoFileAdapter());
JS2.DECORATOR = new JS2.RingoDecorator();
6 flavors/ringo.js
View
@@ -266,7 +266,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -329,8 +328,8 @@ JS2.Array.prototype.any = function() {
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -456,7 +455,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
11 flavors/ruby.js
View
@@ -1124,7 +1124,6 @@ JS2.Array.prototype.any = function() {
return this.length > 0;
};
-
JS2.Class.extend('FileSystem', function(KLASS, OO){
OO.addMember("initialize",function (adapter) {
this.adapter = adapter;
@@ -1234,7 +1233,6 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
});
});
-
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
@@ -1280,7 +1278,6 @@ JS2.Class.extend('Updater', function(KLASS, OO){
});
});
-
JS2.Class.extend('Config', function(KLASS, OO){
OO.addMember("CLI_REGEX",/^-(r|i|f|n|v|m)(=(\w+))?$/);
OO.addMember("optsLookup",{
@@ -1352,7 +1349,6 @@ JS2.Class.extend('Config', function(KLASS, OO){
});
-
JS2.Class.extend('Commander', function(KLASS, OO){
OO.addMember("BANNER","js2 <command> [options] <arguments>\n" +
"VERSION: " + JS2.VERSION + "\n" +
@@ -1439,7 +1435,6 @@ JS2.Class.extend('Commander', function(KLASS, OO){
});
-
JS2.Class.extend('BrowserDecorator', function(KLASS, OO){
OO.addMember("file",function (code) {
return code;
@@ -1484,7 +1479,6 @@ JS2.Class.extend('RingoDecorator', function(KLASS, OO){
JS2.DECORATOR = JS2.DECORATOR || new JS2.BrowserDecorator();
-
JS2.Class.extend('JSML', function(KLASS, OO){
OO.addStaticMember("process",function (txt) {
return new KLASS(txt);
@@ -1547,8 +1541,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("SCOPE_REGEX",/^(\s*)(.*)$/);
- OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
- OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w-]+)/g);
+ OO.addMember("SPLIT_REGEX",/^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/);
+ OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
@@ -1673,7 +1667,6 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
return (out.length ? ' ' : '') + out.join(' ');
});
});
-
JS2.TEMPLATES = { jsml: JS2.JSML };
4 src/Common/JSML.js2
View
@@ -60,8 +60,8 @@ class JSML {
class JSMLElement {
var SCOPE_REGEX = /^(\s*)(.*)$/;
- var SPLIT_REGEX = /^((?:\.|\#|\%)[^=\-\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/;
- var TOKEN_REGEX = /(\%|\#|\.)([\w-]+)/g;
+ var SPLIT_REGEX = /^((?:\.|\#|\%)[^=\s\{]*)?(\{.*\})?(=|-)?(?:\s*)(.*)$/;
+ var TOKEN_REGEX = /(\%|\#|\.)([\w][\w\-]*)/g;
var JS_REGEX = /^(-|=)(.*)$/g;
var SCOPE_OFFSET = 1;
4 tests/src/jsml.js2
View
@@ -10,7 +10,7 @@ var text = <<END:jsml
END
var text2 = <<END:jsml
- %div
+ %div.hello-world
hello
world
END
@@ -20,6 +20,6 @@ js2.test(#(assert) {
var result = text.result({ hello:"yo", bar:"foo", yo:['hello', 'world'] });
var expected = '<div>hello</div><div>world</div><div class="yo"><div class="hello">foo</div><div class="world"></div></div><span class="yo" href="/">Hello world</span>yo'
assert.eq(expected, result);
- assert.eq('<div>helloworld</div>', text2.result());
+ assert.eq('<div class="hello-world">helloworld</div>', text2.result());
});
Please sign in to comment.
Something went wrong with that request. Please try again.