Re: Is polyfilling future web APIs a good idea?

@William @Matthew

Ah, thanks. Now I think prollyfill is prolly a good name. :)

@Brian

Actually, I had this pattern in mind:

When no browsers ship the API:

```
if (HTMLElement.prototype.foo) {
  HTMLElement.prototype._foo = HTMLElement.prototype.foo;
} else {
  HTMLElement.prototype._foo = polyfill;
};
```

When at least two browsers ship this API:

```
if (!HTMLElement.prototype.foo) {
 HTMLElement.prototype.foo = polyfill;
}
HTMLElement.prototype._foo = function() {
  console.warn("deprecated");
  return this.foo();
};
```

Received on Thursday, 6 August 2015 22:51:17 UTC