Permalink
Browse files

Removed import alias as it is a future reserved word (https://develop…

  • Loading branch information...
1 parent 9dd117d commit 59d43bb9497b4d1191484d958d3edf54f379190d @oozcitak committed Jul 27, 2012
Showing with 4 additions and 12 deletions.
  1. +4 −2 src/XMLFragment.coffee
  2. +0 −10 test/test.coffee
View
@@ -256,6 +256,8 @@ class XMLFragment
# Clones self
+ #
+ # `deep` true to clone child nodes as well
clone: (deep) ->
clonedSelf = new XMLFragment @parent, @name, @attributes, @value
if deep
@@ -267,6 +269,8 @@ class XMLFragment
# Imports cloned root from another XMLBuilder
+ #
+ # `xmlbuilder` the instance of XMLBuilder to insert nodes from
importXMLBuilder: (xmlbuilder) ->
clonedRoot = xmlbuilder.root().clone(true)
clonedRoot.parent = @
@@ -409,8 +413,6 @@ class XMLFragment
c: (value) -> @comment value
r: (value) -> @raw value
u: () -> @up()
- import: (xmlbuilder) -> @importXMLBuilder xmlbuilder
-
module.exports = XMLFragment
View
@@ -204,13 +204,3 @@ test12 = builder.begin('test12')
.doc().toString()
assert.strictEqual(xml12, test12)
-# Test the import() method (shorthand of importXMLBuilder)
-# This is important, because "import" can be a reserved word and
-# possibly causes syntax error in the future.
-xml13 = '<test13><test13imported/></test13>'
-test13imported = xmlbuilder.create().begin('test13imported')
- .doc()
-test13 = builder.begin('test13')
- .import(test13imported)
- .doc().toString()
-assert.strictEqual(xml13, test13)

0 comments on commit 59d43bb

Please sign in to comment.