OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.testing.element_factory; | 5 library engine.testing.element_factory; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
10 import 'package:analyzer/src/generated/constant.dart'; | 10 import 'package:analyzer/src/generated/constant.dart'; |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 new PropertyAccessorElementImpl.forVariable(field); | 402 new PropertyAccessorElementImpl.forVariable(field); |
403 getter.getter = true; | 403 getter.getter = true; |
404 getter.variable = field; | 404 getter.variable = field; |
405 getter.returnType = type; | 405 getter.returnType = type; |
406 field.getter = getter; | 406 field.getter = getter; |
407 FunctionTypeImpl getterType = new FunctionTypeImpl(getter); | 407 FunctionTypeImpl getterType = new FunctionTypeImpl(getter); |
408 getter.type = getterType; | 408 getter.type = getterType; |
409 return getter; | 409 return getter; |
410 } | 410 } |
411 | 411 |
412 @deprecated | |
413 static HtmlElementImpl htmlUnit(AnalysisContext context, String fileName) { | |
414 Source source = | |
415 new NonExistingSource(fileName, toUri(fileName), UriKind.FILE_URI); | |
416 HtmlElementImpl unit = new HtmlElementImpl(context, fileName); | |
417 unit.source = source; | |
418 return unit; | |
419 } | |
420 | |
421 static ImportElementImpl importFor( | 412 static ImportElementImpl importFor( |
422 LibraryElement importedLibrary, PrefixElement prefix, | 413 LibraryElement importedLibrary, PrefixElement prefix, |
423 [List<NamespaceCombinator> combinators = | 414 [List<NamespaceCombinator> combinators = |
424 NamespaceCombinator.EMPTY_LIST]) { | 415 NamespaceCombinator.EMPTY_LIST]) { |
425 ImportElementImpl spec = new ImportElementImpl(0); | 416 ImportElementImpl spec = new ImportElementImpl(0); |
426 spec.importedLibrary = importedLibrary; | 417 spec.importedLibrary = importedLibrary; |
427 spec.prefix = prefix; | 418 spec.prefix = prefix; |
428 spec.combinators = combinators; | 419 spec.combinators = combinators; |
429 return spec; | 420 return spec; |
430 } | 421 } |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 } | 608 } |
618 | 609 |
619 static TypeParameterElementImpl typeParameterWithType(String name, | 610 static TypeParameterElementImpl typeParameterWithType(String name, |
620 [DartType bound]) { | 611 [DartType bound]) { |
621 TypeParameterElementImpl typeParameter = typeParameterElement(name); | 612 TypeParameterElementImpl typeParameter = typeParameterElement(name); |
622 typeParameter.type = new TypeParameterTypeImpl(typeParameter); | 613 typeParameter.type = new TypeParameterTypeImpl(typeParameter); |
623 typeParameter.bound = bound; | 614 typeParameter.bound = bound; |
624 return typeParameter; | 615 return typeParameter; |
625 } | 616 } |
626 } | 617 } |
OLD | NEW |