anchor.diff:    end;
   end;
   
  +method EcmaScriptCompiler.WriteSwitchstatement(el: SwitchStatement);
  +begin
  +  var lLabels: array of Label := new Label[el.Clauses.Count];
  +  for i: Integer := 0 to lLabels.length -1 do begin
  +    lLabels[i] := filg.DefineLabel;
  +  end;
  +
  +  var lWork := AllocateLocal(typeof(Object));
  +  WriteExpression(el.ExpressionElement);
  +  CallGetValue(el.ExpressionElement.Type);
  +  filg.Emit(Opcodes.Stloc, lWork);
  +  
  +  var lGotDefault := false;
  +  for I: integer := 0 to el.Clauses.Count -1 do begin
  +    if el.Clauses[i].ExpressionElement = nil then lGotDefault := true else begin
  +      filg.Emit(opcodes.Ldloc, lWork);
  +      WriteExpression(el.Clauses[i].ExpressionElement);
  +      CallGetValue(el.ExpressionElement.Type);
  +      filg.Emit(Opcodes.Call, Operators.Method_StrictEqual);
  +      filg.Emit(Opcodes.Brtrue, lLabels[i]);
  +    end;
  +  end;
  +  if lGotDefault then begin
  +    for I: integer := 0 to el.Clauses.Count -1 do begin
  +      if el.Clauses[i].ExpressionElement = nil then begin
  +        filg.Emit(Opcodes.Br, lLabels[i]);
  +        break;
  +      end;
  +    end;
  +  end;
  +
  +  ReleaseLocal(lWork);
  +
  +  var lOldContinue := fContinue;
  +  var lOldBreak := fBreak;
  +  fBreak := filg.DefineLabel;
  +  MarkLabelled(fBreak, nil);
  +  if not lGotDefault then filg.Emit(Opcodes.Br, Label(fBreak));
  +  
  +
  +  for i: Integer := 0 to el.Clauses.Count -1 do begin
  +    filg.MarkLabel(lLabels[i]);
  +    for each bodyelement in el.Clauses[i].Body do
  +      WriteStatement(bodyelement);
  +  end;
  +
  +  filg.MarkLabel(Label(fBreak));
  +
  +  fBreak := lOldBreak;
  +  fContinue := lOldContinue;
  +end;
  +
   end.
positive.code:  
     MarkLabelled(fBreak, fContinue);
  
    filg.MarkLabel(fContinue);
    filg.Emit(Opcodes.ldloc, lLocal);
    filg.Emit(Opcodes.CallVirt, lMoveNext);
    filg.Emit(Opcodes.Brfalse, fBreak);
  
    WriteExpression(lWork);
    filg.Emit(Opcodes.Ldloc, lLocal);
  
negative.code:   fContinue := fILG.DefineLabel;
    fBreak := filg.DefineLabel;
    MarkLabelled(fBreak, fContinue);
    filg.MarkLabel(Label(fContinue));
    WriteExpression(el.ExpressionElement);
    filg.Emit(Opcodes.Call, Utilities.method_GetObjAsBoolean);
    filg.Emit(Opcodes.Brfalse, Label(fBreak));
  
  
    WriteStatement(el.Body);
  
    filg.Emit(Opcodes.Br, Label(fContinue));
    filg.MarkLabel(Label(fBreak));
  
    fBreak := lOldBreak;
    fContinue := lOldContinue;
  