| 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 // This code was auto-generated, is not intended to be edited, and is subject to |    5 // This code was auto-generated, is not intended to be edited, and is subject to | 
|    6 // significant change. Please see the README file for more information. |    6 // significant change. Please see the README file for more information. | 
|    7  |    7  | 
|    8 library engine.testing.element_factory; |    8 library engine.testing.element_factory; | 
|    9  |    9  | 
|   10 import 'dart:collection'; |   10 import 'dart:collection'; | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
|   31  |   31  | 
|   32   static ClassElementImpl get object { |   32   static ClassElementImpl get object { | 
|   33     if (_objectElement == null) { |   33     if (_objectElement == null) { | 
|   34       _objectElement = classElement("Object", null); |   34       _objectElement = classElement("Object", null); | 
|   35     } |   35     } | 
|   36     return _objectElement; |   36     return _objectElement; | 
|   37   } |   37   } | 
|   38  |   38  | 
|   39   static InterfaceType get objectType => object.type; |   39   static InterfaceType get objectType => object.type; | 
|   40  |   40  | 
|   41   static ClassElementImpl classElement(String typeName, |   41   static ClassElementImpl classElement( | 
|   42       InterfaceType superclassType, [List<String> parameterNames]) { |   42       String typeName, InterfaceType superclassType, | 
 |   43       [List<String> parameterNames]) { | 
|   43     ClassElementImpl element = new ClassElementImpl(typeName, 0); |   44     ClassElementImpl element = new ClassElementImpl(typeName, 0); | 
|   44     element.supertype = superclassType; |   45     element.supertype = superclassType; | 
|   45     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element); |   46     InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element); | 
|   46     element.type = type; |   47     element.type = type; | 
|   47     if (parameterNames != null) { |   48     if (parameterNames != null) { | 
|   48       int count = parameterNames.length; |   49       int count = parameterNames.length; | 
|   49       if (count > 0) { |   50       if (count > 0) { | 
|   50         List<TypeParameterElementImpl> typeParameters = |   51         List<TypeParameterElementImpl> typeParameters = | 
|   51             new List<TypeParameterElementImpl>(count); |   52             new List<TypeParameterElementImpl>(count); | 
|   52         List<TypeParameterTypeImpl> typeParameterTypes = |   53         List<TypeParameterTypeImpl> typeParameterTypes = | 
|   53             new List<TypeParameterTypeImpl>(count); |   54             new List<TypeParameterTypeImpl>(count); | 
|   54         for (int i = 0; i < count; i++) { |   55         for (int i = 0; i < count; i++) { | 
|   55           TypeParameterElementImpl typeParameter = |   56           TypeParameterElementImpl typeParameter = | 
|   56               new TypeParameterElementImpl(parameterNames[i], 0); |   57               new TypeParameterElementImpl(parameterNames[i], 0); | 
|   57           typeParameters[i] = typeParameter; |   58           typeParameters[i] = typeParameter; | 
|   58           typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter); |   59           typeParameterTypes[i] = new TypeParameterTypeImpl(typeParameter); | 
|   59           typeParameter.type = typeParameterTypes[i]; |   60           typeParameter.type = typeParameterTypes[i]; | 
|   60         } |   61         } | 
|   61         element.typeParameters = typeParameters; |   62         element.typeParameters = typeParameters; | 
|   62         type.typeArguments = typeParameterTypes; |   63         type.typeArguments = typeParameterTypes; | 
|   63       } |   64       } | 
|   64     } |   65     } | 
|   65     return element; |   66     return element; | 
|   66   } |   67   } | 
|   67  |   68  | 
|   68   static ClassElementImpl classElement2(String typeName, |   69   static ClassElementImpl classElement2(String typeName, | 
|   69       [List<String> parameterNames]) => |   70           [List<String> parameterNames]) => | 
|   70       classElement(typeName, objectType, parameterNames); |   71       classElement(typeName, objectType, parameterNames); | 
|   71  |   72  | 
|   72   static CompilationUnitElementImpl compilationUnit(String fileName) { |   73   static CompilationUnitElementImpl compilationUnit(String fileName) { | 
|   73     Source source = new NonExistingSource(fileName, UriKind.FILE_URI); |   74     Source source = new NonExistingSource(fileName, UriKind.FILE_URI); | 
|   74     CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName); |   75     CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName); | 
|   75     unit.source = source; |   76     unit.source = source; | 
|   76     return unit; |   77     return unit; | 
|   77   } |   78   } | 
|   78  |   79  | 
|   79   static ConstructorElementImpl constructorElement(ClassElement definingClass, |   80   static ConstructorElementImpl constructorElement( | 
|   80       String name, bool isConst, [List<DartType> argumentTypes]) { |   81       ClassElement definingClass, String name, bool isConst, | 
 |   82       [List<DartType> argumentTypes]) { | 
|   81     DartType type = definingClass.type; |   83     DartType type = definingClass.type; | 
|   82     ConstructorElementImpl constructor = name == null ? |   84     ConstructorElementImpl constructor = name == null | 
|   83         new ConstructorElementImpl("", -1) : |   85         ? new ConstructorElementImpl("", -1) | 
|   84         new ConstructorElementImpl(name, 0); |   86         : new ConstructorElementImpl(name, 0); | 
|   85     constructor.const2 = isConst; |   87     constructor.const2 = isConst; | 
|   86     if (argumentTypes != null) { |   88     if (argumentTypes != null) { | 
|   87       int count = argumentTypes.length; |   89       int count = argumentTypes.length; | 
|   88       List<ParameterElement> parameters = new List<ParameterElement>(count); |   90       List<ParameterElement> parameters = new List<ParameterElement>(count); | 
|   89       for (int i = 0; i < count; i++) { |   91       for (int i = 0; i < count; i++) { | 
|   90         ParameterElementImpl parameter = new ParameterElementImpl("a$i", i); |   92         ParameterElementImpl parameter = new ParameterElementImpl("a$i", i); | 
|   91         parameter.type = argumentTypes[i]; |   93         parameter.type = argumentTypes[i]; | 
|   92         parameter.parameterKind = ParameterKind.REQUIRED; |   94         parameter.parameterKind = ParameterKind.REQUIRED; | 
|   93         parameters[i] = parameter; |   95         parameters[i] = parameter; | 
|   94       } |   96       } | 
|   95       constructor.parameters = parameters; |   97       constructor.parameters = parameters; | 
|   96     } else { |   98     } else { | 
|   97       constructor.parameters = <ParameterElement>[]; |   99       constructor.parameters = <ParameterElement>[]; | 
|   98     } |  100     } | 
|   99     constructor.returnType = type; |  101     constructor.returnType = type; | 
|  100     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor); |  102     FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor); | 
|  101     constructor.type = constructorType; |  103     constructor.type = constructorType; | 
|  102     return constructor; |  104     return constructor; | 
|  103   } |  105   } | 
|  104  |  106  | 
|  105   static ConstructorElementImpl constructorElement2(ClassElement definingClass, |  107   static ConstructorElementImpl constructorElement2( | 
|  106       String name, [List<DartType> argumentTypes]) => |  108           ClassElement definingClass, String name, | 
 |  109           [List<DartType> argumentTypes]) => | 
|  107       constructorElement(definingClass, name, false, argumentTypes); |  110       constructorElement(definingClass, name, false, argumentTypes); | 
|  108  |  111  | 
|  109   static ClassElementImpl enumElement(TypeProvider typeProvider, |  112   static ClassElementImpl enumElement( | 
|  110       String enumName, [List<String> constantNames]) { |  113       TypeProvider typeProvider, String enumName, | 
 |  114       [List<String> constantNames]) { | 
|  111     // |  115     // | 
|  112     // Build the enum. |  116     // Build the enum. | 
|  113     // |  117     // | 
|  114     ClassElementImpl enumElement = new ClassElementImpl(enumName, -1); |  118     ClassElementImpl enumElement = new ClassElementImpl(enumName, -1); | 
|  115     InterfaceTypeImpl enumType = new InterfaceTypeImpl.con1(enumElement); |  119     InterfaceTypeImpl enumType = new InterfaceTypeImpl.con1(enumElement); | 
|  116     enumElement.type = enumType; |  120     enumElement.type = enumType; | 
|  117     enumElement.supertype = objectType; |  121     enumElement.supertype = objectType; | 
|  118     enumElement.enum2 = true; |  122     enumElement.enum2 = true; | 
|  119     // |  123     // | 
|  120     // Populate the fields. |  124     // Populate the fields. | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  169   } |  173   } | 
|  170  |  174  | 
|  171   static ExportElementImpl exportFor(LibraryElement exportedLibrary, |  175   static ExportElementImpl exportFor(LibraryElement exportedLibrary, | 
|  172       [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY])
      { |  176       [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY])
      { | 
|  173     ExportElementImpl spec = new ExportElementImpl(); |  177     ExportElementImpl spec = new ExportElementImpl(); | 
|  174     spec.exportedLibrary = exportedLibrary; |  178     spec.exportedLibrary = exportedLibrary; | 
|  175     spec.combinators = combinators; |  179     spec.combinators = combinators; | 
|  176     return spec; |  180     return spec; | 
|  177   } |  181   } | 
|  178  |  182  | 
|  179   static FieldElementImpl fieldElement(String name, bool isStatic, bool isFinal, |  183   static FieldElementImpl fieldElement( | 
|  180       bool isConst, DartType type) { |  184       String name, bool isStatic, bool isFinal, bool isConst, DartType type) { | 
|  181     FieldElementImpl field = new FieldElementImpl(name, 0); |  185     FieldElementImpl field = new FieldElementImpl(name, 0); | 
|  182     field.const3 = isConst; |  186     field.const3 = isConst; | 
|  183     field.final2 = isFinal; |  187     field.final2 = isFinal; | 
|  184     field.static = isStatic; |  188     field.static = isStatic; | 
|  185     field.type = type; |  189     field.type = type; | 
|  186     PropertyAccessorElementImpl getter = |  190     PropertyAccessorElementImpl getter = | 
|  187         new PropertyAccessorElementImpl.forVariable(field); |  191         new PropertyAccessorElementImpl.forVariable(field); | 
|  188     getter.getter = true; |  192     getter.getter = true; | 
|  189     getter.synthetic = true; |  193     getter.synthetic = true; | 
|  190     getter.variable = field; |  194     getter.variable = field; | 
|  191     getter.returnType = type; |  195     getter.returnType = type; | 
|  192     field.getter = getter; |  196     field.getter = getter; | 
|  193     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); |  197     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); | 
|  194     getter.type = getterType; |  198     getter.type = getterType; | 
|  195     if (!isConst && !isFinal) { |  199     if (!isConst && !isFinal) { | 
|  196       PropertyAccessorElementImpl setter = |  200       PropertyAccessorElementImpl setter = | 
|  197           new PropertyAccessorElementImpl.forVariable(field); |  201           new PropertyAccessorElementImpl.forVariable(field); | 
|  198       setter.setter = true; |  202       setter.setter = true; | 
|  199       setter.synthetic = true; |  203       setter.synthetic = true; | 
|  200       setter.variable = field; |  204       setter.variable = field; | 
|  201       setter.parameters = |  205       setter.parameters = <ParameterElement>[ | 
|  202           <ParameterElement>[requiredParameter2("_$name", type)]; |  206         requiredParameter2("_$name", type) | 
 |  207       ]; | 
|  203       setter.returnType = VoidTypeImpl.instance; |  208       setter.returnType = VoidTypeImpl.instance; | 
|  204       setter.type = new FunctionTypeImpl.con1(setter); |  209       setter.type = new FunctionTypeImpl.con1(setter); | 
|  205       field.setter = setter; |  210       field.setter = setter; | 
|  206     } |  211     } | 
|  207     return field; |  212     return field; | 
|  208   } |  213   } | 
|  209  |  214  | 
|  210   static FieldFormalParameterElementImpl |  215   static FieldFormalParameterElementImpl fieldFormalParameter( | 
|  211       fieldFormalParameter(Identifier name) => |  216       Identifier name) => new FieldFormalParameterElementImpl(name); | 
|  212       new FieldFormalParameterElementImpl(name); |  | 
|  213  |  217  | 
|  214   static FunctionElementImpl functionElement(String functionName) => |  218   static FunctionElementImpl functionElement(String functionName) => | 
|  215       functionElement4(functionName, null, null, null, null); |  219       functionElement4(functionName, null, null, null, null); | 
|  216  |  220  | 
|  217   static FunctionElementImpl functionElement2(String functionName, |  221   static FunctionElementImpl functionElement2( | 
|  218       ClassElement returnElement) => |  222           String functionName, ClassElement returnElement) => | 
|  219       functionElement3(functionName, returnElement, null, null); |  223       functionElement3(functionName, returnElement, null, null); | 
|  220  |  224  | 
|  221   static FunctionElementImpl functionElement3(String functionName, |  225   static FunctionElementImpl functionElement3(String functionName, | 
|  222       ClassElement returnElement, List<ClassElement> normalParameters, |  226       ClassElement returnElement, List<ClassElement> normalParameters, | 
|  223       List<ClassElement> optionalParameters) { |  227       List<ClassElement> optionalParameters) { | 
|  224     // We don't create parameter elements because we don't have parameter names |  228     // We don't create parameter elements because we don't have parameter names | 
|  225     FunctionElementImpl functionElement = |  229     FunctionElementImpl functionElement = | 
|  226         new FunctionElementImpl(functionName, 0); |  230         new FunctionElementImpl(functionName, 0); | 
|  227     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); |  231     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); | 
|  228     functionElement.type = functionType; |  232     functionElement.type = functionType; | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  288     functionElement.parameters = parameters; |  292     functionElement.parameters = parameters; | 
|  289     // return type |  293     // return type | 
|  290     if (returnElement == null) { |  294     if (returnElement == null) { | 
|  291       functionElement.returnType = VoidTypeImpl.instance; |  295       functionElement.returnType = VoidTypeImpl.instance; | 
|  292     } else { |  296     } else { | 
|  293       functionElement.returnType = returnElement.type; |  297       functionElement.returnType = returnElement.type; | 
|  294     } |  298     } | 
|  295     return functionElement; |  299     return functionElement; | 
|  296   } |  300   } | 
|  297  |  301  | 
|  298   static FunctionElementImpl functionElement5(String functionName, |  302   static FunctionElementImpl functionElement5( | 
|  299       List<ClassElement> normalParameters) => |  303           String functionName, List<ClassElement> normalParameters) => | 
|  300       functionElement3(functionName, null, normalParameters, null); |  304       functionElement3(functionName, null, normalParameters, null); | 
|  301  |  305  | 
|  302   static FunctionElementImpl functionElement6(String functionName, |  306   static FunctionElementImpl functionElement6(String functionName, | 
|  303       List<ClassElement> normalParameters, List<ClassElement> optionalParameters
     ) => |  307       List<ClassElement> normalParameters, | 
|  304       functionElement3(functionName, null, normalParameters, optionalParameters)
     ; |  308       List<ClassElement> optionalParameters) => functionElement3( | 
 |  309           functionName, null, normalParameters, optionalParameters); | 
|  305  |  310  | 
|  306   static FunctionElementImpl functionElement7(String functionName, |  311   static FunctionElementImpl functionElement7(String functionName, | 
|  307       List<ClassElement> normalParameters, List<String> names, |  312       List<ClassElement> normalParameters, List<String> names, | 
|  308       List<ClassElement> namedParameters) => |  313       List<ClassElement> namedParameters) => functionElement4( | 
|  309       functionElement4(functionName, null, normalParameters, names, namedParamet
     ers); |  314           functionName, null, normalParameters, names, namedParameters); | 
|  310  |  315  | 
|  311   static FunctionElementImpl functionElementWithParameters(String functionName, |  316   static FunctionElementImpl functionElementWithParameters(String functionName, | 
|  312       DartType returnType, List<ParameterElement> parameters) { |  317       DartType returnType, List<ParameterElement> parameters) { | 
|  313     FunctionElementImpl functionElement = |  318     FunctionElementImpl functionElement = | 
|  314         new FunctionElementImpl(functionName, 0); |  319         new FunctionElementImpl(functionName, 0); | 
|  315     functionElement.returnType = |  320     functionElement.returnType = | 
|  316         returnType == null ? VoidTypeImpl.instance : returnType; |  321         returnType == null ? VoidTypeImpl.instance : returnType; | 
|  317     functionElement.parameters = parameters; |  322     functionElement.parameters = parameters; | 
|  318     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); |  323     FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); | 
|  319     functionElement.type = functionType; |  324     functionElement.type = functionType; | 
|  320     return functionElement; |  325     return functionElement; | 
|  321   } |  326   } | 
|  322  |  327  | 
|  323   static PropertyAccessorElementImpl getterElement(String name, bool isStatic, |  328   static PropertyAccessorElementImpl getterElement( | 
|  324       DartType type) { |  329       String name, bool isStatic, DartType type) { | 
|  325     FieldElementImpl field = new FieldElementImpl(name, -1); |  330     FieldElementImpl field = new FieldElementImpl(name, -1); | 
|  326     field.static = isStatic; |  331     field.static = isStatic; | 
|  327     field.synthetic = true; |  332     field.synthetic = true; | 
|  328     field.type = type; |  333     field.type = type; | 
|  329     PropertyAccessorElementImpl getter = |  334     PropertyAccessorElementImpl getter = | 
|  330         new PropertyAccessorElementImpl.forVariable(field); |  335         new PropertyAccessorElementImpl.forVariable(field); | 
|  331     getter.getter = true; |  336     getter.getter = true; | 
|  332     getter.variable = field; |  337     getter.variable = field; | 
|  333     getter.returnType = type; |  338     getter.returnType = type; | 
|  334     field.getter = getter; |  339     field.getter = getter; | 
|  335     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); |  340     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); | 
|  336     getter.type = getterType; |  341     getter.type = getterType; | 
|  337     return getter; |  342     return getter; | 
|  338   } |  343   } | 
|  339  |  344  | 
|  340   static HtmlElementImpl htmlUnit(AnalysisContext context, String fileName) { |  345   static HtmlElementImpl htmlUnit(AnalysisContext context, String fileName) { | 
|  341     Source source = new NonExistingSource(fileName, UriKind.FILE_URI); |  346     Source source = new NonExistingSource(fileName, UriKind.FILE_URI); | 
|  342     HtmlElementImpl unit = new HtmlElementImpl(context, fileName); |  347     HtmlElementImpl unit = new HtmlElementImpl(context, fileName); | 
|  343     unit.source = source; |  348     unit.source = source; | 
|  344     return unit; |  349     return unit; | 
|  345   } |  350   } | 
|  346  |  351  | 
|  347   static ImportElementImpl importFor(LibraryElement importedLibrary, |  352   static ImportElementImpl importFor( | 
|  348       PrefixElement prefix, [List<NamespaceCombinator> combinators = |  353       LibraryElement importedLibrary, PrefixElement prefix, | 
|  349       NamespaceCombinator.EMPTY_ARRAY]) { |  354       [List<NamespaceCombinator> combinators = NamespaceCombinator.EMPTY_ARRAY])
      { | 
|  350     ImportElementImpl spec = new ImportElementImpl(0); |  355     ImportElementImpl spec = new ImportElementImpl(0); | 
|  351     spec.importedLibrary = importedLibrary; |  356     spec.importedLibrary = importedLibrary; | 
|  352     spec.prefix = prefix; |  357     spec.prefix = prefix; | 
|  353     spec.combinators = combinators; |  358     spec.combinators = combinators; | 
|  354     return spec; |  359     return spec; | 
|  355   } |  360   } | 
|  356  |  361  | 
|  357   static LibraryElementImpl library(AnalysisContext context, |  362   static LibraryElementImpl library( | 
|  358       String libraryName) { |  363       AnalysisContext context, String libraryName) { | 
|  359     String fileName = "/$libraryName.dart"; |  364     String fileName = "/$libraryName.dart"; | 
|  360     CompilationUnitElementImpl unit = compilationUnit(fileName); |  365     CompilationUnitElementImpl unit = compilationUnit(fileName); | 
|  361     LibraryElementImpl library = |  366     LibraryElementImpl library = | 
|  362         new LibraryElementImpl(context, libraryName, 0); |  367         new LibraryElementImpl(context, libraryName, 0); | 
|  363     library.definingCompilationUnit = unit; |  368     library.definingCompilationUnit = unit; | 
|  364     return library; |  369     return library; | 
|  365   } |  370   } | 
|  366  |  371  | 
|  367   static LocalVariableElementImpl localVariableElement(Identifier name) => |  372   static LocalVariableElementImpl localVariableElement(Identifier name) => | 
|  368       new LocalVariableElementImpl.forNode(name); |  373       new LocalVariableElementImpl.forNode(name); | 
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  439     return parameter; |  444     return parameter; | 
|  440   } |  445   } | 
|  441  |  446  | 
|  442   static ParameterElementImpl requiredParameter2(String name, DartType type) { |  447   static ParameterElementImpl requiredParameter2(String name, DartType type) { | 
|  443     ParameterElementImpl parameter = new ParameterElementImpl(name, 0); |  448     ParameterElementImpl parameter = new ParameterElementImpl(name, 0); | 
|  444     parameter.parameterKind = ParameterKind.REQUIRED; |  449     parameter.parameterKind = ParameterKind.REQUIRED; | 
|  445     parameter.type = type; |  450     parameter.type = type; | 
|  446     return parameter; |  451     return parameter; | 
|  447   } |  452   } | 
|  448  |  453  | 
|  449   static PropertyAccessorElementImpl setterElement(String name, bool isStatic, |  454   static PropertyAccessorElementImpl setterElement( | 
|  450       DartType type) { |  455       String name, bool isStatic, DartType type) { | 
|  451     FieldElementImpl field = new FieldElementImpl(name, -1); |  456     FieldElementImpl field = new FieldElementImpl(name, -1); | 
|  452     field.static = isStatic; |  457     field.static = isStatic; | 
|  453     field.synthetic = true; |  458     field.synthetic = true; | 
|  454     field.type = type; |  459     field.type = type; | 
|  455     PropertyAccessorElementImpl getter = |  460     PropertyAccessorElementImpl getter = | 
|  456         new PropertyAccessorElementImpl.forVariable(field); |  461         new PropertyAccessorElementImpl.forVariable(field); | 
|  457     getter.getter = true; |  462     getter.getter = true; | 
|  458     getter.variable = field; |  463     getter.variable = field; | 
|  459     getter.returnType = type; |  464     getter.returnType = type; | 
|  460     field.getter = getter; |  465     field.getter = getter; | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
|  472     field.setter = setter; |  477     field.setter = setter; | 
|  473     return setter; |  478     return setter; | 
|  474   } |  479   } | 
|  475  |  480  | 
|  476   static TopLevelVariableElementImpl topLevelVariableElement(Identifier name) => |  481   static TopLevelVariableElementImpl topLevelVariableElement(Identifier name) => | 
|  477       new TopLevelVariableElementImpl.forNode(name); |  482       new TopLevelVariableElementImpl.forNode(name); | 
|  478  |  483  | 
|  479   static TopLevelVariableElementImpl topLevelVariableElement2(String name) => |  484   static TopLevelVariableElementImpl topLevelVariableElement2(String name) => | 
|  480       topLevelVariableElement3(name, false, false, null); |  485       topLevelVariableElement3(name, false, false, null); | 
|  481  |  486  | 
|  482   static TopLevelVariableElementImpl topLevelVariableElement3(String name, |  487   static TopLevelVariableElementImpl topLevelVariableElement3( | 
|  483       bool isConst, bool isFinal, DartType type) { |  488       String name, bool isConst, bool isFinal, DartType type) { | 
|  484     TopLevelVariableElementImpl variable = |  489     TopLevelVariableElementImpl variable = | 
|  485         new TopLevelVariableElementImpl(name, -1); |  490         new TopLevelVariableElementImpl(name, -1); | 
|  486     variable.const3 = isConst; |  491     variable.const3 = isConst; | 
|  487     variable.final2 = isFinal; |  492     variable.final2 = isFinal; | 
|  488     variable.synthetic = true; |  493     variable.synthetic = true; | 
|  489     PropertyAccessorElementImpl getter = |  494     PropertyAccessorElementImpl getter = | 
|  490         new PropertyAccessorElementImpl.forVariable(variable); |  495         new PropertyAccessorElementImpl.forVariable(variable); | 
|  491     getter.getter = true; |  496     getter.getter = true; | 
|  492     getter.synthetic = true; |  497     getter.synthetic = true; | 
|  493     getter.variable = variable; |  498     getter.variable = variable; | 
|  494     getter.returnType = type; |  499     getter.returnType = type; | 
|  495     variable.getter = getter; |  500     variable.getter = getter; | 
|  496     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); |  501     FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter); | 
|  497     getter.type = getterType; |  502     getter.type = getterType; | 
|  498     if (!isConst && !isFinal) { |  503     if (!isConst && !isFinal) { | 
|  499       PropertyAccessorElementImpl setter = |  504       PropertyAccessorElementImpl setter = | 
|  500           new PropertyAccessorElementImpl.forVariable(variable); |  505           new PropertyAccessorElementImpl.forVariable(variable); | 
|  501       setter.setter = true; |  506       setter.setter = true; | 
|  502       setter.static = true; |  507       setter.static = true; | 
|  503       setter.synthetic = true; |  508       setter.synthetic = true; | 
|  504       setter.variable = variable; |  509       setter.variable = variable; | 
|  505       setter.parameters = |  510       setter.parameters = <ParameterElement>[ | 
|  506           <ParameterElement>[requiredParameter2("_$name", type)]; |  511         requiredParameter2("_$name", type) | 
 |  512       ]; | 
|  507       setter.returnType = VoidTypeImpl.instance; |  513       setter.returnType = VoidTypeImpl.instance; | 
|  508       setter.type = new FunctionTypeImpl.con1(setter); |  514       setter.type = new FunctionTypeImpl.con1(setter); | 
|  509       variable.setter = setter; |  515       variable.setter = setter; | 
|  510     } |  516     } | 
|  511     return variable; |  517     return variable; | 
|  512   } |  518   } | 
|  513 } |  519 } | 
| OLD | NEW |