Reversing evaluation order of __inArray to reflect the ordering of the in operator.

This commit is contained in:
Timothy Jones
2010-10-20 09:52:11 +13:00
parent c3582d4058
commit 502d444ebd
2 changed files with 4 additions and 4 deletions

View File

@@ -1496,7 +1496,7 @@
return "(" + (tests.join(' || ')) + ")";
};
In.prototype.compileLoopTest = function(o) {
return "" + (utility('inArray')) + "(" + (this.array.compile(o)) + ", " + (this.object.compile(o)) + ")";
return "" + (utility('inArray')) + "(" + (this.object.compile(o)) + ", " + (this.array.compile(o)) + ")";
};
return In;
})();
@@ -1962,7 +1962,7 @@
UTILITIES = {
"extends": 'function(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor;\n if (typeof parent.extended === "function") parent.extended(child);\n child.__super__ = parent.prototype;\n}',
bind: 'function(func, context) {\n return function() { return func.apply(context, arguments); };\n}',
inArray: '(function() {\n var indexOf = Array.prototype.indexOf || function(item) {\n var i = this.length; while (i--) if (this[i] === item) return i;\n return -1;\n };\n return function(array, item) { return indexOf.call(array, item) > -1; };\n})();',
inArray: '(function() {\n var indexOf = Array.prototype.indexOf || function(item) {\n var i = this.length; while (i--) if (this[i] === item) return i;\n return -1;\n };\n return function(item, array) { return indexOf.call(array, item) > -1; };\n})();',
hasProp: 'Object.prototype.hasOwnProperty',
slice: 'Array.prototype.slice'
};