|
@@ -190,18 +190,19 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
|
|
|
|
|
|
/* Method not implemented handlers */
|
|
/* Method not implemented handlers */
|
|
|
|
|
|
- var methods = [], checker = Object.create(null);
|
|
|
|
|
|
+ var methods = [], methodDict = Object.create(null), checker = Object.create(null);
|
|
this.selectors = [];
|
|
this.selectors = [];
|
|
|
|
|
|
this.get = function (stSelector) {
|
|
this.get = function (stSelector) {
|
|
- var index = this.selectors.indexOf(stSelector);
|
|
|
|
- if(index !== -1) {
|
|
|
|
- return methods[index];
|
|
|
|
|
|
+ var method = methodDict[stSelector];
|
|
|
|
+ if(method) {
|
|
|
|
+ return method;
|
|
}
|
|
}
|
|
this.selectors.push(stSelector);
|
|
this.selectors.push(stSelector);
|
|
var jsSelector = st.st2js(stSelector);
|
|
var jsSelector = st.st2js(stSelector);
|
|
checker[jsSelector] = true;
|
|
checker[jsSelector] = true;
|
|
var method = {jsSelector: jsSelector, fn: createHandler(stSelector)};
|
|
var method = {jsSelector: jsSelector, fn: createHandler(stSelector)};
|
|
|
|
+ methodDict[stSelector] = method;
|
|
methods.push(method);
|
|
methods.push(method);
|
|
manip.installMethod(method, rootAsClass);
|
|
manip.installMethod(method, rootAsClass);
|
|
return method;
|
|
return method;
|