Permalink
Browse files

cleanup argument shifting order

  • Loading branch information...
1 parent 7bc74eb commit 9ad39f70efe442c4ba8d22eb62b1b93cb49377f0 @dodo committed Nov 9, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/xml.coffee
View
@@ -9,7 +9,7 @@ EVENTS = ['add', 'attr', 'data', 'text', 'raw', 'show', 'hide', 'remove',
parse_args = (name, attrs, children, opts) ->
unless typeof attrs is 'object'
- [opts, children, attrs] = [children, attrs, {}]
+ [attrs, children, opts] = [{}, attrs, children]
else
# if attrs is an object and you want to use opts, make children null
attrs ?= {}
@@ -349,7 +349,7 @@ class Builder extends EventEmitter
checker(parent, tag, next)
when 'ready', 'end'
- [callback, tag] = [tag, parent] # shift arguments
+ [tag, callback] = [parent, tag] # shift arguments
next = (tag) ->
checker = checkers.shift() ? callback
checker(tag, next)

0 comments on commit 9ad39f7

Please sign in to comment.