global static function returns nullReference error [unityscript]

hi!

I have a _globals.js:

public static class _globals
{
	public static function _map(value, A, B, C, D) : float 
	{
		return (value - A) / (B - A) * (D - C) + C;
	}
}

I assign the variables like this in otherScript.js

var b = _globals._map(_brightness, 0, 1, 0, 5);

But it keeps giving my this error:

NullReferenceException: Object
reference not set to an instance of an
object
Boo.Lang.Runtime.RuntimeServices.InvokeBinaryOperator
(System.String operatorName,
System.Object lhs, System.Object rhs)
_globals._map (System.Object value, System.Object A, System.Object B,
System.Object C, System.Object D) (at
Assets/Scripts/_globals.js:11)
animations.FixedUpdate () (at
Assets/Scripts/animations.js:20)

I’m lost! what am I doing wrong here? From what I understood a static class doesn’t need an instance. Alas I tried this as well:

_globals.js:

public class _globals
{
	function _map(value, A, B, C, D) : float 
	{
		return (value - A) / (B - A) * (D - C) + C;
	}
}

private var g = new _globals();
g._map(blablalbal)

same error! It keeps referring to the _map function but I have no clue what’s wrong there. Who can enlighten me?

ps: though I get an error It still gives me the right values and everything works correctly…

I have zero problem with your static first version once i declared what each parameter to the _map function was, prior to that errors were displaying referencing using the ‘-’ operator on type of Object.

public static class _globals
 {
     public static function _map(value:float, A:float, B:float, C:float, D:float) : float 
     {
         return (value - A) / (B - A) * (D - C) + C;
     }
 }

alright I sort of fixed the problem… I simply have to turn on the app that sends the OSC, so that the variable actually exists is my guess that fixes this problem o_O