Browse Source

Refactored DNUBrik to use more local variables

Herbert Vojčík 11 years ago
parent
commit
ba8425e8e7
1 changed files with 7 additions and 9 deletions
  1. 7 9
      support/boot.js

+ 7 - 9
support/boot.js

@@ -168,25 +168,24 @@ function DNUBrik(brikz, st) {
 
 	/* Method not implemented handlers */
 
-	this.methods = [];
+	var methods = [], checker = Object.create(null);
 	this.selectors = [];
-	this.checker = Object.create(null);
 
 	this.get = function (string) {
 		var index = this.selectors.indexOf(string);
 		if(index !== -1) {
-			return this.methods[index];
+			return methods[index];
 		}
 		this.selectors.push(string);
 		var selector = st.selector(string);
-		this.checker[selector] = true;
+		checker[selector] = true;
 		var method = {jsSelector: selector, fn: this.createHandler(selector)};
-		this.methods.push(method);
+		methods.push(method);
 		return method;
 	};
 
 	this.isSelector = function (selector) {
-		return this.checker[selector];
+		return checker[selector];
 	};
 
 	/* Dnu handler method */
@@ -201,9 +200,8 @@ function DNUBrik(brikz, st) {
 	}
 
 	this.installHandlers = function (klass) {
-		var m = this.methods;
-		for(var i=0; i<m.length; i++) {
-			manip.installMethodIfAbsent(m[i], klass);
+		for(var i=0; i<methods.length; i++) {
+			manip.installMethodIfAbsent(methods[i], klass);
 		}
 	};
 }