Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / jsbuilder / src / Parser / Statement / Debug.js
1 Loader.require('Parser.Statement.If');
2
3 (function() {
4
5 var priorities = {
6     error: 3,
7     warn: 2,
8     info: 1
9 };
10
11 var Debug = Parser.Statement.Debug = Ext.extend(Parser.Statement.If, {
12     constructor: function() {
13         var priority, name;
14
15         Debug.superclass.constructor.apply(this, arguments);
16
17         this.setProperty('debug', true);
18
19         for (name in priorities) {
20             if (priorities.hasOwnProperty(name)) {
21                 if (this.getProperty(name)) {
22                     priority = priorities[name];
23                     this.removeProperty(name);
24                     break;
25                 }
26             }
27         }
28
29         if (!priority) {
30             priority = 1;
31         }
32
33         this.setProperty('debugLevel', '<=' + priority);
34     }
35 });
36
37
38 })();