Permalink
Browse files

typeof always return string so there is no need for strong equality, …

…simple equality enough (economy of one symbol, but we want Zepto to be small as possible)
  • Loading branch information...
1 parent a1c01b7 commit 1fe9f96172de18f6b35bcf479bfc6c9efc589920 slavic committed with Mar 21, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/polyfill.js
  2. +2 −2 src/zepto.js
View
@@ -7,7 +7,7 @@ if (Array.prototype.reduce === undefined)
Array.prototype.reduce = function(fun){
if(this === void 0 || this === null) throw new TypeError();
var t = Object(this), len = t.length >>> 0, k = 0, accumulator;
- if(typeof fun !== 'function') throw new TypeError();
+ if(typeof fun != 'function') throw new TypeError();
if(len == 0 && arguments.length == 1) throw new TypeError();
if(arguments.length >= 2)
View
@@ -32,7 +32,7 @@ var Zepto = (function() {
function $(selector, context){
if (!selector) return Z();
if (context !== undefined) return $(context).find(selector);
- else if (typeof selector === 'function') return $(document).ready(selector);
+ else if (typeof selector == 'function') return $(document).ready(selector);
else if (selector instanceof Z) return selector;
else {
var dom;
@@ -85,7 +85,7 @@ var Zepto = (function() {
});
else {
var ignores = slice.call(
- typeof selector === 'string' ?
+ typeof selector == 'string' ?
this.filter(selector) :
selector instanceof NodeList ? selector : $(selector));
slice.call(this).forEach(function(el){

0 comments on commit 1fe9f96

Please sign in to comment.