Skip to content

Commit b7065dc

Browse files
committed
Fix CrashTemplate3 clashing variable names
1 parent d363fc3 commit b7065dc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/templates/crash.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Template from "./template";
33
export const CrashTemplate1 = Template(`
44
var {var} = "a";
55
while(1){
6-
{var} = {var} += "a"; //add as much as the browser can handle
6+
{var} = {var} += "a";
77
}
88
`);
99

@@ -40,16 +40,16 @@ try {
4040
});
4141
4242
{$1}();
43-
} catch ( e ) {
44-
while(e ? e : !e){
45-
var b;
46-
var c = 0;
47-
(e ? !e : e) ? (function(e){
48-
c = e ? 0 : !e ? 1 : 0;
49-
})(e) : b = 1;
43+
} catch ( {$1}e ) {
44+
while({$1}e ? {$1}e : !{$1}e){
45+
var {$1}b;
46+
var {$1}c = 0;
47+
({$1}e ? !{$1}e : {$1}e) ? (function({$1}e){
48+
{$1}c = {$1}e ? 0 : !{$1}e ? 1 : 0;
49+
})({$1}e) : {$1}b = 1;
5050
51-
if(b&&c){break;}
52-
if(b){continue;}
51+
if({$1}b&&{$1}c){break;}
52+
if({$1}b){continue;}
5353
}
5454
}
5555
`);

0 commit comments

Comments
 (0)