ECMAScript is a scripting language with a built-in prototype-based object system.
Jenglish, Tcl Chatroom, 2013-10-15, recommends reading through the annotated source code of UNDERSCORE.JS to see how they do things
jdc: Another option is tcljs . It can be used to embed spidermonkey in a Tcl application.
It can be used in combination with tcljspac to process proxy.pac files.
Yet another option for bindings to SpiderMonkey
Anyone who has read this far will probably want to know about Zombie , created for automatic testing of ECMAScript-coded applications (more than that, really; it also knows about CSS, ...). It's of broader interest, though, mostly in directions where Tclers swarm: automation, Web scraping, DOM analysis, ... Zombie is open source, of course, and a nice model for at least a few techniques that are useful in Tcl-oriented testing code.