I have following javaScript \"class\":
A = (function() { a = function() { eval(...) }; A.prototype.b = function(arg1, arg2) { /* do something... */}; }
What worked for me was using Function constructor and calling it in specified context:
Function
var o = { x: 10 } (new Function(`console.log(this.x)`)).call(o);
This somehow doesn't work in browser's console but works elsewhere.