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

Side by Side Diff: runtime/vm/parser_test.cc

Issue 14791005: BREAKING CHANGE: enforce part of directive (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
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 #include "vm/ast_printer.h" 6 #include "vm/ast_printer.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/longjump.h" 8 #include "vm/longjump.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 " static String s1, s2; \n" 110 " static String s1, s2; \n"
111 " static const int s3 = 8675309; \n" 111 " static const int s3 = 8675309; \n"
112 " static bar(i, [var d = 5]) { return 77; } \n" 112 " static bar(i, [var d = 5]) { return 77; } \n"
113 " static foo() native \"native_function_name\"; \n" 113 " static foo() native \"native_function_name\"; \n"
114 "} \n"; 114 "} \n";
115 115
116 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); 116 String& url = String::Handle(String::New("dart-test:Parser_TopLevel"));
117 String& source = String::Handle(String::New(script_chars)); 117 String& source = String::Handle(String::New(script_chars));
118 Script& script = Script::Handle(Script::New(url, 118 Script& script = Script::Handle(Script::New(url,
119 source, 119 source,
120 RawScript::kSourceTag)); 120 RawScript::kScriptTag));
121 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); 121 Library& lib = Library::ZoneHandle(Library::CoreLibrary());
122 122
123 script.Tokenize(String::Handle(String::New(""))); 123 script.Tokenize(String::Handle(String::New("")));
124 124
125 Parser::ParseCompilationUnit(lib, script); 125 Parser::ParseCompilationUnit(lib, script);
126 EXPECT(ClassFinalizer::FinalizePendingClasses()); 126 EXPECT(ClassFinalizer::FinalizePendingClasses());
127 CheckField(lib, "A", "f1", false, false); 127 CheckField(lib, "A", "f1", false, false);
128 CheckField(lib, "A", "f2", false, true); 128 CheckField(lib, "A", "f2", false, true);
129 CheckField(lib, "A", "f3", false, true); 129 CheckField(lib, "A", "f3", false, true);
130 CheckField(lib, "A", "f4", false, true); 130 CheckField(lib, "A", "f4", false, true);
(...skipping 14 matching lines...) Expand all
145 "} \n" 145 "} \n"
146 " \n" 146 " \n"
147 "class B { \n" 147 "class B { \n"
148 " static bam(k) { return A.foo(); } \n" 148 " static bam(k) { return A.foo(); } \n"
149 "} \n"; 149 "} \n";
150 150
151 String& url = String::Handle(String::New("dart-test:Parser_TopLevel")); 151 String& url = String::Handle(String::New("dart-test:Parser_TopLevel"));
152 String& source = String::Handle(String::New(script_chars)); 152 String& source = String::Handle(String::New(script_chars));
153 Script& script = Script::Handle(Script::New(url, 153 Script& script = Script::Handle(Script::New(url,
154 source, 154 source,
155 RawScript::kSourceTag)); 155 RawScript::kScriptTag));
156 Library& lib = Library::ZoneHandle(Library::CoreLibrary()); 156 Library& lib = Library::ZoneHandle(Library::CoreLibrary());
157 157
158 script.Tokenize(String::Handle(String::New(""))); 158 script.Tokenize(String::Handle(String::New("")));
159 159
160 Parser::ParseCompilationUnit(lib, script); 160 Parser::ParseCompilationUnit(lib, script);
161 EXPECT(ClassFinalizer::FinalizePendingClasses()); 161 EXPECT(ClassFinalizer::FinalizePendingClasses());
162 162
163 DumpFunction(lib, "A", "foo"); 163 DumpFunction(lib, "A", "foo");
164 DumpFunction(lib, "A", "bar"); 164 DumpFunction(lib, "A", "bar");
165 DumpFunction(lib, "A", "baz"); 165 DumpFunction(lib, "A", "baz");
166 DumpFunction(lib, "B", "bam"); 166 DumpFunction(lib, "B", "bam");
167 } 167 }
168 168
169 } // namespace dart 169 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698