You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// of diff and using the output to apply the changes
173
172
// to the source with the help of magic string.
174
173
174
+
leterror=false;
175
+
consterrorCase=(e)=>{
176
+
error=true;
177
+
letmsg="Automatic source map generation failed, or produced an inaccurate result. If you need a proper source map, you should provide it manually, otherwise you can ignore this message.";
178
+
if(e){
179
+
msg=`${msg}\n___\n${e}`;
180
+
}
181
+
context.warn(msg);
182
+
};
183
+
175
184
constms=newMagicString(source);
176
185
leti=0;
177
186
178
187
for(constdiff$1ofdiff.diffChars(source,code)){
179
188
180
189
if(diff$1.added){
181
-
ms.appendRight(i,diff$1.value);
182
-
}elseif(diff$1.removed){
183
-
ms.remove(i,i+=diff$1.count);
184
-
}else{
190
+
try{
191
+
ms.appendRight(i,diff$1.value);
192
+
}catch(e){
193
+
errorCase(e);
194
+
break;
195
+
}
196
+
}
197
+
198
+
elseif(diff$1.removed){
199
+
try{
200
+
ms.remove(i,i+=diff$1.count);
201
+
}catch(e){
202
+
errorCase(e);
203
+
break;
204
+
}
205
+
}
206
+
207
+
else{
185
208
i+=diff$1.count;
186
209
}
187
210
}
188
211
212
+
// Test if the code output of the magic string instance
0 commit comments