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

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

Issue 533483003: Cleanup throwing of the RangeError in the runtime to remove duplicated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « runtime/lib/typed_data.cc ('k') | runtime/vm/exceptions.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 #ifndef VM_EXCEPTIONS_H_ 5 #ifndef VM_EXCEPTIONS_H_
6 #define VM_EXCEPTIONS_H_ 6 #define VM_EXCEPTIONS_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 // Forward declarations. 12 // Forward declarations.
13 class Array; 13 class Array;
14 class Class; 14 class Class;
15 class DartFrameIterator; 15 class DartFrameIterator;
16 class Error; 16 class Error;
17 class Instance; 17 class Instance;
18 class Integer;
18 class Object; 19 class Object;
19 class RawInstance; 20 class RawInstance;
20 class RawObject; 21 class RawObject;
21 class RawScript; 22 class RawScript;
22 class RawStacktrace; 23 class RawStacktrace;
23 class RawString; 24 class RawString;
24 class Script; 25 class Script;
25 class StackFrame; 26 class StackFrame;
26 class String; 27 class String;
27 28
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 kType, 66 kType,
66 kFallThrough, 67 kFallThrough,
67 kAbstractClassInstantiation, 68 kAbstractClassInstantiation,
68 kCyclicInitializationError, 69 kCyclicInitializationError,
69 }; 70 };
70 71
71 static void ThrowByType(ExceptionType type, const Array& arguments); 72 static void ThrowByType(ExceptionType type, const Array& arguments);
72 static void ThrowOOM(); 73 static void ThrowOOM();
73 static void ThrowStackOverflow(); 74 static void ThrowStackOverflow();
74 static void ThrowArgumentError(const Instance& arg); 75 static void ThrowArgumentError(const Instance& arg);
76 static void ThrowRangeError(const char* argument_name,
77 const Integer& argument_value,
78 intptr_t expected_from,
79 intptr_t expected_to);
75 static void ThrowJavascriptCompatibilityError(const char* msg); 80 static void ThrowJavascriptCompatibilityError(const char* msg);
76 81
77 // Returns a RawInstance if the exception is successfully created, 82 // Returns a RawInstance if the exception is successfully created,
78 // otherwise returns a RawError. 83 // otherwise returns a RawError.
79 static RawObject* Create(ExceptionType type, const Array& arguments); 84 static RawObject* Create(ExceptionType type, const Array& arguments);
80 85
81 private: 86 private:
82 DISALLOW_COPY_AND_ASSIGN(Exceptions); 87 DISALLOW_COPY_AND_ASSIGN(Exceptions);
83 }; 88 };
84 89
85 } // namespace dart 90 } // namespace dart
86 91
87 #endif // VM_EXCEPTIONS_H_ 92 #endif // VM_EXCEPTIONS_H_
OLDNEW
« no previous file with comments | « runtime/lib/typed_data.cc ('k') | runtime/vm/exceptions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698