File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ namespace VisitorPattern {
55 export function show ( ) : void {
66 var objs : VisitorPattern . Objs = new VisitorPattern . Objs ( ) ;
77
8- objs . attach ( < VisitorPattern . Element > new VisitorPattern . ConcreteElement1 ( ) ) ;
9- objs . attach ( < VisitorPattern . Element > new VisitorPattern . ConcreteElement2 ( ) ) ;
8+ objs . attach ( new VisitorPattern . ConcreteElement1 ( ) ) ;
9+ objs . attach ( new VisitorPattern . ConcreteElement2 ( ) ) ;
1010
1111 var v1 : VisitorPattern . ConcreteVisitor1 = new VisitorPattern . ConcreteVisitor1 ( ) ,
1212 v2 : VisitorPattern . ConcreteVisitor2 = new VisitorPattern . ConcreteVisitor2 ( ) ;
Original file line number Diff line number Diff line change @@ -29,14 +29,14 @@ namespace VisitorPattern {
2929 operate ( visitor : Visitor ) : void ;
3030 }
3131
32- export class ConcreteElement1 {
32+ export class ConcreteElement1 implements Element {
3333 public operate ( visitor : Visitor ) : void {
3434 console . log ( "`operate` of ConcreteElement1 is being called!" ) ;
3535 visitor . visitConcreteElement1 ( this ) ;
3636 }
3737 }
3838
39- export class ConcreteElement2 {
39+ export class ConcreteElement2 implements Element {
4040 public operate ( visitor : Visitor ) : void {
4141 console . log ( "`operate` of ConcreteElement2 is being called!" ) ;
4242 visitor . visitConcreteElement2 ( this ) ;
You can’t perform that action at this time.
0 commit comments