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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
8 /// | 8 /// |
9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 777 |
778 /// If true, a setter should be generated for this field. | 778 /// If true, a setter should be generated for this field. |
779 /// | 779 /// |
780 /// If false, there may or may not exist an explicit setter in the same class | 780 /// If false, there may or may not exist an explicit setter in the same class |
781 /// with the same name as the field. | 781 /// with the same name as the field. |
782 /// | 782 /// |
783 /// Final fields never have implicit setters, but a field without an implicit | 783 /// Final fields never have implicit setters, but a field without an implicit |
784 /// setter is not necessarily final, as it may be mutated by direct field | 784 /// setter is not necessarily final, as it may be mutated by direct field |
785 /// access. | 785 /// access. |
786 /// | 786 /// |
787 /// By default, all non-static, non-final fields have implicit getters. | 787 /// By default, all non-static, non-final fields have implicit setters. |
788 bool get hasImplicitSetter => flags & FlagHasImplicitSetter != 0; | 788 bool get hasImplicitSetter => flags & FlagHasImplicitSetter != 0; |
789 | 789 |
790 void set isFinal(bool value) { | 790 void set isFinal(bool value) { |
791 flags = value ? (flags | FlagFinal) : (flags & ~FlagFinal); | 791 flags = value ? (flags | FlagFinal) : (flags & ~FlagFinal); |
792 } | 792 } |
793 | 793 |
794 void set isConst(bool value) { | 794 void set isConst(bool value) { |
795 flags = value ? (flags | FlagConst) : (flags & ~FlagConst); | 795 flags = value ? (flags | FlagConst) : (flags & ~FlagConst); |
796 } | 796 } |
797 | 797 |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 } | 1927 } |
1928 | 1928 |
1929 transformChildren(Transformer v) { | 1929 transformChildren(Transformer v) { |
1930 if (value != null) { | 1930 if (value != null) { |
1931 value = value.accept(v); | 1931 value = value.accept(v); |
1932 value?.parent = this; | 1932 value?.parent = this; |
1933 } | 1933 } |
1934 } | 1934 } |
1935 } | 1935 } |
1936 | 1936 |
1937 /// Common super class for [MethodInvocation], [SuperMethodInvocation], | 1937 /// Common super class for [DirectMethodInvocation], [MethodInvocation], |
1938 /// [StaticInvocation], and [ConstructorInvocation]. | 1938 /// [SuperMethodInvocation], [StaticInvocation], and [ConstructorInvocation]. |
1939 abstract class InvocationExpression extends Expression { | 1939 abstract class InvocationExpression extends Expression { |
1940 Arguments get arguments; | 1940 Arguments get arguments; |
1941 set arguments(Arguments value); | 1941 set arguments(Arguments value); |
1942 | 1942 |
1943 /// Name of the invoked method. | 1943 /// Name of the invoked method. |
1944 /// | 1944 /// |
1945 /// May be `null` if the target is a synthetic static member without a name. | 1945 /// May be `null` if the target is a synthetic static member without a name. |
1946 Name get name; | 1946 Name get name; |
1947 } | 1947 } |
1948 | 1948 |
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4275 /// library has not been assigned a canonical name yet. | 4275 /// library has not been assigned a canonical name yet. |
4276 /// | 4276 /// |
4277 /// Returns `null` if the library is `null`. | 4277 /// Returns `null` if the library is `null`. |
4278 CanonicalName getCanonicalNameOfLibrary(Library library) { | 4278 CanonicalName getCanonicalNameOfLibrary(Library library) { |
4279 if (library == null) return null; | 4279 if (library == null) return null; |
4280 if (library.canonicalName == null) { | 4280 if (library.canonicalName == null) { |
4281 throw '$library has no canonical name'; | 4281 throw '$library has no canonical name'; |
4282 } | 4282 } |
4283 return library.canonicalName; | 4283 return library.canonicalName; |
4284 } | 4284 } |
OLD | NEW |