Is it possible to run a function in another context where it can access local variables with this context?
I made this proof of concept:
var t = (function()
{
"use strict";
var ab = 5;
var f = (function(t)
{
return function(c){ c.call(t); }
})(t);
return f;
})();
t(function()
{
return ab;
});
This give me this error: ReferenceError: ab is not defined
Is there a way that the anonymous function that I pass to t can access the local variable ab?