anchor.diff:        var lThisIndex := Utilities.GetObjAsInteger(lObj.Get(aCaller, 0, 'lastIndex'), aCaller);
         if lThisIndex = lPrevLastIndex then begin
           lPrevLastIndex := lThisIndex + 1;
  -        lOBj.LastIndex := lPrevLastIndex;
  +        lObj.LastIndex := lPrevLastIndex;
         end else
           lPrevLastIndex := lThisIndex;
         var lMatchStr := lRes.Get(aCaller, 2, '0');
         lRealResult.AddValue(lMatchStr);
       end;
     end;
  -  if lRealResult.Length = 0 then exit nil;
  -
  -  exit lRealResult;
  -end;
  -
  -method GlobalObject.StringLocaleCompare(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  +
  +  if  (lRealResult.Length = 0)  then
  +    exit  (nil);
  +
  +  exit  (lRealResult);
  +end;
  +
  +
  +method GlobalObject.StringLocaleCompare(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
   begin
     if (aSelf = nil) or (aSelf = Undefined.Instance) then RaiseNativeError(NativeErrorType.TypeError, 'null/undefined not coercible');
     exit String.Compare(Utilities.GetObjAsString(aSelf, aCaller), Utilities.GetArgAsString(args, 0, aCaller), StringComparison.CurrentCulture);
   end;
   
  -method GlobalObject.StringTrim(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  +
  +method GlobalObject.StringTrim(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
   begin
     if (aSelf = nil) or (aSelf = Undefined.Instance) then RaiseNativeError(NativeErrorType.TypeError, 'null/undefined not coercible');
     exit Utilities.GetObjAsString(aSelf, aCaller).Trim();
   end;
   
  +
   method EcmaScriptStringObject.Call(context: ExecutionContext; params args: array of Object): Object;
   begin
     exit Root.StringCall(context, self, args);
   end;
   
  +
   method EcmaScriptStringObject.Construct(context: ExecutionContext; params args: array of Object): Object;
   begin
     exit Root.StringCtor(context, self, args);
  
positive.code:   exit lSelf.Substring(lStart, lEnd - lStart);
  end;
  
  method GlobalObject.StringSplit(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
    var lNeedle := Coalesce(Utilities.GetArgAsString(args, 0, aCaller), String.Empty);
    var lMax := Utilities.GetArgAsInteger(args, 1, aCaller);
    if lMax <= 0 then lMax := Int32.MaxValue;
    {$IFDEF SILVERLIGHT} 
    var lValues := lSelf.Split([lNeedle], StringSplitOptions.None);
    if lValues.length > lMax then begin
      result := new EcmaScriptArrayObject(self, 0);
  
negative.code: ﻿{
  
    Copyright (c) 2009-2011 RemObjects Software. See LICENSE.txt for more details.
  
  }
  
  namespace RemObjects.Script.EcmaScript;
  
  interface
  
  uses
    System.Collections.Generic,
    System.Text,
    RemObjects.Script.EcmaScript.Internal;
  
  type
    GlobalObject = public partial class(EcmaScriptObject)
    public
      method CreateString: EcmaScriptObject;
  
      method StringCall(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringCtor(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringFromCharCode(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringToString(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringValueOf(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringCharAt(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringCharCodeAt(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringConcat(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringIndexOf(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringLastIndexOf(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringLocaleCompare(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringMatch(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringReplace(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringSearch(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringSlice(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringSplit(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringSubString(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringToLowerCase(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringToUpperCase(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringToLocaleLowerCase(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringToLocaleUpperCase(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
      method StringTrim(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
    end;
  
  
    EcmaScriptStringObject = class(EcmaScriptFunctionObject)
    public
      method Call(context: ExecutionContext;  params args: array of Object): Object; override;
      method Construct(context: ExecutionContext;  params args: array of Object): Object; override;
    end;
  
  
  implementation
  
  