anchor.diff:    StringPrototype.Values.Add('trim', PropertyValue.NotEnum(new EcmaScriptFunctionObject(self, 'trim', @StringTrim, 0)));
   end;
   
  -method GlobalObject.StringCall(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  +
  +method GlobalObject.StringCall(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
   begin
     exit coalesce(Utilities.GetArgAsString(args, 0, aCaller), String.Empty);
   end;
   
  -method GlobalObject.StringCtor(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lVal := if length(args) = 0 then String.Empty else Coalesce(Utilities.GetArgAsString(args, 0, aCaller), String.Empty);
  +
  +method GlobalObject.StringCtor(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lVal := if  (length(args) = 0)  then
  +                String.Empty
  +              else
  +                coalesce(Utilities.GetArgAsString(args, 0, aCaller), String.Empty);
  +
     var lObj := new EcmaScriptObject(self, StringPrototype, &Class := 'String', Value := lVal);
     lObj.Values.Add('length', PropertyValue.NotDeleteAndReadOnly(lVal.Length));
  -  exit lObj;
  -end;
  -
  -method GlobalObject.StringFromCharCode(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lRes := new char[Length(args)];
  -  for i: Integer := 0 to lRes.Length -1 do begin
  +
  +  exit  (lObj);
  +end;
  +
  +
  +method GlobalObject.StringFromCharCode(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lRes := new Char[length(args)];
  +
  +  for  i: Int32  :=  0  to  lRes.Length-1  do
       lRes[i] := Char(Utilities.GetArgAsInteger(args, i, aCaller));
  -  end;
  -  exit new String(lRes);
  -end;
  -
  -method GlobalObject.StringToString(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  if aSelf is String then exit aSelf;
  -  if (aSelf is EcmaSCriptObject) and(EcmaScriptObject(aSelf).Class = 'String') then  exit EcmaScriptObject(aSelf).Value;
  +
  +  exit  (new String(lRes));
  +end;
  +
  +
  +method GlobalObject.StringToString(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  if  (aSelf is String)  then
  +    exit  (aSelf);
  +
  +  if  ((aSelf is EcmaScriptObject)  and  (EcmaScriptObject(aSelf).Class = 'String'))  then
  +    exit  (EcmaScriptObject(aSelf).Value);
  +
     RaiseNativeError(NativeErrorType.TypeError, 'String.prototype.toString is not generic');
   end;
   
  -method GlobalObject.StringValueOf(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  if aSelf is String then exit aSelf;
  -  if (aSelf is EcmaSCriptObject) and(EcmaScriptObject(aSelf).Class = 'String') then  exit EcmaScriptObject(aSelf).Value;
  +
  +method GlobalObject.StringValueOf(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  if  (aSelf is String)  then
  +    exit  (aSelf);
  +  if  ((aSelf is EcmaScriptObject)  and  (EcmaScriptObject(aSelf).Class = 'String'))  then
  +    exit  (EcmaScriptObject(aSelf).Value);
  +
     RaiseNativeError(NativeErrorType.TypeError, 'String.prototype.valueOf is not generic');
   end;
   
  -method GlobalObject.StringCharAt(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  +
  +method GlobalObject.StringCharAt(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lSelf := coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
     var lIndex := Utilities.GetArgAsInteger(args, 0, aCaller);
  -  if (lIndex < 0) or (lIndex>=lSelf.Length) then exit string.Empty;
  -  exit new string(lSelf[lIndex], 1);
  -end;
  -
  -method GlobalObject.StringCharCodeAt(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  +
  +  if  ((lIndex < 0)  or  (lIndex >= lSelf.Length))  then
  +    exit  (String.Empty);
  +
  +  exit  (new String(lSelf[lIndex], 1));
  +end;
  +
  +
  +method GlobalObject.StringCharCodeAt(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lSelf := coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
     var lIndex := Utilities.GetArgAsInteger(args, 0, aCaller);
  -  if (lIndex < 0) or (lIndex>=lSelf.Length) then exit Double.NaN;
  -  exit Integer(lSelf[lIndex]);
  -end;
  -
  -method GlobalObject.StringConcat(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  -  if args.Length = 0 then exit lSelf;
  -  if args.Length = 1 then exit lSelf + Utilities.GetArgAsString(args, 0, aCaller);
  -  if args.Length = 2 then exit lSelf + Utilities.GetArgAsString(args, 0, aCaller)+ Utilities.GetArgAsString(args, 1, aCaller);
  -  var fsb := new StringBuilder;
  +
  +  if  ((lIndex < 0)  or  (lIndex >= lSelf.Length))  then
  +    exit  (Double.NaN);
  +
  +  exit  (Integer(lSelf[lIndex]));
  +end;
  +
  +
  +method GlobalObject.StringConcat(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lSelf := coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  +
  +  if  (args.Length = 0)  then
  +    exit  (lSelf);
  +
  +  if  (args.Length = 1)  then
  +    exit  (lSelf + Utilities.GetArgAsString(args, 0, aCaller));
  +
  +  if  (args.Length = 2)  then
  +    exit  (lSelf + Utilities.GetArgAsString(args, 0, aCaller)+ Utilities.GetArgAsString(args, 1, aCaller));
  +
  +  var fsb := new StringBuilder();
     fsb.Append(lSelf);
  -  for i: Integer := 0 to args.Length -1 do begin
  +
  +  for  i: Int32  :=  0  to  args.Length-1  do
       fsb.Append(Utilities.GetArgAsString(args, i, aCaller));
  -  end;
  -  exit fsb.ToString;
  -end;
  -
  -method GlobalObject.StringIndexOf(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);
  +
  +  exit  (fsb.ToString());
  +end;
  +
  +
  +method GlobalObject.StringIndexOf(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 lIndex := Utilities.GetArgAsInteger(args, 1, aCaller);
  -  if lIndex >= lSelf.Length then exit -1;
  -  exit lSelf.IndexOf(lNeedle, lIndex);
  -end;
  -
  -method GlobalObject.StringLastIndexOf(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);
  +
  +  if  (lIndex >= lSelf.Length)  then
  +    exit  (-1);
  +
  +  exit  (lSelf.IndexOf(lNeedle, lIndex));
  +end;
  +
  +
  +method GlobalObject.StringLastIndexOf(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 lIndex := Utilities.GetArgAsInteger(args, 1, aCaller);
  -  if (lIndex >= lSelf.Length) or (lIndex = 0) then exit lSelf.Length;
  -  exit lSelf.LastIndexOf(lNeedle, lIndex);
  -end;
  -
  -method GlobalObject.StringReplace(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  -  var lSearch := Coalesce(Utilities.GetArgAsString(args, 0, aCaller), String.Empty);
  -  var lReplace := Coalesce(Utilities.GetArgAsString(args, 1, aCaller), String.Empty);
  -  exit lSelf.Replace(lSearch, lReplace);
  -end;
  -
  -method GlobalObject.StringSlice(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  -begin
  -  var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  -  if lSelf = nil then exit Undefined.Instance;
  -  var lStart := Utilities.GetArgAsInteger(Args, 0, aCaller);
  -  var lObj := Utilities.GetArg(Args, 1);
  -  var lEnd := Iif((lObj = nil) or (lObj = Undefined.Instance), Int32.MaxValue, Utilities.GetObjAsInteger(lObj, aCaller));
  -  if lStart < 0 then begin
  +
  +  if  ((lIndex >= lSelf.Length)  or  (lIndex = 0))  then
  +    exit  (lSelf.Length);
  +
  +  exit  (lSelf.LastIndexOf(lNeedle, lIndex));
  +end;
  +
  +
  +method GlobalObject.StringReplace(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lSelf := coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  +  var lSearch := coalesce(Utilities.GetArgAsString(args, 0, aCaller), String.Empty);
  +  var lReplace := coalesce(Utilities.GetArgAsString(args, 1, aCaller), String.Empty);
  +
  +  exit  (lSelf.Replace(lSearch, lReplace));
  +end;
  +
  +
  +method GlobalObject.StringSlice(aCaller: ExecutionContext;  aSelf: Object;  params args: array of Object): Object;
  +begin
  +  var lSelf := coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
  +
  +  if  (lSelf = nil)  then
  +    exit  (Undefined.Instance);
  +
  +  var lStart := Utilities.GetArgAsInteger(args, 0, aCaller);
  +  var lObj := Utilities.GetArg(args, 1);
  +  var lEnd := iif((lObj = nil) or (lObj = Undefined.Instance), Int32.MaxValue, Utilities.GetObjAsInteger(lObj, aCaller));
  +
  +  if  (lStart < 0)  then  begin
       lStart := lSelf.Length + lStart;
  -    if lStart < 0 then 
  +    if  (lStart < 0)  then 
         lStart := 0;
     end;
   
  
positive.code:     exit;
    end else
      exit new EcmaScriptArrayObject(self, 0).AddValues(lValues);
    {$ELSE}
    exit new EcmaScriptArrayObject(self, 0).AddValues(lSelf.Split([lNeedle], lMax, StringSplitOptions.None));
    {$ENDIF}
  end;
  
  method GlobalObject.StringSubString(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    exit StringSlice(aCaller, aSelf, Args);
  end;
  
  method GlobalObject.StringToLowerCase(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    var lSelf: string := string(aSelf);
    if (lSelf = nil) and (aSelf is EcmaScriptObject) then
      lSelf := string(EcmaScriptObject(aSelf).Value);
    if lSelf = nil then RaiseNativeError(NativeErrorType.TypeError, 'String.prototype.toLowerCase is not generic');
    exit lSelf.ToLowerInvariant;
  end;
  
  method GlobalObject.StringToUpperCase(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    var lSelf: string := string(aSelf);
    if (lSelf = nil) and (aSelf is EcmaScriptObject) then
      lSelf := string(EcmaScriptObject(aSelf).Value);
    if lSelf = nil then RaiseNativeError(NativeErrorType.TypeError, 'String.prototype.toUpperCase is not generic');
    exit lSelf.ToUpperInvariant;
  end;
  
  method GlobalObject.StringToLocaleLowerCase(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    var lSelf: string := string(aSelf);
    if (lSelf = nil) and (aSelf is EcmaScriptObject) then
      lSelf := string(EcmaScriptObject(aSelf).Value);
    if lSelf = nil then RaiseNativeError(NativeErrorType.TypeError, 'String.prototype.toLocaleLowerCase is not generic');
    exit lSelf.ToLower;
  end;
  
  method GlobalObject.StringToLocaleUpperCase(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
      var lSelf: string := string(aSelf);
    if (lSelf = nil) and (aSelf is EcmaScriptObject) then
      lSelf := string(EcmaScriptObject(aSelf).Value);
    if lSelf = nil then RaiseNativeError(NativeErrorType.TypeError, 'String.prototype.toLocaleUpperCase is not generic');
    exit lSelf.ToUpper;
  end;
  
  method GlobalObject.StringSearch(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
    var lObj: EcmaScriptRegexpObject;
    if (Length(args) = 0) or (args[0] is not EcmaScriptRegexpObject) then begin
      lObj := new EcmaScriptRegexpObject(self, Utilities.GetArgAsString(args,0, aCaller), '');
    end else lObj := EcmaScriptRegexpObject(args[0]);
  
    try
    var lMatch := lObj.Regex.Match(lSelf);
    exit iif((lMatch = nil) or not lMatch.Success, -1, lMatch.Index);
    except
      on e: Exception do 
      RaiseNativeError(NativeErrorType.SyntaxError, e.Message);
    end;
  end;
  
  method GlobalObject.StringMatch(aCaller: ExecutionContext;aSelf: Object; params args: Array of Object): Object;
  begin
    var lSelf := Coalesce(Utilities.GetObjAsString(aSelf, aCaller), String.Empty);
    var lObj: EcmaScriptRegexpObject;
    if (Length(args) = 0) or (args[0] is not EcmaScriptRegexpObject) then begin
      lObj := new EcmaScriptRegexpObject(self, Utilities.GetArgAsString(args,0, aCaller), '');
    end else lObj := EcmaScriptRegexpObject(args[0]);
    if not lObj.GlobalVal then exit RegExpExec(aCaller, lObj, lSelf);
    
    var lRealResult := new EcmaScriptArrayObject(self, 0);
  
  
negative.code:       var lThisIndex := Utilities.GetObjAsInteger(lObj.Get(aCaller, 0, 'lastIndex'), aCaller);
        if lThisIndex = lPrevLastIndex then begin
          lPrevLastIndex := lThisIndex + 1;
          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;
  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;
  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);
  