OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library elements.modelx; | 5 library elements.modelx; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/names.dart' show Identifiers; | 8 import '../common/names.dart' show Identifiers; |
9 import '../common/resolution.dart' show Resolution, ParsingContext; | 9 import '../common/resolution.dart' show Resolution, ParsingContext; |
10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // [ElementKind.GENERATIVE_CONSTRUCTOR], and it shouldn't throw as much. | 305 // [ElementKind.GENERATIVE_CONSTRUCTOR], and it shouldn't throw as much. |
306 | 306 |
307 ErroneousConstructorElementX(MessageKind messageKind, Map messageArguments, | 307 ErroneousConstructorElementX(MessageKind messageKind, Map messageArguments, |
308 String name, Element enclosing) | 308 String name, Element enclosing) |
309 : super(messageKind, messageArguments, name, enclosing); | 309 : super(messageKind, messageArguments, name, enclosing); |
310 | 310 |
311 @override | 311 @override |
312 bool get isRedirectingGenerative => false; | 312 bool get isRedirectingGenerative => false; |
313 | 313 |
314 @override | 314 @override |
| 315 bool isRedirectingGenerativeInternal; |
| 316 |
| 317 @override |
315 void set isRedirectingGenerative(_) { | 318 void set isRedirectingGenerative(_) { |
316 throw new UnsupportedError("isRedirectingGenerative"); | 319 throw new UnsupportedError("isRedirectingGenerative"); |
317 } | 320 } |
318 | 321 |
319 @override | 322 @override |
320 bool get isRedirectingFactory => false; | 323 bool get isRedirectingFactory => false; |
321 | 324 |
322 @override | 325 @override |
323 get definingElement { | 326 get definingElement { |
324 throw new UnsupportedError("definingElement"); | 327 throw new UnsupportedError("definingElement"); |
(...skipping 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2215 } | 2218 } |
2216 | 2219 |
2217 /// Returns the empty list of type variables by default. | 2220 /// Returns the empty list of type variables by default. |
2218 @override | 2221 @override |
2219 List<DartType> get typeVariables => functionSignature.typeVariables; | 2222 List<DartType> get typeVariables => functionSignature.typeVariables; |
2220 } | 2223 } |
2221 | 2224 |
2222 abstract class ConstructorElementX extends FunctionElementX | 2225 abstract class ConstructorElementX extends FunctionElementX |
2223 with ConstantConstructorMixin, ConstructorElementCommon | 2226 with ConstantConstructorMixin, ConstructorElementCommon |
2224 implements ConstructorElement { | 2227 implements ConstructorElement { |
2225 bool isRedirectingGenerative = false; | 2228 bool isRedirectingGenerativeInternal = false; |
2226 | 2229 |
2227 ConstructorElementX( | 2230 ConstructorElementX( |
2228 String name, ElementKind kind, Modifiers modifiers, Element enclosing) | 2231 String name, ElementKind kind, Modifiers modifiers, Element enclosing) |
2229 : super(name, kind, modifiers, enclosing); | 2232 : super(name, kind, modifiers, enclosing); |
2230 | 2233 |
2231 ConstructorElement _immediateRedirectionTarget; | 2234 ConstructorElement _immediateRedirectionTarget; |
2232 PrefixElement _redirectionDeferredPrefix; | 2235 PrefixElement _redirectionDeferredPrefix; |
2233 | 2236 |
2234 ConstructorElementX get patch => super.patch; | 2237 ConstructorElementX get patch => super.patch; |
2235 | 2238 |
| 2239 bool get isRedirectingGenerative { |
| 2240 if (isPatched) return patch.isRedirectingGenerative; |
| 2241 return isRedirectingGenerativeInternal; |
| 2242 } |
| 2243 |
2236 bool get isRedirectingFactory => immediateRedirectionTarget != null; | 2244 bool get isRedirectingFactory => immediateRedirectionTarget != null; |
2237 | 2245 |
2238 // TODO(johnniwinther): This should also return true for cyclic redirecting | 2246 // TODO(johnniwinther): This should also return true for cyclic redirecting |
2239 // generative constructors. | 2247 // generative constructors. |
2240 bool get isCyclicRedirection => effectiveTarget.isRedirectingFactory; | 2248 bool get isCyclicRedirection => effectiveTarget.isRedirectingFactory; |
2241 | 2249 |
2242 bool get isDefaultConstructor => false; | 2250 bool get isDefaultConstructor => false; |
2243 | 2251 |
2244 /// These fields are set by the post process queue when checking for cycles. | 2252 /// These fields are set by the post process queue when checking for cycles. |
2245 ConstructorElement effectiveTargetInternal; | 2253 ConstructorElement effectiveTargetInternal; |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3406 body = node.asFunctionExpression().body; | 3414 body = node.asFunctionExpression().body; |
3407 } | 3415 } |
3408 return new ParsedResolvedAst( | 3416 return new ParsedResolvedAst( |
3409 declaration, | 3417 declaration, |
3410 node, | 3418 node, |
3411 body, | 3419 body, |
3412 definingElement.treeElements, | 3420 definingElement.treeElements, |
3413 definingElement.compilationUnit.script.resourceUri); | 3421 definingElement.compilationUnit.script.resourceUri); |
3414 } | 3422 } |
3415 } | 3423 } |
OLD | NEW |