I've created a simple 'require' mechanism (https://gist.github.com/
1031869), in which the included script is compiled and run in a new
context.
However, when I call a function in the included script and pass it
'this', the included script doesn't see any properties in it.

//required.js - compiled and run in new context
exports.logThis = function(what){
 for (key in what) log(key + ' : ' + what[key]);
}

//main.js
logger = require('required');
this.someProp = {some: 'prop'}
logger.logThis({one: 'two'});   //works, prints 'one : two'
logger.logThis(this); //doesn't work, prints nothing. expected 'some :
prop'
logger.logThis(this.someProp); //works, prints 'some : prop'

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to