Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: test/e2e/lib.ts

Issue 2225953002: Strip more unused features. (Closed) Base URL: git@github.com:dart-lang/js_facade_gen.git@master
Patch Set: Fix types Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/e2e/helloworld.ts ('k') | test/e2e/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import {CONST, CONST_EXPR, forwardRef} from 'angular2/src/facade/lang';
2
3 @CONST
4 export class MyClass { 1 export class MyClass {
5 private error: string = 'error'; 2 private error: string = 'error';
6 constructor(private ctorField: string) {} 3 constructor(private ctorField: string) {}
7 4
8 get field(): string { 5 get field(): string {
9 // TODO: TypeScript doesn't parse the RHS as StringKeyword so we lose 6 // TODO: TypeScript doesn't parse the RHS as StringKeyword so we lose
10 // the translation of string -> String. 7 // the translation of string -> String.
11 // We use capital S String here, even though it wouldn't run in TS. 8 // We use capital S String here, even though it wouldn't run in TS.
12 if ((<any>' world') instanceof String) { 9 if ((<any>' world') instanceof String) {
13 return this.ctorField + ' world'; 10 return this.ctorField + ' world';
14 } else { 11 } else {
15 return this.error; 12 return this.error;
16 } 13 }
17 } 14 }
18 15
19 namedParam({x = '?'}: any = {}) { return 'hello' + x; } 16 namedParam({x = '?'}: any = {}) { return 'hello' + x; }
20 } 17 }
21 18
22 interface Observer { 19 interface Observer {
23 update(o: Object, arg: Object); 20 update(o: Object, arg: Object);
24 } 21 }
25 22
26 export class MySubclass extends MyClass implements Observer { 23 export class MySubclass extends MyClass implements Observer {
27 constructor(ctorField: string) { super(ctorField); } 24 constructor(ctorField: string) { super(ctorField); }
28 get subclassField(): string { return this.field; } 25 get subclassField(): string { return this.field; }
29 update(o: Object, arg: Object) { this.field = arg.toString(); } 26 update(o: Object, arg: Object) { this.field = arg.toString(); }
30 } 27 }
31 28
32 export const SOME_ARRAY = CONST_EXPR([1, 2, 3]); 29 export const SOME_ARRAY = [1, 2, 3];
33 export const someArray = forwardRef(() => SOME_ARRAY); 30 export const someArray = SOME_ARRAY;
OLDNEW
« no previous file with comments | « test/e2e/helloworld.ts ('k') | test/e2e/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698