joyent/node — Issue #2894: Changing frame of a function
Author: RumpleFraggle
Created: 2012-03-08 13:40:15+00:00
State: open

var spo = function(){

console.log(q);

};

var car = function(){
var q =20;
with(this){
spo();
}
};

Is there a way to get this to work the way I would like it to || is there a module somewhere that creates a function to change the context of an executing function maybe something like

var spo = function(){

console.log(q);

};

var car = function(){
var q =20;
mod.inContextofFunction(car,spo);
};

I may not be explaining it well but I am looking for something similar to what the VM module does but on a function level basis.

This may already exists but if it does not could you give me a line of source code to start reading at it so I can figure out how to make it exist!