anchor.diff:  ﻿{
  -
  -  Copyright (c) 2009-2010 RemObjects Software. See LICENSE.txt for more details.
  -
  +  Copyright (c) 2009-2013 RemObjects Software, LLC.
  +  See LICENSE.txt for more details.
   }
  +
   namespace RemObjects.Script;
   
   interface
   
  +{$HIDE W27}
  +
   uses
  +  System.Collections.Generic,
     System.Reflection,
  -  System.Collections.Generic,
     System.Text;
   
   type
  
positive.code:     class var Method_Unwrap: MethodInfo := typeOf(ScriptRuntimeException).GetMethod('Unwrap'); readonly;
      class var Method_Wrap: MethodInfo := typeOf(ScriptRuntimeException).GetMethod('Wrap'); readonly;
  
      constructor(aOriginal: Object);
      property Original: Object read fOriginal;
      method ToString: String; override;
    end;
  
    PositionPair = public record
    public
  
negative.code: begin
    result := String.Format('{0}({1}:{2}): {3}', fPosition.Module, fPosition.Row, fPosition.Col, IntToString);
  end;
  
  
  {$REGION ScriptRuntimeException }
  constructor ScriptRuntimeException(original: Object);
  begin
    self.fOriginal := original;
  
    inherited constructor(ScriptRuntimeException.SafeEcmaScriptToObject(original));
  end;
  
  
  class method ScriptRuntimeException.SafeEcmaScriptToObject(o: Object): String;
  begin
    if not assigned(o) then
      exit 'Error';
  
    try
      exit o.ToString();
    except
      exit 'Error';
    end;
  end;
  
  
  class method ScriptRuntimeException.Wrap(arg: Object): Exception;
  begin
    var lResult: Exception := Exception(arg);
    if assigned(lResult) then
      exit lResult;
  
    exit new ScriptRuntimeException(arg);
  end;
  
  
  class method ScriptRuntimeException.Unwrap(arg: Object): Object;
  begin
    if arg is ScriptRuntimeException then
      exit ScriptRuntimeException(arg).Original;
  
    exit arg;
  end;
  
  
  method ScriptRuntimeException.ToString(): String;
  begin
    exit self.Message;
  end;
  {$ENDREGION}
  
  
  method ScriptScope.ContainsVariable(name: String): Boolean;
  begin
  