1

ユーザーのjavascriptをサンドボックス化し、それらのインターフェースの変更を許可せずにインターフェースを公開するにはどうすればよいのでしょうか? 特にnodejs環境で。例:

//public class you can interface (should be immutable)
function InterfaceClass () {
    this.x = 0;
    thix.y = 0;
}

//executing users code (in a sandbox of some sort)
function userCode () {
    //disallow this:
    InterfaceClass = function () {

    };

    //allow this:
    var interface = new Interface();
    interface.x = 1;
}
4

1 に答える 1