实际上用this应该就可以,比如
function a(id) {
this.id = id;
function b() {
alert(this.id);
} b();
} a("vvv");