ES-Feature-Tests icon indicating copy to clipboard operation
ES-Feature-Tests copied to clipboard

ES5 Testing

Open shmuelie opened this issue 9 years ago • 4 comments

Would you be open to having ES5 features tested too? Ones that can't be polyfilled that is, like Object.defineProperty.

shmuelie avatar Aug 31 '15 19:08 shmuelie

I am open to it, but we'd want to test all of ES5's features and not just some. I wasn't sure if people would really find value in such things or not.

getify avatar Aug 31 '15 20:08 getify

I'm looking to do was you suggest (write in ES6 and compile down) but go down to ES3 if needed.

shmuelie avatar Sep 02 '15 14:09 shmuelie

Babel/Traceur go to ES5, and then es5-shim can patch a pre-ES5 environment to be up to ES5 standards.

So the only thing that doesn't cover is if you want to write ES5 syntax (like the getters/setters). That's not really transpilable though, as far as I'm aware, so I don't know how much value having such a test result would add to your scenario.

Ultimately, I'd recommend writing ES6, transpiling to ES5 (which doesn't use any of those ES5 only syntaxes), and using es5-shim to patch up pre-ES5 browsers. That should cover your like 99% use case.

getify avatar Sep 02 '15 17:09 getify

I think that may just be best. I think a basic ES5 test would still be usefull, so that you know if you should load the shim or not.

shmuelie avatar Sep 02 '15 17:09 shmuelie