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

Unified Diff: test/codegen/expect/fieldtest.js

Issue 1224083017: Add support for Enums (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Use interpolation Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/fieldtest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/fieldtest.js
diff --git a/test/codegen/expect/fieldtest.js b/test/codegen/expect/fieldtest.js
index b69e90dba298c923f5f704ffd60d9e2a012a517d..f69baba971e9b23e0defea2a1d3e2866215870d9 100644
--- a/test/codegen/expect/fieldtest.js
+++ b/test/codegen/expect/fieldtest.js
@@ -92,12 +92,31 @@ dart_library.library('fieldtest', null, /* Imports */[
StaticFieldOrder2.c = dart.notNull(StaticFieldOrder2.d) + 2;
StaticFieldOrder2.b = dart.notNull(StaticFieldOrder2.c) + 3;
StaticFieldOrder2.a = dart.notNull(StaticFieldOrder2.b) + 1;
+ class MyEnum extends core.Object {
+ MyEnum(index) {
+ this.index = index;
+ }
+ toString() {
+ return {
+ 0: "MyEnum.Val1",
+ 1: "MyEnum.Val2",
+ 2: "MyEnum.Val3",
+ 3: "MyEnum.Val4"
+ }[this.index];
+ }
+ };
+ MyEnum.Val1 = dart.const(new MyEnum(0));
+ MyEnum.Val2 = dart.const(new MyEnum(1));
+ MyEnum.Val3 = dart.const(new MyEnum(2));
+ MyEnum.Val4 = dart.const(new MyEnum(3));
+ MyEnum.values = dart.const(dart.list([MyEnum.Val1, MyEnum.Val2, MyEnum.Val3, MyEnum.Val4], MyEnum));
function main() {
let a = new A();
foo(a);
bar(a);
core.print(baz(a));
core.print(new (Generic$(core.String))().foo(' world'));
+ core.print(MyEnum.values);
}
dart.fn(main, dart.void, []);
// Exports:
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/fieldtest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698