You can always do something like this: http://www.skulpt.org/
None of the disadvantages of such an approach matter in a learning context. Sure, it's slow relative to a real implementation... but so what?
(I'm also not saying that particular link is a drop-in solution, as I've never heard of it until I went googling on the theory that something like it must exist. But if you were building a business on this, it looks far enough along that you could adapt it as needed.)
But when you have to blow so much time on screwy things like "this" scoping and unwanted implicit conversions it kind of tips the balance.