Q:

Returning a function for the outside function in Javascript

I don't know this is possible, but I have some special situations requiring it.
//Obj is a class with nothing.
Obj.prototype.v1 = function(){
    //this is a normal statement.
    //it could be something else
    return 3;
}
//or it can be any way to declare a function: 
var v1 = function(){return 3};

Obj.prototype.v2 = function(){
    return this.v1()+2;
}

How to make it directly returns 3 here? It's like the function v1() is something like pseudocode this.return(3) for v2(), and certainly nothing can be reached after the first return.
If I'm generating the code dynamically and it has to be a return in the second function. (So it can easily get unexpected token for return (return 3).v2(), while trying to get the inside function to be called behaving like it's part of current function.)
Is there anyway to make this.v1() directly cause outside function v2() to return, for the first return it encounters? Preferably by focusing on modifying v1().

A:

Is there anyway to make this.v1() directly cause outside function v2() to return, for the first return it encounters?

The idiomatic solution is to express this logic in v2. For example, you could cause v1 to modify a flag that decides what v2 does:
Obj.prototype.v1 = function(){
    this.v1.continue = true;  /* XXX: Continue? */
    this.v1.continue = false; /* ...  or not?   */
    return 3;
}

Obj.prototype.v2 = function(){
    var ret_val = this.v1()+2;
    if (!this.v1.continue) {
        return;
    }
    /* XXX: Insert more code here */
}

We're talking about rather basic JavaScript here. Do you have a book?

Preferably by focusing on modifying v1().

I'm sure it's possible to circumvent the control of execution that v2 has when v1 returns in some situations, but that doesn't make it a good idea. Think about how difficult it'll become to debug this code!
For example, you could throw an error which v2 doesn't catch, and catch it further upstream. Such a hideous abuse of throw would be worse than the abuse of goto! Don't modify your code flow in such an unclear manner; it makes maintenance and debugging a nightmare!

