diff --git a/compiler/generate/visitors/EachBlock.js b/compiler/generate/visitors/EachBlock.js
index b2fe66ccac..474eabce64 100644
--- a/compiler/generate/visitors/EachBlock.js
+++ b/compiler/generate/visitors/EachBlock.js
@@ -72,7 +72,7 @@ export default {
const params = generator.current.params + `, ${listName}, ${node.context}, ${indexName}`;
- generator.current = {
+ generator.push({
useAnchor: false,
name: renderer,
target: 'target',
@@ -100,11 +100,11 @@ export default {
counter: counter(),
parent: generator.current
- };
+ });
},
leave ( generator ) {
generator.addRenderer( generator.current );
- generator.current = generator.current.parent;
+ generator.pop();
}
};
diff --git a/compiler/generate/visitors/Element.js b/compiler/generate/visitors/Element.js
index 2a55994f4d..8f5bf5f861 100644
--- a/compiler/generate/visitors/Element.js
+++ b/compiler/generate/visitors/Element.js
@@ -148,7 +148,7 @@ export default {
if ( local.update.length ) generator.current.updateStatements.push( local.update.join( '\n' ) );
generator.current.teardownStatements.push( local.teardown.join( '\n' ) );
- generator.current = Object.assign( {}, generator.current, {
+ generator.push({
isComponent,
namespace: local.namespace,
target: name,
@@ -162,7 +162,7 @@ export default {
const name = generator.current.target;
const isComponent = generator.current.isComponent;
- generator.current = generator.current.parent;
+ generator.pop();
if ( isComponent ) return;
diff --git a/test/compiler/svg-each-block-namespace/_config.js b/test/compiler/svg-each-block-namespace/_config.js
new file mode 100644
index 0000000000..eccd720c03
--- /dev/null
+++ b/test/compiler/svg-each-block-namespace/_config.js
@@ -0,0 +1,15 @@
+export default {
+ html: `
+
+ `,
+
+ test ( assert, component, target ) {
+ const circles = target.querySelectorAll( 'circle' );
+ assert.equal( circles[0].namespaceURI, 'http://www.w3.org/2000/svg' );
+ assert.equal( circles[1].namespaceURI, 'http://www.w3.org/2000/svg' );
+ assert.equal( circles[2].namespaceURI, 'http://www.w3.org/2000/svg' );
+ component.teardown();
+ }
+};
diff --git a/test/compiler/svg-each-block-namespace/main.html b/test/compiler/svg-each-block-namespace/main.html
new file mode 100644
index 0000000000..95e5443d1e
--- /dev/null
+++ b/test/compiler/svg-each-block-namespace/main.html
@@ -0,0 +1,15 @@
+
+
+