Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 1212818

Browse files
authored
Merge pull request #73 from dboris/master
Fix `clone` and `deepClone`
2 parents bfa8bf2 + 9ac7563 commit 1212818

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/DOM/Node/Node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ exports.normalize = function (node) {
7171

7272
exports.clone = function (node) {
7373
return function () {
74-
return node.clone(false);
74+
return node.cloneNode(false);
7575
};
7676
};
7777

7878
exports.deepClone = function (node) {
7979
return function () {
80-
return node.clone(false);
80+
return node.cloneNode(true);
8181
};
8282
};
8383

src/DOM/Node/Node.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ foreign import setTextContent :: forall eff.
8686
foreign import normalize :: forall eff. Node -> Eff (dom :: DOM | eff) Unit
8787

8888
-- | Clones the node without cloning the node's descendants.
89-
foreign import clone :: forall eff. Node -> Eff (dom :: DOM | eff) Unit
89+
foreign import clone :: forall eff. Node -> Eff (dom :: DOM | eff) Node
9090

9191
-- | Clones the node and its descendants.
92-
foreign import deepClone :: forall eff. Node -> Eff (dom :: DOM | eff) Unit
92+
foreign import deepClone :: forall eff. Node -> Eff (dom :: DOM | eff) Node
9393

9494
-- | Checks whether two nodes are equivalent.
9595
foreign import isEqualNode :: forall eff.

0 commit comments

Comments
 (0)