raptor-render-context
Advanced tools
Comparing version 0.2.11-beta to 0.2.12-beta
@@ -179,16 +179,17 @@ /* | ||
function Context(writer, attributes) { | ||
this.attributes = attributes || { | ||
events: new EventEmitter() | ||
}; | ||
this.attributes = attributes || (attributes = {}); | ||
// Closing the underlying writer if this is a top-level context as indicated | ||
// by the lack of pre-existing attributes | ||
if (!attributes && writer && writer.end) { | ||
this.on('end', function() { | ||
writer.end(); | ||
}); | ||
if (!attributes.events) { | ||
attributes.events = new EventEmitter(); | ||
} | ||
if (!this.attributes.async) { | ||
this.attributes.async = { | ||
if (!attributes.async) { | ||
if (writer && writer.end) { | ||
this.on('end', function() { | ||
writer.end(); | ||
}); | ||
} | ||
attributes.async = { | ||
remaining: 0, | ||
@@ -195,0 +196,0 @@ ended: false, |
@@ -29,3 +29,3 @@ { | ||
}, | ||
"version": "0.2.11-beta" | ||
"version": "0.2.12-beta" | ||
} |
28287
648