Skip to content

Commit

Permalink
Use array splats instead of concatenation, allowing for Coco 0.7.6+ c…
Browse files Browse the repository at this point in the history
…ompatibility.
  • Loading branch information
rektide committed Jul 24, 2012
1 parent 3eacee2 commit f96dbbe
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions compiler.co
Expand Up @@ -352,11 +352,11 @@ class exports.Compiler extends EventEmitter
opts = @options(info_opts)
else if @options or info_opts
opts = {} <<< @options <<< info_opts
args = [text] + (if opts? then [opts] else [])
args = [text, ...opts]

if fn = @compile
fn = @module[fn] if typeof fn is not 'function'
fn.apply this, args + [cb]
fn.apply this, [...args, cb]
else if fn = @compileSync
fn = @module[fn] if typeof fn is not 'function'
try
Expand Down
6 changes: 2 additions & 4 deletions compiler.js
Expand Up @@ -402,9 +402,7 @@ exports.Compiler = Compiler = (function(superclass){
} else if (this.options || info_opts) {
opts = __import(__import({}, this.options), info_opts);
}
args = [text].concat(opts != null
? [opts]
: []);
args = [text].concat(__slice.call(opts));
if (fn = this.compile) {
if (typeof fn !== 'function') {
fn = this.module[fn];
Expand Down Expand Up @@ -904,4 +902,4 @@ function __import(obj, src){
var own = {}.hasOwnProperty;
for (var key in src) if (own.call(src, key)) obj[key] = src[key];
return obj;
}
}
2 changes: 1 addition & 1 deletion package.co
Expand Up @@ -11,7 +11,7 @@ dependencies :
# 'seq' : '>= 0.3.5'
devDependencies :
'express' : '>= 2.5.8'
'coco' : '>= 0.7.0 < 0.7.6'
'coco' : '>= 0.7.0'
'coffee-script' : '>= 1.2.0'
'jade' : '>= 0.20.3'
'stylus' : '>= 0.24.0'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"express": ">= 2.5.8",
"coco": ">= 0.7.0 < 0.7.6",
"coco": ">= 0.7.0",
"coffee-script": ">= 1.2.0",
"jade": ">= 0.20.3",
"stylus": ">= 0.24.0",
Expand Down

0 comments on commit f96dbbe

Please sign in to comment.