From c8139317ee6e2ad7bf4b9c52e3d7699ec24ee5d5 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 3 Nov 2014 13:09:36 +1100 Subject: [PATCH] add static property inherit warning for IE <= 9 to README - closes #116 --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9dd9fd937..f74281f289 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,9 @@ map embedded in a comment at the bottom. Compile the entire `src` directory and output it to the `lib` directory. $ 6to5 src --out-dir lib - + Compile the entire `src` directory and output it to the one concatenated file. - + $ 6to5 src --out-file script-compiled.js Pipe a file in via stdin and output it to `script-compiled.js` @@ -283,6 +283,23 @@ If you're inheriting from a class then static properties are inherited from it via [\_\_proto\_\_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto), this is widely supported but you may run into problems with much older browsers. +**NOTE:** `__proto__` is not supported on IE <= 9 so static properties +**will not** be inherited. A possible workaround is to use `super();`: + +```javascript +class Foo { + static foo() { + + } +} + +class Bar extends Foo { + static foo() { + super(); + } +} +``` + ### Generators The [regenerator runtime](https://github.com/facebook/regenerator/blob/master/runtime.js)