Skip to content
Browse files

make sure resolver doesn't get left out by an empty options obj

  • Loading branch information...
1 parent 461b08d commit 40018ed19baffa5f6b6f5bcebf2044099a5ab59f @dmachi committed Sep 28, 2010
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/template.js
View
12 lib/template.js
@@ -3,19 +3,15 @@ var parse = require("./parse").parse,
defaultRules = require("./rules");
var Template = exports.Template = function(source, options, noWrapper){
- if (!options){
- options={
- resolver: require("./resolver").Resolver
- }
- }
+ var options = options || {};
+
+ options.resolver = options.resolver || require("./resolver").Resolver;
var state = {
resolver: options.resolver
};
- if (!options.rules){
- options.rules=require("./rules").Rules(options);
- }
+ options.rules=options.rules || require("./rules").Rules(options);
if (options.extension){
state.extension = options.extension ;

0 comments on commit 40018ed

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