tc39 / proposal-observable

Observables for ECMAScript
https://tc39.github.io/proposal-observable/
3.07k stars 90 forks source link

Add test to avoid constructor as function #172

Closed aicest closed 7 years ago

aicest commented 7 years ago

https://tc39.github.io/proposal-observable/#observable If NewTarget is undefined, throw a TypeError exception.

TypeError will be thrown in ES5 code transpiled by Babel.

https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAEBiD29oG8C-Q&debug=false&circleciRepo=&evaluate=false&lineWrap=false&presets=es2015&targets=&version=6.26.0

But, it will not in general ES5 code...