diff --git a/packages/@lwc/synthetic-shadow/src/faux-shadow/node.ts b/packages/@lwc/synthetic-shadow/src/faux-shadow/node.ts
index b33d7f8cbd..629feed204 100644
--- a/packages/@lwc/synthetic-shadow/src/faux-shadow/node.ts
+++ b/packages/@lwc/synthetic-shadow/src/faux-shadow/node.ts
@@ -408,7 +408,6 @@ defineProperties(Node.prototype, {
},
cloneNode: {
value(this: Node, deep?: boolean): Node {
- deep = isUndefined(deep) || deep;
if (isNodeShadowed(this) || isHostElement(this)) {
return cloneNodePatched.call(this, deep);
}
diff --git a/packages/integration-karma/test/shadow-dom/Node-properties/Node.cloneNode.spec.js b/packages/integration-karma/test/shadow-dom/Node-properties/Node.cloneNode.spec.js
index 64e99281a4..e9156cae86 100644
--- a/packages/integration-karma/test/shadow-dom/Node-properties/Node.cloneNode.spec.js
+++ b/packages/integration-karma/test/shadow-dom/Node-properties/Node.cloneNode.spec.js
@@ -55,6 +55,35 @@ describe('Node.cloneNode', () => {
});
});
+ describe('deep=undefined', () => {
+ it('should not clone shadow tree', () => {
+ const elm = createElement('x-slotted', { is: Slotted });
+ document.body.appendChild(elm);
+
+ const clone = elm.cloneNode();
+ expect(clone.childNodes.length).toBe(0);
+ expect(clone.outerHTML).toBe('
Cat |
---|
Dog |