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

Side by Side Diff: test/codegen/expect/sunflower/painter.js

Issue 1879373004: Implement modular compilation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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/codegen/expect/sunflower/dom.txt ('k') | test/codegen/expect/sunflower/painter.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 dart_library.library('sunflower/painter', null, /* Imports */[
2 'dart/_runtime',
3 'dart/math',
4 'sunflower/dom',
5 'dart/core',
6 'sunflower/circle'
7 ], /* Lazy imports */[
8 ], function(exports, dart, math, dom, core, circle) {
9 'use strict';
10 let dartx = dart.dartx;
11 const ORANGE = "orange";
12 const RED = "red";
13 const BLUE = "blue";
14 const TAU = dart.notNull(math.PI) * 2;
15 function querySelector(selector) {
16 return dom.document.querySelector(selector);
17 }
18 dart.fn(querySelector, dom.Element, [core.String]);
19 dart.defineLazyProperties(exports, {
20 get canvas() {
21 return dart.as(querySelector("#canvas"), dom.CanvasElement);
22 }
23 });
24 dart.defineLazyProperties(exports, {
25 get context() {
26 return dart.as(exports.canvas.getContext('2d'), dom.CanvasRenderingContext 2D);
27 }
28 });
29 class CirclePainter extends core.Object {
30 CirclePainter() {
31 this.color = ORANGE;
32 }
33 draw(context) {
34 context.beginPath();
35 context.lineWidth = 2;
36 context.fillStyle = this.color;
37 context.strokeStyle = this.color;
38 context.arc(this.x, this.y, this.radius, 0, TAU, false);
39 context.fill();
40 context.closePath();
41 context.stroke();
42 }
43 }
44 CirclePainter[dart.implements] = () => [circle.Circle];
45 dart.setSignature(CirclePainter, {
46 methods: () => ({draw: [dart.void, [dom.CanvasRenderingContext2D]]})
47 });
48 // Exports:
49 exports.ORANGE = ORANGE;
50 exports.RED = RED;
51 exports.BLUE = BLUE;
52 exports.TAU = TAU;
53 exports.querySelector = querySelector;
54 exports.CirclePainter = CirclePainter;
55 });
OLDNEW
« no previous file with comments | « test/codegen/expect/sunflower/dom.txt ('k') | test/codegen/expect/sunflower/painter.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698