square/es6-class — pull request #2 by thomasboyt (2014-04-02 17:08:06+00:00)
Title: Use newer recast to support source maps

This PR should look [familiar](https://github.com/square/es6-arrow-function/pull/4) :)

The source maps are pretty good fidelity, too: [here's an example](http://sokra.github.io/source-map-visualization/#base64,dmFyIEFuaW1hbCA9IGZ1bmN0aW9uKCkgewogICAgICBmdW5jdGlvbiBBbmltYWwoKSB7fQoKICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFuaW1hbC5wcm90b3R5cGUsICJzYXlIaSIsIHsKICAgICAgICB2YWx1ZTogZnVuY3Rpb24oKSB7CiAgICAgICAgICByZXR1cm4gJ0hpLCBJIGFtIGEgJyt0aGlzLnR5cGUoKSsnLic7CiAgICAgICAgfSwKCiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UKICAgICAgfSk7CgogICAgICByZXR1cm4gQW5pbWFsOwogICAgfSgpOwoKdmFyIERvZyA9IGZ1bmN0aW9uKCkgewogICAgICBmdW5jdGlvbiBEb2coKSB7CiAgICAgICAgT2JqZWN0LmdldFByb3RvdHlwZU9mKERvZy5wcm90b3R5cGUpLmNvbnN0cnVjdG9yLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgICAgIH0KCiAgICAgIERvZy5fX3Byb3RvX18gPSBBbmltYWw7CiAgICAgIERvZy5wcm90b3R5cGUgPSBPYmplY3QuY3JlYXRlKEFuaW1hbC5wcm90b3R5cGUpOwoKICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KERvZy5wcm90b3R5cGUsICJjb25zdHJ1Y3RvciIsIHsKICAgICAgICB2YWx1ZTogRG9nCiAgICAgIH0pOwoKICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KERvZy5wcm90b3R5cGUsICJ0eXBlIiwgewogICAgICAgIHZhbHVlOiBmdW5jdGlvbigpIHsgcmV0dXJuICdkb2cnOyB9LAogICAgICAgIGVudW1lcmFibGU6IGZhbHNlCiAgICAgIH0pOwoKICAgICAgT2JqZWN0LmRlZm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B9XG59XG5cbmNsYXNzIERvZyBleHRlbmRzIEFuaW1hbCB7XG4gIHR5cGUoKSB7IHJldHVybiAnZG9nJzsgfVxuXG4gIHNheUhpKCkge1xuICAgIHJldHVybiBzdXBlcigpICsgJyBXT09GISc7XG4gIH1cbn1cblxuYXNzZXJ0LmVxdWFsKG5ldyBEb2coKS5zYXlIaSgpLCAnSGksIEkgYW0gYSBkb2cuIFdPT0YhJyk7XG4iXX0=,Y2xhc3MgQW5pbWFsIHsKICBzYXlIaSgpIHsKICAgIHJldHVybiAnSGksIEkgYW0gYSAnK3RoaXMudHlwZSgpKycuJzsKICB9Cn0KCmNsYXNzIERvZyBleHRlbmRzIEFuaW1hbCB7CiAgdHlwZSgpIHsgcmV0dXJuICdkb2cnOyB9CgogIHNheUhpKCkgewogICAgcmV0dXJuIHN1cGVyKCkgKyAnIFdPT0YhJzsKICB9Cn0KCmFzc2VydC5lcXVhbChuZXcgRG9nKCkuc2F5SGkoKSwgJ0hpLCBJIGFtIGEgZG9nLiBXT09GIScpOwo=).

(as an aside, I'm excited about this because now the es6-arrow-function, es6-class, and the Recast branch of es6-module-transpiler now have the same public API and should be easy to chain!)