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

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

Issue 9325047: Add token index position to classes and types for more accurate error reporting. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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
« runtime/vm/object.cc ('K') | « runtime/vm/runtime_entry_test.cc ('k') | no next file » | 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 #include <stdio.h> 5 #include <stdio.h>
6 6
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 default_parameter_values_(Array::ZoneHandle()) { 129 default_parameter_values_(Array::ZoneHandle()) {
130 ASSERT(name != NULL); 130 ASSERT(name != NULL);
131 const String& function_name = String::ZoneHandle(String::NewSymbol(name)); 131 const String& function_name = String::ZoneHandle(String::NewSymbol(name));
132 function_ = Function::New( 132 function_ = Function::New(
133 function_name, RawFunction::kFunction, true, false, 0); 133 function_name, RawFunction::kFunction, true, false, 0);
134 function_.set_result_type(Type::Handle(Type::DynamicType())); 134 function_.set_result_type(Type::Handle(Type::DynamicType()));
135 // Add function to a class and that class to the class dictionary so that 135 // Add function to a class and that class to the class dictionary so that
136 // frame walking can be used. 136 // frame walking can be used.
137 Class& cls = Class::ZoneHandle(); 137 Class& cls = Class::ZoneHandle();
138 const Script& script = Script::Handle(); 138 const Script& script = Script::Handle();
139 cls = Class::New(function_name, script); 139 const intptr_t kPos = 1; // Dummy token index in non-existing source.
140 cls = Class::New(function_name, script, kPos);
140 const Array& functions = Array::Handle(Array::New(1)); 141 const Array& functions = Array::Handle(Array::New(1));
141 functions.SetAt(0, function_); 142 functions.SetAt(0, function_);
142 cls.SetFunctions(functions); 143 cls.SetFunctions(functions);
143 Library& lib = Library::Handle(Library::CoreLibrary()); 144 Library& lib = Library::Handle(Library::CoreLibrary());
144 lib.AddClass(cls); 145 lib.AddClass(cls);
145 } 146 }
146 147
147 148
148 void CodeGenTest::Compile() { 149 void CodeGenTest::Compile() {
149 Assembler assembler; 150 Assembler assembler;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 195
195 196
196 bool CompilerTest::TestCompileFunction(const Function& function) { 197 bool CompilerTest::TestCompileFunction(const Function& function) {
197 Isolate* isolate = Isolate::Current(); 198 Isolate* isolate = Isolate::Current();
198 ASSERT(isolate != NULL); 199 ASSERT(isolate != NULL);
199 const Error& error = Error::Handle(Compiler::CompileFunction(function)); 200 const Error& error = Error::Handle(Compiler::CompileFunction(function));
200 return error.IsNull(); 201 return error.IsNull();
201 } 202 }
202 203
203 } // namespace dart 204 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/runtime_entry_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698