I have following javaScript \"class\":
A = (function() { a = function() { eval(...) }; A.prototype.b = function(arg1, arg2) { /* do something... */}; }
Another Bam!
eval('(function (data) {'+code+'})').call(selector,some_data);
This example will keep yours context and send some data. In my case, is a some DOM selector