```coffee
canGenerateDataUris = btoa? and JSON?

compile =
  if btoa? and JSON?
    (code, options = {}) ->
      options.sourceMap = true
      options.inline = true
      {js, v3SourceMap} = CoffeeScript.compile code, options
      "#{js}\n//@ sourceMappingURL=data:application/json;base64,#{btoa v3SourceMap}\n//@ sourceURL=coffeescript"
  else CoffeeScript.compile
```