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

Side by Side Diff: frog/evaluator.dart

Issue 8772070: Check constness of default args (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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/member.dart » ('j') | frog/member.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 5
6 #import('file_system.dart'); 6 #import('file_system.dart');
7 #import('lang.dart'); 7 #import('lang.dart');
8 8
9 interface JsEvaluator { 9 interface JsEvaluator {
10 var eval(String source); 10 var eval(String source);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (_prelude == null) { 52 if (_prelude == null) {
53 throw new UnsupportedOperationException( 53 throw new UnsupportedOperationException(
54 "Must call Evaluator.initWorld before creating a Evaluator."); 54 "Must call Evaluator.initWorld before creating a Evaluator.");
55 } 55 }
56 this._jsEvaluator.eval(_prelude); 56 this._jsEvaluator.eval(_prelude);
57 _lib = new Library(new SourceFile("_ifrog_", "")); 57 _lib = new Library(new SourceFile("_ifrog_", ""));
58 _lib.imports.add(new LibraryImport(world.corelib)); 58 _lib.imports.add(new LibraryImport(world.corelib));
59 _lib.resolve(); 59 _lib.resolve();
60 } 60 }
61 61
62 void _ensureVariableDefined(Identifier name, [List<Token> modifiers = [], 62 void _ensureVariableDefined(Identifier name,
63 TypeReference type = null]) { 63 [List<Token> modifiers = const [], TypeReference type = null]) {
jimhug 2011/12/06 16:23:39 This is really cool! This particular code is a no
64 var member = _lib.topType.getMember(name.name); 64 var member = _lib.topType.getMember(name.name);
65 if (member is FieldMember || member is PropertyMember) return; 65 if (member is FieldMember || member is PropertyMember) return;
66 _removeMember(name.name); 66 _removeMember(name.name);
67 _lib.topType.addField( 67 _lib.topType.addField(
68 new VariableDefinition(modifiers, type, [name], [null], name.span)); 68 new VariableDefinition(modifiers, type, [name], [null], name.span));
69 _lib.topType.getMember(name.name).resolve(); 69 _lib.topType.getMember(name.name).resolve();
70 } 70 }
71 71
72 var eval(String dart) { 72 var eval(String dart) {
73 var source = new SourceFile("_ifrog_", dart); 73 var source = new SourceFile("_ifrog_", dart);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 world.gen.writeType(type); 117 world.gen.writeType(type);
118 code = world.gen.writer.text; 118 code = world.gen.writer.text;
119 } else { 119 } else {
120 parsed.visit(methGen); 120 parsed.visit(methGen);
121 code = methGen.writer.text; 121 code = methGen.writer.text;
122 } 122 }
123 123
124 return this._jsEvaluator.eval(code); 124 return this._jsEvaluator.eval(code);
125 } 125 }
126 } 126 }
OLDNEW
« no previous file with comments | « no previous file | frog/member.dart » ('j') | frog/member.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698