Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / jsbuilder / src / Parser / Statement / Deprecated.js
diff --git a/jsbuilder/src/Parser/Statement/Deprecated.js b/jsbuilder/src/Parser/Statement/Deprecated.js
new file mode 100644 (file)
index 0000000..5fc94b4
--- /dev/null
@@ -0,0 +1,14 @@
+Loader.require('Parser.Statement.If');
+
+Parser.Statement.Deprecated = Ext.extend(Parser.Statement.If, {
+    constructor: function() {
+        Parser.Statement.Deprecated.superclass.constructor.apply(this, arguments);
+
+        if (this.getProperty('since') === null) {
+            throw new Error("[Parser.Statement.Deprecated] 'since' property is required for deprecated statement");
+        }
+
+        this.setProperty('minVersion', '<=' + this.getProperty('since'));
+        this.removeProperty('since');
+    }
+});