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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { this($0, $1, true, capture); } 7 * function($0, $1, capture) { this($0, $1, true, capture); }
8 * 8 *
9 * This stub then replaces the dynamic one on Function, with one that is 9 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 10 * specialized for that particular function, taking into account its default
(...skipping 11445 matching lines...) Expand 10 before | Expand all | Expand 10 after
11456 if ($notnull_bool(isFinal)) { 11456 if ($notnull_bool(isFinal)) {
11457 if ($notnull_bool(value == null)) { 11457 if ($notnull_bool(value == null)) {
11458 world.error('no value specified for final variable', node.span); 11458 world.error('no value specified for final variable', node.span);
11459 } 11459 }
11460 else { 11460 else {
11461 if ($notnull_bool(thisType.get$isVar())) thisType = value.type; 11461 if ($notnull_bool(thisType.get$isVar())) thisType = value.type;
11462 } 11462 }
11463 } 11463 }
11464 var val = this._scope.create($assert_String(name), (thisType && thisType.is$ lang_Type()), node.names.$index(i).get$span(), false); 11464 var val = this._scope.create($assert_String(name), (thisType && thisType.is$ lang_Type()), node.names.$index(i).get$span(), false);
11465 if ($notnull_bool(value == null)) { 11465 if ($notnull_bool(value == null)) {
11466 this.writer.write(('' + val.code + '')); 11466 if ($notnull_bool(this._scope.reentrant)) {
11467 this.writer.write(('' + val.code + ' = null'));
11468 }
11469 else {
11470 this.writer.write(('' + val.code + ''));
11471 }
11467 } 11472 }
11468 else { 11473 else {
11469 value = value.convertTo$3(this, type, node.values.$index(i)); 11474 value = value.convertTo$3(this, type, node.values.$index(i));
11470 this.writer.write(('' + val.code + ' = ' + value.code + '')); 11475 this.writer.write(('' + val.code + ' = ' + value.code + ''));
11471 } 11476 }
11472 } 11477 }
11473 this.writer.writeln(';'); 11478 this.writer.writeln(';');
11474 return false; 11479 return false;
11475 } 11480 }
11476 MethodGenerator.prototype.visitFunctionDefinition = function(node) { 11481 MethodGenerator.prototype.visitFunctionDefinition = function(node) {
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
12287 } 12292 }
12288 MethodGenerator.prototype.visitSuperExpression = function(node) { 12293 MethodGenerator.prototype.visitSuperExpression = function(node) {
12289 return this._makeSuperValue(node); 12294 return this._makeSuperValue(node);
12290 } 12295 }
12291 MethodGenerator.prototype.visitNullExpression = function(node) { 12296 MethodGenerator.prototype.visitNullExpression = function(node) {
12292 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null ); 12297 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null );
12293 } 12298 }
12294 MethodGenerator.prototype.visitLiteralExpression = function(node) { 12299 MethodGenerator.prototype.visitLiteralExpression = function(node) {
12295 var $0; 12300 var $0;
12296 var type = node.type.type; 12301 var type = node.type.type;
12297 $assert($ne(type, null), "type != null", "gen.dart", 2093, 12); 12302 $assert($ne(type, null), "type != null", "gen.dart", 2099, 12);
12298 if (!!(($0 = node.value) && $0.is$List)) { 12303 if (!!(($0 = node.value) && $0.is$List)) {
12299 var items = []; 12304 var items = [];
12300 var $list = node.value; 12305 var $list = node.value;
12301 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { 12306 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) {
12302 var item = $i.next$0(); 12307 var item = $i.next$0();
12303 var val = this.visitValue((item && item.is$lang_Expression())); 12308 var val = this.visitValue((item && item.is$lang_Expression()));
12304 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 12309 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
12305 var code = val.code; 12310 var code = val.code;
12306 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession)) { 12311 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession)) {
12307 code = ('(' + code + ')'); 12312 code = ('(' + code + ')');
(...skipping 7574 matching lines...) Expand 10 before | Expand all | Expand 10 after
19882 } 19887 }
19883 ret = new MemberSet(member, false); 19888 ret = new MemberSet(member, false);
19884 this._resolvedMembers.$setindex(memberName, ret); 19889 this._resolvedMembers.$setindex(memberName, ret);
19885 if ($notnull_bool(member.get$isStatic())) { 19890 if ($notnull_bool(member.get$isStatic())) {
19886 return ret; 19891 return ret;
19887 } 19892 }
19888 else { 19893 else {
19889 var $list = this.get$subtypes(); 19894 var $list = this.get$subtypes();
19890 for (var $i = this.get$subtypes().iterator(); $i.hasNext$0(); ) { 19895 for (var $i = this.get$subtypes().iterator(); $i.hasNext$0(); ) {
19891 var t = $i.next$0(); 19896 var t = $i.next$0();
19892 var m; 19897 var m = null;
19893 if (!$notnull_bool(this.isClass) && $notnull_bool(t.get$isClass())) { 19898 if (!$notnull_bool(this.isClass) && $notnull_bool(t.get$isClass())) {
19894 m = t.getMember$1(memberName); 19899 m = t.getMember$1(memberName);
19895 } 19900 }
19896 else { 19901 else {
19897 m = t.get$members().$index(memberName); 19902 m = t.get$members().$index(memberName);
19898 } 19903 }
19899 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member())); 19904 if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member()));
19900 } 19905 }
19901 return ret; 19906 return ret;
19902 } 19907 }
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
21735 INTERFACE, 21740 INTERFACE,
21736 LIBRARY, 21741 LIBRARY,
21737 NATIVE, 21742 NATIVE,
21738 NEGATE, 21743 NEGATE,
21739 OPERATOR, 21744 OPERATOR,
21740 SET, 21745 SET,
21741 SOURCE, 21746 SOURCE,
21742 STATIC, 21747 STATIC,
21743 TYPEDEF ]*/; 21748 TYPEDEF ]*/;
21744 main(); 21749 main();
OLDNEW
« 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