Closure does not work in Unity JS functions?

var complicated = function (init:float){
	init = init * 2;
	var subfunction = function(passme:float){
		var newval = init*passme;
	};
};

Is it possible to have a “subfunction” access the variables and parameters of the parent function?

Internal compiler error. See the console log for more information. output was:BCE0011: An error occurred during the execution of the step ‘Boo.Lang.Compiler.Steps.EmitAssembly’: 'Argument cannot be null.

The error must be somewhere else. In Unity 4 this code works fine:

#pragma strict

function Start () {
    bla();
}

function bla() {
    var complicated = function (init:float){
	    init = init * 2;
	    var subfunction = function(passme:float){
		    init = init*passme;
            return init;
	    };
        return subfunction;
    };
    var c = complicated(3);
    Debug.Log(c(5)); // 30
    Debug.Log(c(2)); // 60
    Debug.Log(c(3)); // 180
}