jeudi 31 décembre 2015

Is it not possible to get the arguments array from a static method?

I'm trying to get the reserved keyword arguments array from inside a static method and I'm getting this error:

1042: The this keyword can not be used in static methods. It can only be used in instance methods, function closures, and global code.

Here is my code:

public static function doSomething(message:String, ...Arguments):void {
    var object:Object = this.arguments.caller;
}

If I take the this keyword out then I get the following error:

1120: Access of undefined property arguments.

Aucun commentaire:

Enregistrer un commentaire