File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,9 @@ module.exports = class XMLElement extends XMLNode
2222 @name = @stringify .eleName name
2323 @children = []
2424 @instructions = []
25-
2625 @attributes = {}
27- for own attName, attValue of attributes
28- @ attribute attName, attValue
26+
27+ @ attribute attributes if attributes ?
2928
3029
3130 # Clones self
@@ -76,13 +75,13 @@ module.exports = class XMLElement extends XMLNode
7675 #
7776 # `name` attribute name
7877 removeAttribute : (name ) ->
78+ if not name?
79+ throw new Error " Missing attribute name"
80+
7981 if _ .isArray name # expand if array
8082 for attName in name
8183 delete @attributes [attName]
8284 else
83- if not name?
84- throw new Error " Missing attribute name"
85-
8685 delete @attributes [name]
8786
8887 return @
You can’t perform that action at this time.
0 commit comments