- From: Glen Huang <curvedmark@gmail.com>
- Date: Thu, 6 Aug 2015 10:55:41 +0800
- To: Brian Kardell <bkardell@gmail.com>
- Cc: public-webapps <public-webapps@w3.org>
Thanks for the detailed explanation.
The only thing I'm not sure I understand is the pattern you described:
```
HTMLElement.prototype.foo = HTMLElement.prototype._foo;
```
I had this pattern in mind when you talked about prollyfills:
```
HTMLElement.prototype._foo = function() {
if (HTMLElement.prototype.foo) return this.foo();
return polyfill();
};
```
And users are expected to use it like html._foo() My concern was that when most browsers ship HTMLElement.prototype.foo, users might want to change html._foo() to html.foo() so they can use the native version, and the prollyfill is expect to release a new version with
```
if (!HTMLElement.prototype.foo) {
HTMLElement.prototype.foo = function() {
return polyfill();
};
}
```
I was saying changing html._foo() to html.foo() aren't that different from changing foo(html) to html.foo();
Where does HTMLElement.prototype.foo = HTMLElement.prototype._foo fit in the picture?
BTW, just curious, how do you come up with the name "prollyfill" :) ? Why adding a R there?
Received on Thursday, 6 August 2015 02:56:19 UTC