How to have javascript that can't use window.* methods

I am creating a new project called "Burn". This will be similar to Khan Academy's Computer Science program. How could I have a "private" JavaScript context that cannot use any methods other that those specified?

You can use IIFE (immediatelyinvoked function expression) and write your code in it. You can redefine window object in that context so you cannot access other methods on window object.

(function (window){
    //code and other functions here
    // here window is undefined
})();

But I am not sure why you'd want that.

See jsFiddle