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

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

Issue 1986683002: Named constants are (usually) not null. (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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/fieldtest.js ('k') | test/codegen/expect/sunflower/sunflower.js.map » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/sunflower/sunflower.js
diff --git a/test/codegen/expect/sunflower/sunflower.js b/test/codegen/expect/sunflower/sunflower.js
index 314405434bf34d44014fd0d1aa5cb138bdebf0e2..414c05c116c90615a4c4ed624cefa8412ada794f 100644
--- a/test/codegen/expect/sunflower/sunflower.js
+++ b/test/codegen/expect/sunflower/sunflower.js
@@ -13,7 +13,7 @@ dart_library.library('sunflower', null, /* Imports */[
sunflower.SEED_RADIUS = 2;
sunflower.SCALE_FACTOR = 4;
sunflower.MAX_D = 300;
- sunflower.centerX = dart.notNull(sunflower.MAX_D) / 2;
+ sunflower.centerX = sunflower.MAX_D / 2;
sunflower.centerY = sunflower.centerX;
sunflower.querySelector = function(selector) {
return html.document[dartx.querySelector](selector);
@@ -54,10 +54,10 @@ dart_library.library('sunflower', null, /* Imports */[
sunflower.seeds = core.int.parse(sunflower.slider[dartx.value]);
sunflower.context[dartx.clearRect](0, 0, sunflower.MAX_D, sunflower.MAX_D);
for (let i = 0; i < dart.notNull(sunflower.seeds); i++) {
- let theta = i * dart.notNull(painter.TAU) / dart.notNull(sunflower.PHI);
- let r = dart.notNull(math.sqrt(i)) * dart.notNull(sunflower.SCALE_FACTOR);
- let x = dart.notNull(sunflower.centerX) + r * dart.notNull(math.cos(theta));
- let y = dart.notNull(sunflower.centerY) - r * dart.notNull(math.sin(theta));
+ let theta = i * painter.TAU / dart.notNull(sunflower.PHI);
+ let r = dart.notNull(math.sqrt(i)) * sunflower.SCALE_FACTOR;
+ let x = sunflower.centerX + r * dart.notNull(math.cos(theta));
+ let y = sunflower.centerY - r * dart.notNull(math.sin(theta));
new sunflower.SunflowerSeed(x, y, sunflower.SEED_RADIUS).draw(sunflower.context);
}
sunflower.notes[dartx.text] = `${sunflower.seeds} seeds`;
@@ -105,7 +105,7 @@ dart_library.library('sunflower', null, /* Imports */[
painter.ORANGE = "orange";
painter.RED = "red";
painter.BLUE = "blue";
- painter.TAU = dart.notNull(math.PI) * 2;
+ painter.TAU = math.PI * 2;
painter.querySelector = function(selector) {
return html.document[dartx.querySelector](selector);
};
« no previous file with comments | « test/codegen/expect/fieldtest.js ('k') | test/codegen/expect/sunflower/sunflower.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698