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

Unified Diff: frog/frogsh

Issue 8587021: fix initialization of null in loops (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | « no previous file | frog/gen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/frogsh
diff --git a/frog/frogsh b/frog/frogsh
index 04d00eca072d5de1334840a2d613ac82e628ff19..58a04ead1edcb96707432feb6685d2ea6becb55b 100755
--- a/frog/frogsh
+++ b/frog/frogsh
@@ -11463,7 +11463,12 @@ MethodGenerator.prototype.visitVariableDefinition = function(node) {
}
var val = this._scope.create($assert_String(name), (thisType && thisType.is$lang_Type()), node.names.$index(i).get$span(), false);
if ($notnull_bool(value == null)) {
- this.writer.write(('' + val.code + ''));
+ if ($notnull_bool(this._scope.reentrant)) {
+ this.writer.write(('' + val.code + ' = null'));
+ }
+ else {
+ this.writer.write(('' + val.code + ''));
+ }
}
else {
value = value.convertTo$3(this, type, node.values.$index(i));
@@ -12294,7 +12299,7 @@ MethodGenerator.prototype.visitNullExpression = function(node) {
MethodGenerator.prototype.visitLiteralExpression = function(node) {
var $0;
var type = node.type.type;
- $assert($ne(type, null), "type != null", "gen.dart", 2093, 12);
+ $assert($ne(type, null), "type != null", "gen.dart", 2099, 12);
if (!!(($0 = node.value) && $0.is$List)) {
var items = [];
var $list = node.value;
@@ -19889,7 +19894,7 @@ DefinedType.prototype.resolveMember = function(memberName) {
var $list = this.get$subtypes();
for (var $i = this.get$subtypes().iterator(); $i.hasNext$0(); ) {
var t = $i.next$0();
- var m;
+ var m = null;
if (!$notnull_bool(this.isClass) && $notnull_bool(t.get$isClass())) {
m = t.getMember$1(memberName);
}
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698