Skip to content

Preserve prototypal inheritance in IE10 #820

@bloodyowl

Description

@bloodyowl

Hello,

I forked the repo about this, and just wanted to have your opinion on this before testing and proposing it :

https://github.com/mlbli/zepto/commit/8b140fd80e9a31b66832a9405a2c5907361571f3

The main goal of this part is to preserve prototypal inheritance with Zepto objects in IE :

On a "modern" browser :

var doc = $(document) 
doc.foo // undefined
$.fn.foo = "bar"
doc.foo // "bar"

With $.extend(dom, $.fn) in IE:

var doc = $(document) 
doc.foo // undefined
$.fn.foo = "bar"
doc.foo // undefined

The main bottleneck is that it uses another context for execution (via an iframe), so isArray mush use {}.toString instead of instanceof. Positive point though, isZ in IE can now use isPrototypeOf.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions