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

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

Issue 10896007: Expose remaining 'errors' in an unified dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make all implementations implement, not extend, the exposed type. Created 8 years, 3 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
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 "vm/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // Allocate, initialize, and throw a TypeError. 253 // Allocate, initialize, and throw a TypeError.
254 void Exceptions::CreateAndThrowTypeError(intptr_t location, 254 void Exceptions::CreateAndThrowTypeError(intptr_t location,
255 const String& src_type_name, 255 const String& src_type_name,
256 const String& dst_type_name, 256 const String& dst_type_name,
257 const String& dst_name, 257 const String& dst_name,
258 const String& malformed_error) { 258 const String& malformed_error) {
259 // Allocate a new instance of TypeError or CastException. 259 // Allocate a new instance of TypeError or CastException.
260 Instance& type_error = Instance::Handle(); 260 Instance& type_error = Instance::Handle();
261 Class& cls = Class::Handle(); 261 Class& cls = Class::Handle();
262 if (dst_name.Equals(kCastExceptionDstName)) { 262 if (dst_name.Equals(kCastExceptionDstName)) {
263 type_error = NewInstance("CastException"); 263 type_error = NewInstance("CastExceptionImplementation");
264 cls = type_error.clazz(); 264 cls = type_error.clazz();
265 cls = cls.SuperClass(); 265 cls = cls.SuperClass();
266 } else { 266 } else {
267 type_error = NewInstance("TypeError"); 267 type_error = NewInstance("TypeErrorImplementation");
268 cls = type_error.clazz(); 268 cls = type_error.clazz();
269 } 269 }
270 270
271 // Initialize 'url', 'line', and 'column' fields. 271 // Initialize 'url', 'line', and 'column' fields.
272 DartFrameIterator iterator; 272 DartFrameIterator iterator;
273 const Script& script = Script::Handle(GetCallerScript(&iterator)); 273 const Script& script = Script::Handle(GetCallerScript(&iterator));
274 // Location fields are defined in AssertionError, the superclass of TypeError. 274 // Location fields are defined in AssertionError, the superclass of TypeError.
275 const Class& assertion_error_class = Class::Handle(cls.SuperClass()); 275 const Class& assertion_error_class = Class::Handle(cls.SuperClass());
276 SetLocationFields(type_error, assertion_error_class, script, location); 276 SetLocationFields(type_error, assertion_error_class, script, location);
277 277
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 case kIsolateSpawn: 434 case kIsolateSpawn:
435 library = Library::IsolateLibrary(); 435 library = Library::IsolateLibrary();
436 class_name = Symbols::New("IsolateSpawnException"); 436 class_name = Symbols::New("IsolateSpawnException");
437 break; 437 break;
438 } 438 }
439 439
440 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); 440 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments);
441 } 441 }
442 442
443 } // namespace dart 443 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698