X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/jsbuilder/src/Parser/Statement/Debug.js diff --git a/jsbuilder/src/Parser/Statement/Debug.js b/jsbuilder/src/Parser/Statement/Debug.js new file mode 100644 index 00000000..e58c32f1 --- /dev/null +++ b/jsbuilder/src/Parser/Statement/Debug.js @@ -0,0 +1,38 @@ +Loader.require('Parser.Statement.If'); + +(function() { + +var priorities = { + error: 3, + warn: 2, + info: 1 +}; + +var Debug = Parser.Statement.Debug = Ext.extend(Parser.Statement.If, { + constructor: function() { + var priority, name; + + Debug.superclass.constructor.apply(this, arguments); + + this.setProperty('debug', true); + + for (name in priorities) { + if (priorities.hasOwnProperty(name)) { + if (this.getProperty(name)) { + priority = priorities[name]; + this.removeProperty(name); + break; + } + } + } + + if (!priority) { + priority = 1; + } + + this.setProperty('debugLevel', '<=' + priority); + } +}); + + +})();