I was browsing through the jade templating engine source code and I am trying to figure out what this statement means.
I get that it's going to try and instantiate options.compiler and if that fails instantiate Compiler, but the next part confuses me... Is this saying to call parser.parse and declare the returned value as a variable? If so, why is the rightmost paren around options?
var compiler = new (options.compiler || Compiler)(parser.parse(), options)
, js = compiler.compile();
.
Here's some more context if that helps
function parse(str, options){
try {
// Parse
var parser = new Parser(str, options.filename, options);
// Compile
var compiler = new (options.compiler || Compiler)(parser.parse(), options)
, js = compiler.compile();
new (options.compiler || Compiler)must return a function that takes two parameters...