Skip to content
Browse files

Provide a unique copy of options to each call to compile()

The compiler adds attributes to the options object on the first pass;
consequential passes are not decorated with the '__extend()' and other
functions.  This makes sense when compiling a long list of javascript
files into a single file, but grunt-coffee compiles each file into
its javascript equivalent at the target end.

This patch gives a fresh clone of the options object passed from the
user's grunt.js configuration file to each call to coffee.compile().
  • Loading branch information...
1 parent 7c3d875 commit d64c5b6ad6bdc77ad613088e5f34f12cebb72297 @elfsternberg elfsternberg committed Jul 23, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 tasks/coffee.js
3 tasks/coffee.js
@@ -20,8 +20,9 @@ module.exports = function(grunt) {
var dest = this.file.dest,
options =,
extension =;
grunt.file.expandFiles(this.file.src).forEach(function(filepath) {
- grunt.helper('coffee', filepath, dest, options, extension);
+ grunt.helper('coffee', filepath, dest, grunt.utils._.clone(options), extension);
if (grunt.task.current.errorCount) {

0 comments on commit d64c5b6

Please sign in to comment.
Something went wrong with that request. Please try again.