<script> var txt = `var c = class SomeClass {constructor() {this.text = 'blabla'}}`; eval.call(this, txt); console.log(new c()); </script>