File tree 3 files changed +3
-9
lines changed
3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -149,9 +149,7 @@ export function walk(
149
149
context,
150
150
path,
151
151
replaceWith ( newNode ) {
152
- if ( replacedNode ) {
153
- throw new Error ( 'Cannot replace a node more than once' )
154
- }
152
+ if ( replacedNode ) return
155
153
replacedNode = true
156
154
157
155
if ( Array . isArray ( newNode ) ) {
Original file line number Diff line number Diff line change @@ -98,9 +98,7 @@ export function walk(
98
98
visit ( node , {
99
99
parent,
100
100
replaceWith ( newNode ) {
101
- if ( replacedNode ) {
102
- throw new Error ( 'Cannot replace a node more than once' )
103
- }
101
+ if ( replacedNode ) return
104
102
replacedNode = true
105
103
106
104
if ( Array . isArray ( newNode ) ) {
Original file line number Diff line number Diff line change @@ -69,9 +69,7 @@ export function walk(
69
69
visit ( node , {
70
70
parent,
71
71
replaceWith ( newNode ) {
72
- if ( replacedNode ) {
73
- throw new Error ( 'Cannot replace a node more than once' )
74
- }
72
+ if ( replacedNode ) return
75
73
replacedNode = true
76
74
77
75
if ( Array . isArray ( newNode ) ) {
You can’t perform that action at this time.
0 commit comments