anchor.diff:      var fType: &Type;
       class method ConvertTo(val: Object; aType: &Type): Object;
     public
  +    constructor(aValue: Object; aType: &Type; aGlobal: GlobalObject);
  +
       property &Type: &Type read fType;
       property Value: Object read fValue; reintroduce;
       property &Static: Boolean read fValue = nil;
  -    class method IsCompatibleType(aInput: &Type; aTarget: &Type): Boolean;
  -    class method FindAndCallBestOverload(aMethods: array of System.Reflection.MethodBase;  aRoot: GlobalObject;  aNiceName: String; aSelf: Object; aArgs: array of Object): Object;
  -    constructor(aValue: Object; aType: &Type; aGlobal: GlobalObject);
  +
  +    class method IsCompatibleType(sourceType: &Type;  targetType: &Type): Boolean;
  +    class method FindAndCallBestOverload(methods: array of MethodBase;  root: GlobalObject;  methodName: String;  &self: Object;  parameters: array of Object): Object;
  +
       method DefineOwnProperty(aName: String; aValue: PropertyValue; aThrow: Boolean): Boolean; override;
       method GetOwnProperty(aName: String): PropertyValue; override;
       method Get(aExecutionContext: ExecutionContext; aFlags: Integer; aName: String): Object; override;
  
positive.code:   if  ((lParams.Length > 0)  and  (length(lParams[lParams.Length-1].GetCustomAttributes(typeOf(ParamArrayAttribute), false)) > 0)) then 
      lParamStart := lParams.Length -1;
  
    for  j: Int32  :=  0  to  length(aArgs)-1  do  begin
      if  ((lParamStart <> -1)  and  (j >= lParamStart))  then  begin
        if  (j = lParamStart)  then
          lReal[j] := Array.CreateInstance(lParams[lParams.Length-1].ParameterType.GetElementType, length(aArgs) - lParamStart);
  
        Array(lReal[lParamStart]).SetValue(ConvertTo(aArgs[j], lParams[lParams.Length-1].ParameterType.GetElementType()), j - lParamStart);
      end
      else  begin
        lReal[j] := ConvertTo(aArgs[j], lParams[j].ParameterType);
      end;
    end;
  
    try
      if  (lMeth  is  ConstructorInfo)  then
        exit  (EcmaScriptScope.DoTryWrap(aRoot, ConstructorInfo(lMeth).Invoke(lReal)));
  
      exit  (EcmaScriptScope.DoTryWrap(aRoot, lMeth.Invoke(aSelf, lReal)));
    except
      on  e: TargetInvocationException  do  begin
        if  (e.InnerException is RemObjects.Script.ScriptRuntimeException)  then
          raise e.InnerException;
  
        raise  new RemObjects.Script.ScriptRuntimeException(EcmaScriptScope.DoTryWrap(aRoot, e.InnerException) as EcmaScriptObject);
      end;
      on  e: Exception where e is not RemObjects.Script.ScriptRuntimeException  do
        raise new RemObjects.Script.ScriptRuntimeException(EcmaScriptScope.DoTryWrap(aRoot, e) as EcmaScriptObject);
    end;
  end;
  
  
  class method EcmaScriptObjectWrapper.IsCompatibleType(aInput: &Type;  aTarget: &Type): Boolean;
  begin
    if  ((aInput = nil)  or  (aInput = typeOf(Undefined)))  then
      exit  (not aTarget.IsValueType);
  
    if  (aTarget.IsAssignableFrom(aInput))  then
      exit  (true);
  
    if  (((aInput = typeOf(Double))  or  (aInput = typeOf(Int32))) 
                     and  (&Type.GetTypeCode(aTarget)  in  [TypeCode.Byte, TypeCode.Char, TypeCode.DateTime, TypeCode.Decimal,
                                         TypeCode.Double, TypeCode.Int16, TypeCode.Int32, TypeCode.Int64, TypeCode.SByte,
                                         TypeCode.Single, TypeCode.UInt16, TypeCode.UInt32, TypeCode.UInt64]))  then
      exit  (true);
  
    if  (aTarget = typeOf(String))  then
      exit  (true);
  
    exit  (false);
  
negative.code: end;
  
  
  class method EcmaScriptObjectWrapper.FindAndCallBestOverload(methods: array of MethodBase;  root: GlobalObject;  methodName: String;
                     &self: Object;  parameters: array of Object): Object;
  begin
    var lMethods := new List<MethodBase>(methods);
  
    for  i: Int32  :=  0  to  length(parameters)-1  do  begin
      if  (parameters[i] is EcmaScriptObjectWrapper)  then
        parameters[i] := EcmaScriptObjectWrapper(parameters[i]).Value; // if these were wrapped before, we should unwrap
    end;
  
    for  i: Int32  :=  lMethods.Count-1  downto  0  do  begin
  