OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 library dart.core._rasta_errors; | 4 library dart.core._rasta_errors; |
5 | 5 |
6 // RastaK generates calls to these methods -- all backends must provide them | 6 // RastaK generates calls to these methods -- all backends must provide them |
7 // in their patch for "dart:core". | 7 // in their patch for "dart:core". |
8 // | 8 // |
9 // In the future, we could have a single `rasta_errors.dart` for all backends to | 9 // In the future, we could have a single `rasta_errors.dart` for all backends to |
10 // ensure consistent error messages across all backends. | 10 // ensure consistent error messages across all backends. |
11 // | 11 // |
12 // But for now, we just want errors that are consistent with the VM, so these | 12 // But for now, we just want errors that are consistent with the VM, so these |
13 // methods just reuse what is in the VM. | 13 // methods just reuse what is in the VM. |
14 | 14 |
15 _unresolvedConstructorError( | 15 _unresolvedConstructorError( |
16 Object typeLiteral, | 16 Object typeLiteral, |
17 String fullConstructorName, | 17 Symbol fullConstructorName, |
18 List arguments, | 18 List arguments, |
19 Map<Symbol, dynamic> namedArguments, | 19 Map<Symbol, dynamic> namedArguments, |
20 List existingArgumentNames) { | 20 List existingArgumentNames) { |
21 return new NoSuchMethodError._withType( | 21 return new NoSuchMethodError._withType( |
22 typeLiteral, | 22 typeLiteral, |
23 fullConstructorName, | 23 fullConstructorName, |
24 _InvocationMirror._CONSTRUCTOR << _InvocationMirror._CALL_SHIFT, | 24 _InvocationMirror._CONSTRUCTOR << _InvocationMirror._CALL_SHIFT, |
25 arguments, | 25 arguments, |
26 namedArguments, | 26 namedArguments, |
27 existingArgumentNames); | 27 existingArgumentNames); |
28 } | 28 } |
29 | 29 |
30 _unresolvedStaticGetterError( | |
31 Object typeLiteral, | |
32 Symbol name, | |
33 List arguments, | |
34 Map<Symbol, dynamic> namedArguments, | |
35 List existingArgumentNames) { | |
36 return new NoSuchMethodError._withType( | |
37 typeLiteral, | |
38 name, | |
39 (_InvocationMirror._GETTER << _InvocationMirror._TYPE_SHIFT) + | |
40 (_InvocationMirror._STATIC << _InvocationMirror._CALL_SHIFT), | |
41 arguments, | |
42 namedArguments, | |
43 existingArgumentNames); | |
44 } | |
45 | |
46 _unresolvedStaticSetterError( | |
47 Object typeLiteral, | |
48 Symbol name, | |
49 List arguments, | |
50 Map<Symbol, dynamic> namedArguments, | |
51 List existingArgumentNames) { | |
52 return new NoSuchMethodError._withType( | |
53 typeLiteral, | |
54 name, | |
55 (_InvocationMirror._SETTER << _InvocationMirror._TYPE_SHIFT) + | |
56 (_InvocationMirror._STATIC << _InvocationMirror._CALL_SHIFT), | |
57 arguments, | |
58 namedArguments, | |
59 existingArgumentNames); | |
60 } | |
61 | |
62 _unresolvedStaticMethodError( | |
63 Object typeLiteral, | |
64 Symbol name, | |
65 List arguments, | |
66 Map<Symbol, dynamic> namedArguments, | |
67 List existingArgumentNames) { | |
68 return new NoSuchMethodError._withType( | |
69 typeLiteral, | |
70 name, | |
71 (_InvocationMirror._METHOD << _InvocationMirror._TYPE_SHIFT) + | |
72 (_InvocationMirror._STATIC << _InvocationMirror._CALL_SHIFT), | |
73 arguments, | |
74 namedArguments, | |
75 existingArgumentNames); | |
76 } | |
77 | |
78 _unresolvedTopLevelGetterError( | |
79 Object unused, | |
80 Symbol name, | |
81 List arguments, | |
82 Map<Symbol, dynamic> namedArguments, | |
83 List existingArgumentNames) { | |
84 return new NoSuchMethodError._withType( | |
85 unused, | |
86 name, | |
87 (_InvocationMirror._GETTER << _InvocationMirror._TYPE_SHIFT) + | |
88 (_InvocationMirror._TOP_LEVEL << _InvocationMirror._CALL_SHIFT), | |
89 arguments, | |
90 namedArguments, | |
91 existingArgumentNames); | |
92 } | |
93 | |
94 _unresolvedTopLevelSetterError( | |
95 Object unused, | |
96 Symbol name, | |
97 List arguments, | |
98 Map<Symbol, dynamic> namedArguments, | |
99 List existingArgumentNames) { | |
100 return new NoSuchMethodError._withType( | |
101 unused, | |
102 name, | |
103 (_InvocationMirror._SETTER << _InvocationMirror._TYPE_SHIFT) + | |
104 (_InvocationMirror._TOP_LEVEL << _InvocationMirror._CALL_SHIFT), | |
105 arguments, | |
106 namedArguments, | |
107 existingArgumentNames); | |
108 } | |
109 | |
110 _unresolvedTopLevelMethodError( | |
111 Object unused, | |
112 Symbol name, | |
113 List arguments, | |
114 Map<Symbol, dynamic> namedArguments, | |
115 List existingArgumentNames) { | |
116 return new NoSuchMethodError._withType( | |
117 unused, | |
118 name, | |
119 (_InvocationMirror._METHOD << _InvocationMirror._TYPE_SHIFT) + | |
120 (_InvocationMirror._TOP_LEVEL << _InvocationMirror._CALL_SHIFT), | |
121 arguments, | |
122 namedArguments, | |
123 existingArgumentNames); | |
124 } | |
125 | |
126 _unresolvedSuperGetterError( | |
127 Object receiver, | |
128 Symbol name, | |
129 List arguments, | |
130 Map<Symbol, dynamic> namedArguments, | |
131 List existingArgumentNames) { | |
132 return new NoSuchMethodError._withType( | |
133 receiver, | |
134 name, | |
135 (_InvocationMirror._GETTER << _InvocationMirror._TYPE_SHIFT) + | |
136 (_InvocationMirror._SUPER << _InvocationMirror._CALL_SHIFT), | |
137 arguments, | |
138 namedArguments, | |
139 existingArgumentNames); | |
140 } | |
141 | |
142 _unresolvedSuperSetterError( | |
143 Object receiver, | |
144 Symbol name, | |
145 List arguments, | |
146 Map<Symbol, dynamic> namedArguments, | |
147 List existingArgumentNames) { | |
148 return new NoSuchMethodError._withType( | |
149 receiver, | |
150 name, | |
151 (_InvocationMirror._SETTER << _InvocationMirror._TYPE_SHIFT) + | |
152 (_InvocationMirror._SUPER << _InvocationMirror._CALL_SHIFT), | |
153 arguments, | |
154 namedArguments, | |
155 existingArgumentNames); | |
156 } | |
157 | |
158 _unresolvedSuperMethodError( | |
159 Object receiver, | |
160 Symbol name, | |
161 List arguments, | |
162 Map<Symbol, dynamic> namedArguments, | |
163 List existingArgumentNames) { | |
164 return new NoSuchMethodError._withType( | |
165 receiver, | |
166 name, | |
167 (_InvocationMirror._METHOD << _InvocationMirror._TYPE_SHIFT) + | |
168 (_InvocationMirror._SUPER << _InvocationMirror._CALL_SHIFT), | |
169 arguments, | |
170 namedArguments, | |
171 existingArgumentNames); | |
172 } | |
173 | |
174 _genericNoSuchMethod( | |
175 Object receiver, | |
176 Symbol methodName, | |
177 List arguments, | |
178 Map<Symbol, dynamic> namedArguments, | |
179 List existingArgumentNames) { | |
180 return new NoSuchMethodError(receiver, methodName, arguments, namedArguments, existingArgumentNames); | |
ahe
2016/07/01 08:48:39
Long line.
asgerf
2016/07/01 09:32:25
Done.
| |
181 } | |
182 | |
30 _malformedTypeError(String errorMessage) { | 183 _malformedTypeError(String errorMessage) { |
31 return new _TypeError._create(null, null, null, errorMessage); | 184 return new _TypeError._create(null, null, null, errorMessage); |
32 } | 185 } |
OLD | NEW |