Skip to content

Commit

Permalink
Don't try to emulate __proto__, just rewrite Z method for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
madrobby committed Sep 14, 2013
1 parent 18ff03b commit 63e3519
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 80 deletions.
27 changes: 10 additions & 17 deletions src/ie.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,18 @@
// (c) 2010-2013 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.

// this provides a incomplete but workable implementation of
// __proto__, which enables Zepto to run on Internet Explorer <= 10
;(function(){
// __proto__ doesn't exist on IE<11, so redefine
// the Z function to use object extension instead
if (!('__proto__' in {})) {
Object.defineProperty(Object.prototype, '__proto__', {
set: function(newPrototype) {
for (var property in newPrototype) {
// stops stack overflow errors
if (property == '__proto__') continue

this[property] = newPrototype[property]
}
},
get: function() {
return this
},
enumerable: false,
configurable: true
});
$.extend($.zepto, {
Z: function(dom, selector) {
dom = dom || []
$.extend(dom, $.fn)
dom.selector = selector || ''
return dom
}
})
}

// getComputedStyle shouldn't freak out when called
Expand Down
63 changes: 0 additions & 63 deletions test/ie.html

This file was deleted.

0 comments on commit 63e3519

Please sign in to comment.