File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change 1- ( function ( ) {
2- this . a = 0 ;
3- baz ( ( ) => this ) ;
4- } ) ( )
1+ class Safe {
2+ contents : string ;
53
6- function foo ( ) {
7- this . a = 0 ;
8- baz ( ( ) => this )
4+ constructor ( contents : string ) {
5+ this . contents = contents ;
6+ }
7+
8+ printContents ( ) {
9+ console . log ( this . contents ) ;
10+ }
911}
1012
1113var foo = function ( ) {
1214 this . a = 0 ;
13- var message = "Some message text"
1415 baz ( ( ) => this ) ;
15- }
16+ } ;
Original file line number Diff line number Diff line change 1- ( function ( ) {
2- this . a = 0 ;
3- baz ( ( ) => this ) ;
4- } ) ( )
1+ class Safe {
2+ contents : string ;
53
6- function foo ( ) {
7- this . a = 0 ;
8- baz ( ( ) => this )
4+ constructor ( contents : string ) {
5+ this . contents = contents ;
6+ }
7+
8+ printContents ( ) {
9+ console . log ( this . contents ) ;
10+ }
911}
1012
1113var foo = function ( ) {
1214 this . a = 0 ;
13- var message = "Some message text"
1415 baz ( ( ) => this ) ;
15- }
16+ } ;
You can’t perform that action at this time.
0 commit comments