Explicit returns on DOMElementPool

This commit is contained in:
Antonio Scandurra
2015-09-17 12:16:24 +02:00
parent 3fe34ed748
commit fd1c20ed2a

View File

@@ -8,6 +8,7 @@ class DOMElementPool
@freedElements.clear()
for tagName, freeElements of @freeElementsByTagName
freeElements.length = 0
return
build: (tagName, className, textContent = "") ->
element = @freeElementsByTagName[tagName]?.pop()
@@ -27,6 +28,7 @@ class DOMElementPool
for index in [element.children.length - 1..0] by -1
child = element.children[index]
@freeElementAndDescendants(child)
return
free: (element) ->
throw new Error("The element cannot be null or undefined.") unless element?