Skip to content

Commit bcd4c47

Browse files
committed
Also turn top-level class decls into var statements
1 parent e054600 commit bcd4c47

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

html/js/sandbox.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@
272272
}
273273
if (stat.type == "VariableDeclaration" && stat.kind != "var")
274274
patches.push({from: stat.start, to: stat.start + stat.kind.length, text: "var"})
275+
if (stat.type == "ClassDeclaration")
276+
patches.push({from: stat.start, text: "var " + stat.id.name + " = "})
275277
}
276278
patches.push({from: tryPos, text: "try{"})
277279
patches.push({from: catchPos, text: "}catch(e){__sandbox.error(e);}"})

0 commit comments

Comments
 (0)