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

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

Issue 949383003: use js_ast instead of strings to generate JS (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: add redirecting ctor test Created 5 years, 10 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 | « test/codegen/expect/dom/dom.js ('k') | test/codegen/expect/html_input_a/html_input_a.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/fieldtest/fieldtest.js
diff --git a/test/codegen/expect/fieldtest/fieldtest.js b/test/codegen/expect/fieldtest/fieldtest.js
index 1eb1346840cd6ee647fbd6bd86daed4fd177648e..ca1dda434ae0786e5e5d7ea0ad26bdc3d2e94a68 100644
--- a/test/codegen/expect/fieldtest/fieldtest.js
+++ b/test/codegen/expect/fieldtest/fieldtest.js
@@ -1,12 +1,11 @@
var fieldtest;
-(function (fieldtest) {
+(function(fieldtest) {
'use strict';
class A extends dart.Object {
A() {
this.x = 42;
}
}
-
let B$ = dart.generic(function(T) {
class B extends dart.Object {
B() {
@@ -18,38 +17,41 @@ var fieldtest;
return B;
});
let B = B$(dynamic);
-
// Function foo: (A) → int
function foo(a) {
core.print(a.x);
return a.x;
}
-
// Function bar: (dynamic) → int
function bar(a) {
- core.print(dart.dload(a, "x"));
- return dart.as(dart.dload(a, "x"), core.int);
+ core.print(dart.dload(a, 'x'));
+ return dart.as(dart.dload(a, 'x'), core.int);
}
-
// Function baz: (A) → dynamic
- function baz(a) { return a.x; }
-
+ function baz(a) {
+ return a.x;
+ }
// Function compute: () → int
- function compute() { return 123; }
-
+ function compute() {
+ return 123;
+ }
dart.defineLazyProperties(fieldtest, {
- get y() { return compute() + 444 },
- set y(x) {},
+ get y() {
+ return compute() + 444;
+ },
+ set y() {}
});
-
dart.copyProperties(fieldtest, {
- get q() { return core.String['+'](core.String['+']('life, ', 'the universe '), 'and everything'); },
- get z() { return 42; },
+ get q() {
+ return core.String['+'](core.String['+']('life, ', 'the universe '), 'and everything');
+ },
+ get z() {
+ return 42;
+ },
set z(value) {
fieldtest.y = dart.as(value, core.int);
- },
+ }
});
-
// Function main: () → void
function main() {
let a = new A();
@@ -57,7 +59,6 @@ var fieldtest;
bar(a);
core.print(baz(a));
}
-
// Exports:
fieldtest.A = A;
fieldtest.B = B;
@@ -66,5 +67,8 @@ var fieldtest;
fieldtest.bar = bar;
fieldtest.baz = baz;
fieldtest.compute = compute;
+ fieldtest.q = q;
+ fieldtest.z = z;
+ fieldtest.z = z;
fieldtest.main = main;
})(fieldtest || (fieldtest = {}));
« no previous file with comments | « test/codegen/expect/dom/dom.js ('k') | test/codegen/expect/html_input_a/html_input_a.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698