mozilla/sweet.js — pull request #127 by jlongster (2013-11-20 06:15:04+00:00)
Title: add "macros" option to install global macros in compile API

This is a quick tweak to the compile API that lets you pass in additional macros to install globally. This difference between this and simply concat'ing sources is that this generates correct source map information.

I haven't reflected this in sjs.js, which we probably should do. Whatever is passed to `-m` should probably use this. I'm writing my own Grunt plugin to use it so I just need the lower-level support.

Additionally, in my Grunt plugin I'm automatically adding `require('source-map-support').install();` at the beginning of the generated source, which nicely makes node use the sourcemaps in stack traces automatically. It might be worth adding an option to `sjs` for this as well. (I'll publish my grunt plugin at some point)

Let me know what you think about this, I can continue to tweak this PR based on feedback.