jsdc icon indicating copy to clipboard operation
jsdc copied to clipboard

Javascript Downcast (es6 to es5)

Results 4 jsdc issues
Sort by recently updated
recently updated
newest added

See https://github.com/mathiasbynens/regexpu. You can use this as a dependency for your transpiler to add support for [the ES6 `/u` flag for regular expressions](https://mathiasbynens.be/notes/es6-unicode-regex). (Traceur and 6to5 depend on regexpu as...

``` js class A { constructor() { console.log(new.target.name) } } class B extends A {} new A // -> A new B // -> B ``` babel对应的issue:https://github.com/babel/babel/issues/1088 spec:http://www.ecma-international.org/ecma-262/6.0/index.html#sec-meta-properties

其他几个transpiler也是保持行数一致,但是我个人觉得6to5的做法更好。 因为生成代码可读性对于支持调试其实也很重要。但是强制源码行数一致必定导致生成代码可读性的实际下降。而且仅行数对应,也不能解决行较长没有col位置的问题。 现在浏览器都支持sourcemap,所以建议放弃行数对应,改为支持sourcemap,并给出更好的代码排版,甚至可加入注释。比如在注释中包含源码(这样还能解决不支持sourcemap的老浏览器的调试问题)。