Edit in JSFiddle

var context = "global";

var obj = {  
    context: "object",
    method: function () {                  
           function f() {
               var context = "function";
               return this + ":" +this.context; 
           };
           return f(); //invoked without context
        }
    };

document.write(obj.method()); //[object Window]:global