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

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

Issue 977613002: Make int and double nullable by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: actually upload changes 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
Index: test/codegen/expect/sunflower.js
diff --git a/test/codegen/expect/sunflower.js b/test/codegen/expect/sunflower.js
index 5a610a6216fd2efa276b2a8a18b4167344727f02..fcec2e64b35c4cc4da64f9786ea44433a2126a34 100644
--- a/test/codegen/expect/sunflower.js
+++ b/test/codegen/expect/sunflower.js
@@ -4,9 +4,9 @@ var sunflower;
let ORANGE = "orange";
let SEED_RADIUS = 2;
let SCALE_FACTOR = 4;
- let TAU = math.PI * 2;
+ let TAU = dart.notNull(math.PI) * 2;
let MAX_D = 300;
- let centerX = MAX_D / 2;
+ let centerX = dart.notNull(MAX_D) / 2;
let centerY = centerX;
// Function querySelector: (String) → Element
function querySelector(selector) {
@@ -21,7 +21,7 @@ var sunflower;
return querySelector("#notes");
},
get PHI() {
- return (math.sqrt(5) + 1) / 2;
+ return (dart.notNull(math.sqrt(5)) + 1) / 2;
},
get context() {
return dart.as(dart.as(querySelector("#canvas"), dom.CanvasElement).getContext('2d'), dom.CanvasRenderingContext2D);
@@ -67,11 +67,11 @@ var sunflower;
function draw() {
exports.seeds = core.int.parse(exports.slider.value);
exports.context.clearRect(0, 0, MAX_D, MAX_D);
- for (let i = 0; i < exports.seeds; i++) {
- let theta = dart.notNull(i * dart.notNull(TAU)) / dart.notNull(exports.PHI);
- let r = math.sqrt(i) * SCALE_FACTOR;
- let x = dart.notNull(centerX) + dart.notNull(dart.notNull(r) * math.cos(theta));
- let y = dart.notNull(centerY) - dart.notNull(dart.notNull(r) * math.sin(theta));
+ for (let i = 0; dart.notNull(i) < dart.notNull(exports.seeds); dart.notNull(i)++) {
+ let theta = dart.notNull(i) * dart.notNull(TAU) / dart.notNull(exports.PHI);
+ let r = dart.notNull(math.sqrt(i)) * dart.notNull(SCALE_FACTOR);
+ let x = dart.notNull(centerX) + dart.notNull(r) * dart.notNull(math.cos(theta));
+ let y = dart.notNull(centerY) - dart.notNull(r) * dart.notNull(math.sin(theta));
new SunflowerSeed(x, y, SEED_RADIUS).draw();
}
exports.notes.textContent = `${exports.seeds} seeds`;

Powered by Google App Engine
This is Rietveld 408576698