mirror of
https://github.com/dart-lang/sdk
synced 2024-10-01 19:14:49 +00:00
[flip-modifiers]: Reapply "Enforce current library restrictions."
This reapplies commit0c05e33836
and reverts the revert029e0cec71
. Tested: Added few new tests, updated existing. Mainly regression testing. CoreLibraryReviewExempt: Reviewed in original CL. Change-Id: Ifcc79ce2f9375f607722643a04957b0961e6c295 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284304 Reviewed-by: Ömer Ağacan <omersa@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com> Reviewed-by: Aske Simon Christensen <askesc@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
parent
8e600908b6
commit
cc736dfb65
21
CHANGELOG.md
21
CHANGELOG.md
|
@ -16,6 +16,18 @@
|
|||
|
||||
### Libraries
|
||||
|
||||
#### General changes
|
||||
|
||||
- **Breaking Change**: Non-`mixin` classes in the platform libraries
|
||||
can no longer be mixed in, unless they are explicitly marked as `mixin class`.
|
||||
The following existing classes have been made mixin classes:
|
||||
* `IterableMixin`
|
||||
* `ListMixin`
|
||||
* `SetMixin`
|
||||
* `MapMixin`
|
||||
* `LinkedListEntry`
|
||||
* `StringConversionSink`
|
||||
|
||||
#### `dart:core`
|
||||
|
||||
- **Breaking change** [#49529][]:
|
||||
|
@ -48,6 +60,15 @@
|
|||
Existing bidirectional iterators can still work, they just don't have
|
||||
a shared supertype locking them to a specific name for moving backwards.
|
||||
|
||||
- **Breaking change when migrating code to Dart 3.0**:
|
||||
Some changes to platform libraries only affect code when it is migrated
|
||||
to language version 3.0.
|
||||
- The `Function` type can no longer be implemented.
|
||||
Since Dart 2.0 writing `implements Function` has been allowed
|
||||
for backwards compatibility, but it has not had any effect.
|
||||
In Dart 3.0, the `Function` type is `final` and cannot be implemented
|
||||
by class-modifier aware code.
|
||||
|
||||
[#49529]: https://github.com/dart-lang/sdk/issues/49529
|
||||
[`List.filled`]: https://api.dart.dev/stable/2.18.6/dart-core/List/List.filled.html
|
||||
[`int.parse`]: https://api.dart.dev/stable/2.18.4/dart-core/int/parse.html
|
||||
|
|
|
@ -71,7 +71,7 @@ void buildTestsForAnalysisServer() {
|
|||
'lib/src/edit/nnbd_migration/resources/resources.g.dart',
|
||||
'test/integration/support/integration_test_methods.dart',
|
||||
'test/integration/support/protocol_matchers.dart',
|
||||
// The following are not generated, but can't be sorted because the contain
|
||||
// The following are not generated, but can't be sorted because they contain
|
||||
// ignore comments in the directives, which sorting deletes.
|
||||
'lib/src/edit/edit_domain.dart',
|
||||
'lib/src/services/kythe/schema.dart',
|
||||
|
|
|
@ -140,7 +140,7 @@ class ExperimentalFeatures {
|
|||
isEnabledByDefault: IsEnabledByDefault.class_modifiers,
|
||||
isExpired: IsExpired.class_modifiers,
|
||||
documentation: 'Class modifiers',
|
||||
experimentalReleaseVersion: null,
|
||||
experimentalReleaseVersion: Version.parse('3.0.0'),
|
||||
releaseVersion: null,
|
||||
);
|
||||
|
||||
|
@ -314,7 +314,7 @@ class ExperimentalFeatures {
|
|||
isEnabledByDefault: IsEnabledByDefault.records,
|
||||
isExpired: IsExpired.records,
|
||||
documentation: 'Records',
|
||||
experimentalReleaseVersion: Version.parse('2.19.0'),
|
||||
experimentalReleaseVersion: Version.parse('3.0.0'),
|
||||
releaseVersion: null,
|
||||
);
|
||||
|
||||
|
@ -324,7 +324,7 @@ class ExperimentalFeatures {
|
|||
isEnabledByDefault: IsEnabledByDefault.sealed_class,
|
||||
isExpired: IsExpired.sealed_class,
|
||||
documentation: 'Sealed class',
|
||||
experimentalReleaseVersion: null,
|
||||
experimentalReleaseVersion: Version.parse('3.0.0'),
|
||||
releaseVersion: null,
|
||||
);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analyzer/dart/analysis/features.dart';
|
||||
import 'package:analyzer/dart/ast/token.dart';
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
|
@ -66,6 +67,26 @@ class BaseOrFinalTypeVerifier {
|
|||
}
|
||||
}
|
||||
|
||||
/// Checks whether a `final`, `base` or `interface` modifier can be ignored.
|
||||
///
|
||||
/// Checks whether a subclass in the current library
|
||||
/// can ignore a class modifier of a declaration in [superLibrary].
|
||||
///
|
||||
/// Only true if the supertype library is a platform library, and
|
||||
/// either the current library is also a platform library,
|
||||
/// or the current library has a language version which predates
|
||||
/// class modifiers
|
||||
bool _mayIgnoreClassModifiers(LibraryElement superLibrary) {
|
||||
// Only modifiers in platform libraries can be ignored.
|
||||
if (!superLibrary.isInSdk) return false;
|
||||
|
||||
// Other platform libraries can ignore modifiers.
|
||||
if (_definingLibrary.isInSdk) return true;
|
||||
|
||||
// Libraries predating class modifiers can ignore platform modifiers.
|
||||
return !_definingLibrary.featureSet.isEnabled(Feature.class_modifiers);
|
||||
}
|
||||
|
||||
/// Returns true if a element modifier restriction error has been reported.
|
||||
///
|
||||
/// Reports an error based on the modifier of the superElement.
|
||||
|
@ -82,7 +103,8 @@ class BaseOrFinalTypeVerifier {
|
|||
baseOrFinalSuperElement = superElement;
|
||||
} else if (hasCachedBaseOrFinalSuperElement) {
|
||||
// There's a base or final element higher up in the class hierarchy.
|
||||
// The superelement is a sealed element.
|
||||
// The superelement is a sealed element or an element of a
|
||||
// legacy library.
|
||||
baseOrFinalSuperElement = cachedBaseOrFinalSuperElement;
|
||||
} else {
|
||||
// There are no restrictions on this element's modifiers.
|
||||
|
@ -95,13 +117,16 @@ class BaseOrFinalTypeVerifier {
|
|||
// Only report errors on elements within the current library.
|
||||
return false;
|
||||
}
|
||||
if (!element.isBase && !element.isFinal && !element.isSealed) {
|
||||
if (!element.isBase &&
|
||||
!element.isFinal &&
|
||||
!element.isSealed &&
|
||||
!_mayIgnoreClassModifiers(baseOrFinalSuperElement.library)) {
|
||||
final contextMessage = <DiagnosticMessage>[
|
||||
DiagnosticMessageImpl(
|
||||
filePath: superElement.source.fullName,
|
||||
length: superElement.nameLength,
|
||||
message: "The type '${superElement.name}' is a subtype of "
|
||||
"'${baseOrFinalSuperElement.name}', and "
|
||||
message: "The type '${superElement.displayName}' is a subtype of "
|
||||
"'${baseOrFinalSuperElement.displayName}', and "
|
||||
"'${superElement.name}' is defined here.",
|
||||
offset: superElement.nameOffset,
|
||||
url: null,
|
||||
|
|
|
@ -1746,7 +1746,10 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
final interfaceElement = interfaceType.element;
|
||||
if (interfaceElement is ClassOrMixinElementImpl &&
|
||||
interfaceElement.isBase &&
|
||||
interfaceElement.library != _currentLibrary) {
|
||||
interfaceElement.library != _currentLibrary &&
|
||||
!_mayIgnoreClassModifiers(interfaceElement.library)) {
|
||||
// Should this be combined with _checkForImplementsClauseErrorCodes
|
||||
// to avoid double errors if implementing `int`.
|
||||
if (interfaceElement is ClassElement) {
|
||||
errorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY,
|
||||
|
@ -2858,7 +2861,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
final element = type.element;
|
||||
if (element is ClassElementImpl &&
|
||||
element.isFinal &&
|
||||
element.library != _currentLibrary) {
|
||||
element.library != _currentLibrary &&
|
||||
!_mayIgnoreClassModifiers(element.library)) {
|
||||
errorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY,
|
||||
superclass,
|
||||
|
@ -2873,7 +2877,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
final element = type.element;
|
||||
if (element is MixinElementImpl &&
|
||||
element.isFinal &&
|
||||
element.library != _currentLibrary) {
|
||||
element.library != _currentLibrary &&
|
||||
!_mayIgnoreClassModifiers(element.library)) {
|
||||
errorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.FINAL_MIXIN_MIXED_IN_OUTSIDE_OF_LIBRARY,
|
||||
namedType,
|
||||
|
@ -2889,7 +2894,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
final element = type.element;
|
||||
if (element is ClassOrMixinElementImpl &&
|
||||
element.isFinal &&
|
||||
element.library != _currentLibrary) {
|
||||
element.library != _currentLibrary &&
|
||||
!_mayIgnoreClassModifiers(element.library)) {
|
||||
final ErrorCode errorCode;
|
||||
if (element is ClassElement) {
|
||||
errorCode = CompileTimeErrorCode
|
||||
|
@ -3109,7 +3115,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
final superclassElement = superclassType.element;
|
||||
if (superclassElement is ClassElementImpl &&
|
||||
superclassElement.isInterface &&
|
||||
superclassElement.library != _currentLibrary) {
|
||||
superclassElement.library != _currentLibrary &&
|
||||
!_mayIgnoreClassModifiers(superclassElement.library)) {
|
||||
errorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY,
|
||||
superclass,
|
||||
|
@ -3124,7 +3131,8 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
final withElement = withType.element;
|
||||
if (withElement is MixinElementImpl &&
|
||||
withElement.isInterface &&
|
||||
withElement.library != _currentLibrary) {
|
||||
withElement.library != _currentLibrary &&
|
||||
!_mayIgnoreClassModifiers(withElement.library)) {
|
||||
errorReporter.reportErrorForNode(
|
||||
CompileTimeErrorCode
|
||||
.INTERFACE_MIXIN_MIXED_IN_OUTSIDE_OF_LIBRARY,
|
||||
|
@ -5481,6 +5489,26 @@ class ErrorVerifier extends RecursiveAstVisitor<void>
|
|||
return false;
|
||||
}
|
||||
|
||||
/// Checks whether a `final`, `base` or `interface` modifier can be ignored.
|
||||
///
|
||||
/// Checks whether a subclass in the current library
|
||||
/// can ignore a class modifier of a declaration in [superLibrary].
|
||||
///
|
||||
/// Only true if the supertype library is a platform library, and
|
||||
/// either the current library is also a platform library,
|
||||
/// or the current library has a language version which predates
|
||||
/// class modifiers
|
||||
bool _mayIgnoreClassModifiers(LibraryElement superLibrary) {
|
||||
// Only modifiers in platform libraries can be ignored.
|
||||
if (!superLibrary.isInSdk) return false;
|
||||
|
||||
// Other platform libraries can ignore modifiers.
|
||||
if (_currentLibrary.isInSdk) return true;
|
||||
|
||||
// Libraries predating class modifiers can ignore platform modifiers.
|
||||
return !_currentLibrary.featureSet.isEnabled(Feature.class_modifiers);
|
||||
}
|
||||
|
||||
/// Return the name of the [parameter], or `null` if the parameter does not
|
||||
/// have a name.
|
||||
Token? _parameterName(FormalParameter parameter) {
|
||||
|
|
|
@ -66,7 +66,7 @@ class DartUriResolver extends UriResolver {
|
|||
///
|
||||
/// @param uri the URI being tested
|
||||
/// @return `true` if the given URI is a `dart:` URI
|
||||
static bool isDartUri(Uri uri) => DART_SCHEME == uri.scheme;
|
||||
static bool isDartUri(Uri uri) => uri.isScheme(DART_SCHEME);
|
||||
}
|
||||
|
||||
/// An implementation of an non-existing [Source].
|
||||
|
|
|
@ -771,6 +771,8 @@ final Map<ExperimentalFlag, bool> defaultExperimentalFlags = {
|
|||
const AllowedExperimentalFlags defaultAllowedExperimentalFlags =
|
||||
const AllowedExperimentalFlags(sdkDefaultExperiments: {
|
||||
ExperimentalFlag.records,
|
||||
ExperimentalFlag.classModifiers,
|
||||
ExperimentalFlag.sealedClass,
|
||||
}, sdkLibraryExperiments: {}, packageExperiments: {
|
||||
"async": {
|
||||
ExperimentalFlag.nonNullable,
|
||||
|
|
|
@ -2162,6 +2162,56 @@ severity: $severity
|
|||
typeBuilder.libraryBuilder.library.languageVersion >=
|
||||
ExperimentalFlag.sealedClass.experimentEnabledVersion;
|
||||
|
||||
/// Set when we know whether this library can ignore class modifiers.
|
||||
///
|
||||
/// The same decision applies to all declarations in the library,
|
||||
/// so the value only needs to be computed once.
|
||||
bool? isExempt;
|
||||
|
||||
/// Whether the [cls] declaration can ignore (some) class modifiers.
|
||||
///
|
||||
/// Checks whether the [cls] can ignore modifiers
|
||||
/// from the [supertypeDeclaration].
|
||||
/// This is only possible if the supertype declaration comes
|
||||
/// from a platform library (`dart:` URI scheme),
|
||||
/// and then only if the library is another platform library which is
|
||||
/// exempt from restrictions on extending otherwise sealed platform types,
|
||||
/// or if the library is a pre-class-modifiers-feature language version
|
||||
/// library.
|
||||
bool mayIgnoreClassModifiers(ClassBuilder supertypeDeclaration) {
|
||||
// Only use this to ignore `final`, `base`, and `interface`.
|
||||
// Nobody can ignore `abstract`, `sealed` or `mixin`.
|
||||
|
||||
// We already know the library cannot ignore modifiers.
|
||||
if (isExempt == false) return false;
|
||||
|
||||
// Exception only applies to platform libraries.
|
||||
final LibraryBuilder superLibrary = supertypeDeclaration.libraryBuilder;
|
||||
if (!superLibrary.importUri.isScheme("dart")) return false;
|
||||
|
||||
// Remaining tests depend on the source library only,
|
||||
// and the result can be cached.
|
||||
if (isExempt == true) return true;
|
||||
|
||||
final LibraryBuilder subLibrary = cls.libraryBuilder;
|
||||
|
||||
// Some platform libraries may implement types like `int`,
|
||||
// even if they are final.
|
||||
if (subLibrary.mayImplementRestrictedTypes) {
|
||||
isExempt = true;
|
||||
return true;
|
||||
}
|
||||
// "Legacy" libraries may ignore `final`, `base` and `interface`
|
||||
// from platform libraries. (But still cannot implement `int`.)
|
||||
if (subLibrary.library.languageVersion <
|
||||
ExperimentalFlag.classModifiers.experimentEnabledVersion) {
|
||||
isExempt = true;
|
||||
return true;
|
||||
}
|
||||
isExempt = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
TypeDeclarationBuilder? unaliasDeclaration(TypeBuilder typeBuilder) {
|
||||
TypeDeclarationBuilder? typeDeclarationBuilder = typeBuilder.declaration;
|
||||
if (typeDeclarationBuilder is TypeAliasBuilder) {
|
||||
|
@ -2192,7 +2242,7 @@ severity: $severity
|
|||
classToBaseOrFinalSuperClass[superclass];
|
||||
final bool hasCachedBaseOrFinalSuperClass =
|
||||
cachedBaseOrFinalSuperClass != null;
|
||||
ClassBuilder? baseOrFinalSuperClass;
|
||||
ClassBuilder baseOrFinalSuperClass;
|
||||
if (!superclass.cls.isAnonymousMixin &&
|
||||
(superclass.isBase || superclass.isFinal)) {
|
||||
// Prefer the direct base or final superclass
|
||||
|
@ -2210,7 +2260,8 @@ severity: $severity
|
|||
if (!cls.isBase &&
|
||||
!cls.isFinal &&
|
||||
!cls.isSealed &&
|
||||
!cls.cls.isAnonymousMixin) {
|
||||
!cls.cls.isAnonymousMixin &&
|
||||
!mayIgnoreClassModifiers(baseOrFinalSuperClass)) {
|
||||
cls.addProblem(
|
||||
templateSubtypeOfBaseOrFinalIsNotBaseFinalOrSealed.withArguments(
|
||||
cls.fullNameForErrors,
|
||||
|
@ -2232,7 +2283,8 @@ severity: $severity
|
|||
checkForBaseFinalRestriction(supertypeDeclaration);
|
||||
|
||||
if (cls.libraryBuilder.origin !=
|
||||
supertypeDeclaration.libraryBuilder.origin) {
|
||||
supertypeDeclaration.libraryBuilder.origin &&
|
||||
!mayIgnoreClassModifiers(supertypeDeclaration)) {
|
||||
if (supertypeDeclaration.isInterface && !cls.isMixinDeclaration) {
|
||||
cls.addProblem(
|
||||
templateInterfaceClassExtendedOutsideOfLibrary
|
||||
|
@ -2290,13 +2342,15 @@ severity: $severity
|
|||
|
||||
if (cls.libraryBuilder.origin !=
|
||||
mixedInTypeDeclaration.libraryBuilder.origin) {
|
||||
if (mixedInTypeDeclaration.isInterface) {
|
||||
if (mixedInTypeDeclaration.isInterface &&
|
||||
!mayIgnoreClassModifiers(mixedInTypeDeclaration)) {
|
||||
cls.addProblem(
|
||||
templateInterfaceMixinMixedInOutsideOfLibrary
|
||||
.withArguments(mixedInTypeDeclaration.fullNameForErrors),
|
||||
mixedInTypeBuilder.charOffset ?? TreeNode.noOffset,
|
||||
noLength);
|
||||
} else if (mixedInTypeDeclaration.isFinal) {
|
||||
} else if (mixedInTypeDeclaration.isFinal &&
|
||||
!mayIgnoreClassModifiers(mixedInTypeDeclaration)) {
|
||||
cls.addProblem(
|
||||
templateFinalMixinMixedInOutsideOfLibrary
|
||||
.withArguments(mixedInTypeDeclaration.fullNameForErrors),
|
||||
|
@ -2331,7 +2385,8 @@ severity: $severity
|
|||
checkForBaseFinalRestriction(interfaceDeclaration);
|
||||
|
||||
if (cls.libraryBuilder.origin !=
|
||||
interfaceDeclaration.libraryBuilder.origin) {
|
||||
interfaceDeclaration.libraryBuilder.origin &&
|
||||
!mayIgnoreClassModifiers(interfaceDeclaration)) {
|
||||
// Report an error for a class implementing a base class outside
|
||||
// of its library.
|
||||
if (interfaceDeclaration.isBase && !cls.cls.isAnonymousMixin) {
|
||||
|
|
|
@ -2602,6 +2602,7 @@ restored
|
|||
restores
|
||||
restrict
|
||||
restricted
|
||||
restrictions
|
||||
restrictive
|
||||
result
|
||||
resulted
|
||||
|
|
|
@ -38,8 +38,8 @@ library /*isNonNullableByDefault*/;
|
|||
// pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented.
|
||||
// abstract class C2 with RR {} // Error.
|
||||
// ^
|
||||
// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias.
|
||||
// abstract class Record {}
|
||||
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
|
||||
// abstract final class Record {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
|
|
|
@ -38,8 +38,8 @@ library /*isNonNullableByDefault*/;
|
|||
// pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented.
|
||||
// abstract class C2 with RR {} // Error.
|
||||
// ^
|
||||
// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias.
|
||||
// abstract class Record {}
|
||||
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
|
||||
// abstract final class Record {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
|
|
|
@ -38,8 +38,8 @@ library /*isNonNullableByDefault*/;
|
|||
// pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented.
|
||||
// abstract class C2 with RR {} // Error.
|
||||
// ^
|
||||
// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias.
|
||||
// abstract class Record {}
|
||||
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
|
||||
// abstract final class Record {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
|
|
|
@ -38,8 +38,8 @@ library /*isNonNullableByDefault*/;
|
|||
// pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented.
|
||||
// abstract class C2 with RR {} // Error.
|
||||
// ^
|
||||
// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias.
|
||||
// abstract class Record {}
|
||||
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
|
||||
// abstract final class Record {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
|
|
|
@ -38,8 +38,8 @@ library /*isNonNullableByDefault*/;
|
|||
// pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented.
|
||||
// abstract class C2 with RR {} // Error.
|
||||
// ^
|
||||
// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias.
|
||||
// abstract class Record {}
|
||||
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
|
||||
// abstract final class Record {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
|
|
|
@ -38,8 +38,8 @@ library /*isNonNullableByDefault*/;
|
|||
// pkg/front_end/testcases/records/type_record_as_supertype.dart:22:16: Error: 'RR' is restricted and can't be extended or implemented.
|
||||
// abstract class C2 with RR {} // Error.
|
||||
// ^
|
||||
// sdk/lib/core/record.dart:11:16: Context: This is the type denoted by the type alias.
|
||||
// abstract class Record {}
|
||||
// sdk/lib/core/record.dart:11:22: Context: This is the type denoted by the type alias.
|
||||
// abstract final class Record {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
|
|
|
@ -182,7 +182,7 @@ ISOLATE_UNIT_TEST_CASE(JSON_JSONStream_DartObject) {
|
|||
"Class\",\"fixedId\":true,\"id\":\"\",\"name\":\"Null\",\"location\":{"
|
||||
"\"type\":\"SourceLocation\",\"script\":{\"type\":\"@Script\","
|
||||
"\"fixedId\":true,\"id\":\"\",\"uri\":\"dart:core\\/null.dart\",\"_"
|
||||
"kind\":\"kernel\"},\"tokenPos\":925,\"endTokenPos\":1165,\"line\":23,"
|
||||
"kind\":\"kernel\"},\"tokenPos\":925,\"endTokenPos\":1171,\"line\":23,"
|
||||
"\"column\":1},\"library\":{"
|
||||
"\"type\":\"@Library\",\"fixedId\":true,\"id\":\"\",\"name\":\"dart."
|
||||
"core\",\"uri\":\"dart:core\"}},\"kind\":\"Null\",\"fixedId\":true,"
|
||||
|
@ -191,7 +191,7 @@ ISOLATE_UNIT_TEST_CASE(JSON_JSONStream_DartObject) {
|
|||
"\"fixedId\":true,\"id\":\"\",\"name\":\"Null\",\"location\":{\"type\":"
|
||||
"\"SourceLocation\",\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
|
||||
"\"id\":\"\",\"uri\":\"dart:core\\/null.dart\",\"_kind\":\"kernel\"},"
|
||||
"\"tokenPos\":925,\"endTokenPos\":1165,\"line\":23,\"column\":1},"
|
||||
"\"tokenPos\":925,\"endTokenPos\":1171,\"line\":23,\"column\":1},"
|
||||
"\"library\":{\"type\":\"@"
|
||||
"Library\",\"fixedId\":true,\"id\":\"\",\"name\":\"dart.core\",\"uri\":"
|
||||
"\"dart:core\"}},\"kind\":\"Null\",\"fixedId\":true,\"id\":\"\","
|
||||
|
|
|
@ -289,7 +289,7 @@ class _HttpProfileData {
|
|||
int _nextServiceId = 1;
|
||||
|
||||
// TODO(ajohnsen): Use other way of getting a unique id.
|
||||
abstract class _ServiceObject {
|
||||
mixin _ServiceObject {
|
||||
int __serviceId = 0;
|
||||
int get _serviceId {
|
||||
if (__serviceId == 0) __serviceId = _nextServiceId++;
|
||||
|
@ -3030,7 +3030,7 @@ class _HttpClient implements HttpClient {
|
|||
Platform.environment;
|
||||
}
|
||||
|
||||
class _HttpConnection extends LinkedListEntry<_HttpConnection>
|
||||
final class _HttpConnection extends LinkedListEntry<_HttpConnection>
|
||||
with _ServiceObject {
|
||||
static const _ACTIVE = 0;
|
||||
static const _IDLE = 1;
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
"version": 1,
|
||||
"experimentSets": {
|
||||
"sdkExperiments": [
|
||||
"records"
|
||||
"records",
|
||||
"class-modifiers",
|
||||
"sealed-class"
|
||||
],
|
||||
"nullSafety": [
|
||||
"non-nullable"
|
||||
|
|
|
@ -194,7 +194,7 @@ class Float64x2 {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableByteBufferView.
|
||||
class _UnmodifiableByteBufferView
|
||||
final class _UnmodifiableByteBufferView
|
||||
implements ByteBuffer, UnmodifiableByteBufferView {
|
||||
final ByteBuffer _data;
|
||||
|
||||
|
@ -258,7 +258,8 @@ class _UnmodifiableByteBufferView
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableByteDataView.
|
||||
class _UnmodifiableByteDataView implements ByteData, UnmodifiableByteDataView {
|
||||
final class _UnmodifiableByteDataView
|
||||
implements ByteData, UnmodifiableByteDataView {
|
||||
final ByteData _data;
|
||||
|
||||
_UnmodifiableByteDataView(ByteData data) : _data = data;
|
||||
|
@ -333,8 +334,7 @@ class _UnmodifiableByteDataView implements ByteData, UnmodifiableByteDataView {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _UnmodifiableListMixin<N, L extends List<N>,
|
||||
TD extends TypedData> {
|
||||
mixin _UnmodifiableListMixin<N, L extends List<N>, TD extends TypedData> {
|
||||
L get _list;
|
||||
TD get _data => (_list as TD);
|
||||
|
||||
|
@ -366,7 +366,7 @@ abstract class _UnmodifiableListMixin<N, L extends List<N>,
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint8ListView.
|
||||
class _UnmodifiableUint8ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint8ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint8List, Uint8List>
|
||||
implements UnmodifiableUint8ListView {
|
||||
final Uint8List _list;
|
||||
|
@ -379,7 +379,7 @@ class _UnmodifiableUint8ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt8ListView.
|
||||
class _UnmodifiableInt8ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt8ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int8List, Int8List>
|
||||
implements UnmodifiableInt8ListView {
|
||||
final Int8List _list;
|
||||
|
@ -392,7 +392,7 @@ class _UnmodifiableInt8ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint8ClampedListView.
|
||||
class _UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint8ClampedList, Uint8ClampedList>
|
||||
implements UnmodifiableUint8ClampedListView {
|
||||
final Uint8ClampedList _list;
|
||||
|
@ -405,7 +405,7 @@ class _UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint16ListView.
|
||||
class _UnmodifiableUint16ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint16ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint16List, Uint16List>
|
||||
implements UnmodifiableUint16ListView {
|
||||
final Uint16List _list;
|
||||
|
@ -418,7 +418,7 @@ class _UnmodifiableUint16ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt16ListView.
|
||||
class _UnmodifiableInt16ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt16ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int16List, Int16List>
|
||||
implements UnmodifiableInt16ListView {
|
||||
final Int16List _list;
|
||||
|
@ -431,7 +431,7 @@ class _UnmodifiableInt16ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint32ListView.
|
||||
class _UnmodifiableUint32ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint32ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint32List, Uint32List>
|
||||
implements UnmodifiableUint32ListView {
|
||||
final Uint32List _list;
|
||||
|
@ -444,7 +444,7 @@ class _UnmodifiableUint32ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt32ListView.
|
||||
class _UnmodifiableInt32ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt32ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int32List, Int32List>
|
||||
implements UnmodifiableInt32ListView {
|
||||
final Int32List _list;
|
||||
|
@ -457,7 +457,7 @@ class _UnmodifiableInt32ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint64ListView.
|
||||
class _UnmodifiableUint64ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint64ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint64List, Uint64List>
|
||||
implements UnmodifiableUint64ListView {
|
||||
final Uint64List _list;
|
||||
|
@ -470,7 +470,7 @@ class _UnmodifiableUint64ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt64ListView.
|
||||
class _UnmodifiableInt64ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt64ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int64List, Int64List>
|
||||
implements UnmodifiableInt64ListView {
|
||||
final Int64List _list;
|
||||
|
@ -483,7 +483,7 @@ class _UnmodifiableInt64ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt32x4ListView.
|
||||
class _UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
|
||||
final class _UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
|
||||
with _UnmodifiableListMixin<Int32x4, Int32x4List, Int32x4List>
|
||||
implements UnmodifiableInt32x4ListView {
|
||||
final Int32x4List _list;
|
||||
|
@ -496,7 +496,8 @@ class _UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat32x4ListView.
|
||||
class _UnmodifiableFloat32x4ListView extends UnmodifiableListBase<Float32x4>
|
||||
final class _UnmodifiableFloat32x4ListView
|
||||
extends UnmodifiableListBase<Float32x4>
|
||||
with _UnmodifiableListMixin<Float32x4, Float32x4List, Float32x4List>
|
||||
implements UnmodifiableFloat32x4ListView {
|
||||
final Float32x4List _list;
|
||||
|
@ -509,7 +510,8 @@ class _UnmodifiableFloat32x4ListView extends UnmodifiableListBase<Float32x4>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat64x2ListView.
|
||||
class _UnmodifiableFloat64x2ListView extends UnmodifiableListBase<Float64x2>
|
||||
final class _UnmodifiableFloat64x2ListView
|
||||
extends UnmodifiableListBase<Float64x2>
|
||||
with _UnmodifiableListMixin<Float64x2, Float64x2List, Float64x2List>
|
||||
implements UnmodifiableFloat64x2ListView {
|
||||
final Float64x2List _list;
|
||||
|
@ -522,7 +524,7 @@ class _UnmodifiableFloat64x2ListView extends UnmodifiableListBase<Float64x2>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat32ListView.
|
||||
class _UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
|
||||
final class _UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
|
||||
with _UnmodifiableListMixin<double, Float32List, Float32List>
|
||||
implements UnmodifiableFloat32ListView {
|
||||
final Float32List _list;
|
||||
|
@ -535,7 +537,7 @@ class _UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat64ListView.
|
||||
class _UnmodifiableFloat64ListView extends UnmodifiableListBase<double>
|
||||
final class _UnmodifiableFloat64ListView extends UnmodifiableListBase<double>
|
||||
with _UnmodifiableListMixin<double, Float64List, Float64List>
|
||||
implements UnmodifiableFloat64ListView {
|
||||
final Float64List _list;
|
||||
|
|
|
@ -2277,7 +2277,7 @@ class Shape {
|
|||
}
|
||||
|
||||
/// Internal base class for all concrete records.
|
||||
class _RecordImpl implements Record {
|
||||
final class _RecordImpl implements Record {
|
||||
Shape shape;
|
||||
List values;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ abstract class Interceptor {
|
|||
* The interceptor class for [bool].
|
||||
*/
|
||||
@JsPeerInterface(name: 'Boolean')
|
||||
class JSBool extends Interceptor implements bool {
|
||||
final class JSBool extends Interceptor implements bool {
|
||||
const JSBool();
|
||||
|
||||
// Note: if you change this, also change the function [S].
|
||||
|
|
|
@ -6,17 +6,17 @@ part of dart._interceptors;
|
|||
|
||||
/// Only used as an interceptor by dart:_rti library for number values that look
|
||||
/// like an integer.
|
||||
class JSInt extends JSNumber implements int {}
|
||||
final class JSInt extends JSNumber implements int {}
|
||||
|
||||
/// Only used as an interceptor by dart:_rti library for number values that look
|
||||
/// like a double.
|
||||
class JSNumNotInt extends JSNumber implements double {}
|
||||
final class JSNumNotInt extends JSNumber implements double {}
|
||||
|
||||
/// The implementation of Dart's int & double methods.
|
||||
///
|
||||
/// These are made available as extension methods on `Number` in JS.
|
||||
@JsPeerInterface(name: 'Number')
|
||||
class JSNumber extends Interceptor implements double {
|
||||
final class JSNumber extends Interceptor implements double {
|
||||
const JSNumber();
|
||||
|
||||
@notNull
|
||||
|
|
|
@ -11,7 +11,8 @@ part of dart._interceptors;
|
|||
* argument added to each member.
|
||||
*/
|
||||
@JsPeerInterface(name: 'String')
|
||||
class JSString extends Interceptor implements String, JSIndexable<String> {
|
||||
final class JSString extends Interceptor
|
||||
implements String, JSIndexable<String> {
|
||||
const JSString();
|
||||
|
||||
@notNull
|
||||
|
@ -206,10 +207,8 @@ class JSString extends Interceptor implements String, JSIndexable<String> {
|
|||
case 0x0D:
|
||||
case 0x20:
|
||||
case 0x85:
|
||||
case 0xA0:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
case 0xA0: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
switch (codeUnit) {
|
||||
|
@ -230,10 +229,8 @@ class JSString extends Interceptor implements String, JSIndexable<String> {
|
|||
case 0x202F:
|
||||
case 0x205F:
|
||||
case 0x3000:
|
||||
case 0xFEFF:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
case 0xFEFF: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import 'dart:math' as Math;
|
|||
import 'dart:typed_data';
|
||||
|
||||
@Native('ArrayBuffer')
|
||||
class NativeByteBuffer extends JavaScriptObject implements ByteBuffer {
|
||||
final class NativeByteBuffer extends JavaScriptObject implements ByteBuffer {
|
||||
@JSName('byteLength')
|
||||
external int get lengthInBytes;
|
||||
|
||||
|
@ -100,7 +100,7 @@ class NativeByteBuffer extends JavaScriptObject implements ByteBuffer {
|
|||
/// A fixed-length list of Float32x4 numbers that is viewable as a
|
||||
/// [TypedData]. For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
class NativeFloat32x4List extends Object
|
||||
final class NativeFloat32x4List extends Object
|
||||
with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
|
||||
implements Float32x4List {
|
||||
final Float32List _storage;
|
||||
|
@ -172,7 +172,7 @@ class NativeFloat32x4List extends Object
|
|||
/// A fixed-length list of Int32x4 numbers that is viewable as a
|
||||
/// [TypedData]. For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
class NativeInt32x4List extends Object
|
||||
final class NativeInt32x4List extends Object
|
||||
with ListMixin<Int32x4>, FixedLengthListMixin<Int32x4>
|
||||
implements Int32x4List {
|
||||
final Int32List _storage;
|
||||
|
@ -244,7 +244,7 @@ class NativeInt32x4List extends Object
|
|||
/// A fixed-length list of Float64x2 numbers that is viewable as a
|
||||
/// [TypedData]. For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
class NativeFloat64x2List extends Object
|
||||
final class NativeFloat64x2List extends Object
|
||||
with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
|
||||
implements Float64x2List {
|
||||
final Float64List _storage;
|
||||
|
@ -308,7 +308,7 @@ class NativeFloat64x2List extends Object
|
|||
}
|
||||
|
||||
@Native('ArrayBufferView')
|
||||
class NativeTypedData extends JavaScriptObject implements TypedData {
|
||||
final class NativeTypedData extends JavaScriptObject implements TypedData {
|
||||
/// Returns the byte buffer associated with this object.
|
||||
@Creates('NativeByteBuffer')
|
||||
@Returns('NativeByteBuffer')
|
||||
|
@ -380,7 +380,7 @@ List _ensureNativeList(List list) {
|
|||
}
|
||||
|
||||
@Native('DataView')
|
||||
class NativeByteData extends NativeTypedData implements ByteData {
|
||||
final class NativeByteData extends NativeTypedData implements ByteData {
|
||||
/// Creates a [ByteData] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
factory NativeByteData(int length) => _create1(_checkLength(length));
|
||||
|
@ -665,7 +665,7 @@ class NativeByteData extends NativeTypedData implements ByteData {
|
|||
JS('NativeByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
abstract class NativeTypedArray<E> extends NativeTypedData
|
||||
abstract final class NativeTypedArray<E> extends NativeTypedData
|
||||
implements JavaScriptIndexingBehavior<E> {
|
||||
int get length;
|
||||
|
||||
|
@ -692,7 +692,7 @@ abstract class NativeTypedArray<E> extends NativeTypedData
|
|||
}
|
||||
}
|
||||
|
||||
abstract class NativeTypedArrayOfDouble extends NativeTypedArray<double>
|
||||
abstract final class NativeTypedArrayOfDouble extends NativeTypedArray<double>
|
||||
with ListMixin<double>, FixedLengthListMixin<double> {
|
||||
int get length => JS<int>('!', '#.length', this);
|
||||
|
||||
|
@ -716,7 +716,7 @@ abstract class NativeTypedArrayOfDouble extends NativeTypedArray<double>
|
|||
}
|
||||
}
|
||||
|
||||
abstract class NativeTypedArrayOfInt extends NativeTypedArray<int>
|
||||
abstract final class NativeTypedArrayOfInt extends NativeTypedArray<int>
|
||||
with ListMixin<int>, FixedLengthListMixin<int>
|
||||
implements List<int> {
|
||||
int get length => JS<int>('!', '#.length', this);
|
||||
|
@ -740,7 +740,7 @@ abstract class NativeTypedArrayOfInt extends NativeTypedArray<int>
|
|||
}
|
||||
|
||||
@Native('Float32Array')
|
||||
class NativeFloat32List extends NativeTypedArrayOfDouble
|
||||
final class NativeFloat32List extends NativeTypedArrayOfDouble
|
||||
implements Float32List {
|
||||
factory NativeFloat32List(int length) => _create1(_checkLength(length));
|
||||
|
||||
|
@ -772,7 +772,7 @@ class NativeFloat32List extends NativeTypedArrayOfDouble
|
|||
}
|
||||
|
||||
@Native('Float64Array')
|
||||
class NativeFloat64List extends NativeTypedArrayOfDouble
|
||||
final class NativeFloat64List extends NativeTypedArrayOfDouble
|
||||
implements Float64List {
|
||||
factory NativeFloat64List(int length) => _create1(_checkLength(length));
|
||||
|
||||
|
@ -803,7 +803,7 @@ class NativeFloat64List extends NativeTypedArrayOfDouble
|
|||
}
|
||||
|
||||
@Native('Int16Array')
|
||||
class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
|
||||
final class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
|
||||
factory NativeInt16List(int length) => _create1(_checkLength(length));
|
||||
|
||||
factory NativeInt16List.fromList(List<int> elements) =>
|
||||
|
@ -838,7 +838,7 @@ class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
|
|||
}
|
||||
|
||||
@Native('Int32Array')
|
||||
class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
|
||||
final class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
|
||||
factory NativeInt32List(int length) => _create1(_checkLength(length));
|
||||
|
||||
factory NativeInt32List.fromList(List<int> elements) =>
|
||||
|
@ -874,7 +874,7 @@ class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
|
|||
}
|
||||
|
||||
@Native('Int8Array')
|
||||
class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
|
||||
final class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
|
||||
factory NativeInt8List(int length) => _create1(_checkLength(length));
|
||||
|
||||
factory NativeInt8List.fromList(List<int> elements) =>
|
||||
|
@ -912,7 +912,8 @@ class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
|
|||
}
|
||||
|
||||
@Native('Uint16Array')
|
||||
class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
|
||||
final class NativeUint16List extends NativeTypedArrayOfInt
|
||||
implements Uint16List {
|
||||
factory NativeUint16List(int length) => _create1(_checkLength(length));
|
||||
|
||||
factory NativeUint16List.fromList(List<int> list) =>
|
||||
|
@ -948,7 +949,8 @@ class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
|
|||
}
|
||||
|
||||
@Native('Uint32Array')
|
||||
class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
|
||||
final class NativeUint32List extends NativeTypedArrayOfInt
|
||||
implements Uint32List {
|
||||
factory NativeUint32List(int length) => _create1(_checkLength(length));
|
||||
|
||||
factory NativeUint32List.fromList(List<int> elements) =>
|
||||
|
@ -984,7 +986,7 @@ class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
|
|||
}
|
||||
|
||||
@Native('Uint8ClampedArray,CanvasPixelArray')
|
||||
class NativeUint8ClampedList extends NativeTypedArrayOfInt
|
||||
final class NativeUint8ClampedList extends NativeTypedArrayOfInt
|
||||
implements Uint8ClampedList {
|
||||
factory NativeUint8ClampedList(int length) => _create1(_checkLength(length));
|
||||
|
||||
|
@ -1035,7 +1037,7 @@ class NativeUint8ClampedList extends NativeTypedArrayOfInt
|
|||
// the potential for Uint8ClampedArray to 'accidentally' pick up the
|
||||
// dispatch record for Uint8List.
|
||||
@Native('Uint8Array,!nonleaf')
|
||||
class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
|
||||
final class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
|
||||
factory NativeUint8List(int length) => _create1(_checkLength(length));
|
||||
|
||||
factory NativeUint8List.fromList(List<int> elements) =>
|
||||
|
@ -1078,7 +1080,7 @@ class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
|
|||
/// Implementation of Dart Float32x4 immutable value type and operations.
|
||||
/// Float32x4 stores 4 32-bit floating point values in "lanes".
|
||||
/// The lanes are "x", "y", "z", and "w" respectively.
|
||||
class NativeFloat32x4 implements Float32x4 {
|
||||
final class NativeFloat32x4 implements Float32x4 {
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
|
@ -1416,7 +1418,7 @@ class NativeFloat32x4 implements Float32x4 {
|
|||
/// Interface of Dart Int32x4 and operations.
|
||||
/// Int32x4 stores 4 32-bit bit-masks in "lanes".
|
||||
/// The lanes are "x", "y", "z", and "w" respectively.
|
||||
class NativeInt32x4 implements Int32x4 {
|
||||
final class NativeInt32x4 implements Int32x4 {
|
||||
final int x;
|
||||
final int y;
|
||||
final int z;
|
||||
|
@ -1672,7 +1674,7 @@ class NativeInt32x4 implements Int32x4 {
|
|||
}
|
||||
}
|
||||
|
||||
class NativeFloat64x2 implements Float64x2 {
|
||||
final class NativeFloat64x2 implements Float64x2 {
|
||||
final double x;
|
||||
final double y;
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
part of _js_helper;
|
||||
|
||||
/// Support class for generic function type instantiation (binding of types).
|
||||
/// Support final class for generic function type instantiation (binding of types).
|
||||
///
|
||||
abstract class Instantiation extends Closure {
|
||||
abstract final class Instantiation extends Closure {
|
||||
final Closure _genericClosure;
|
||||
Instantiation(this._genericClosure) {
|
||||
// TODO(sra): Copy some metadata used by Function.apply.
|
||||
|
@ -42,98 +42,100 @@ abstract class Instantiation extends Closure {
|
|||
|
||||
/// Instantiation classes are subclasses of [Instantiation]. For now we have a
|
||||
/// fixed number of subclasses. Later we might generate the classes on demand.
|
||||
class Instantiation1<T1> extends Instantiation {
|
||||
final class Instantiation1<T1> extends Instantiation {
|
||||
Instantiation1(Closure f) : super(f);
|
||||
List get _types => [T1];
|
||||
}
|
||||
|
||||
class Instantiation2<T1, T2> extends Instantiation {
|
||||
final class Instantiation2<T1, T2> extends Instantiation {
|
||||
Instantiation2(Closure f) : super(f);
|
||||
List get _types => [T1, T2];
|
||||
}
|
||||
|
||||
class Instantiation3<T1, T2, T3> extends Instantiation {
|
||||
final class Instantiation3<T1, T2, T3> extends Instantiation {
|
||||
Instantiation3(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3];
|
||||
}
|
||||
|
||||
class Instantiation4<T1, T2, T3, T4> extends Instantiation {
|
||||
final class Instantiation4<T1, T2, T3, T4> extends Instantiation {
|
||||
Instantiation4(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4];
|
||||
}
|
||||
|
||||
class Instantiation5<T1, T2, T3, T4, T5> extends Instantiation {
|
||||
final class Instantiation5<T1, T2, T3, T4, T5> extends Instantiation {
|
||||
Instantiation5(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5];
|
||||
}
|
||||
|
||||
class Instantiation6<T1, T2, T3, T4, T5, T6> extends Instantiation {
|
||||
final class Instantiation6<T1, T2, T3, T4, T5, T6> extends Instantiation {
|
||||
Instantiation6(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6];
|
||||
}
|
||||
|
||||
class Instantiation7<T1, T2, T3, T4, T5, T6, T7> extends Instantiation {
|
||||
final class Instantiation7<T1, T2, T3, T4, T5, T6, T7> extends Instantiation {
|
||||
Instantiation7(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7];
|
||||
}
|
||||
|
||||
class Instantiation8<T1, T2, T3, T4, T5, T6, T7, T8> extends Instantiation {
|
||||
final class Instantiation8<T1, T2, T3, T4, T5, T6, T7, T8>
|
||||
extends Instantiation {
|
||||
Instantiation8(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8];
|
||||
}
|
||||
|
||||
class Instantiation9<T1, T2, T3, T4, T5, T6, T7, T8, T9> extends Instantiation {
|
||||
final class Instantiation9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
|
||||
extends Instantiation {
|
||||
Instantiation9(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9];
|
||||
}
|
||||
|
||||
class Instantiation10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
final class Instantiation10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
extends Instantiation {
|
||||
Instantiation10(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10];
|
||||
}
|
||||
|
||||
class Instantiation11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
|
||||
final class Instantiation11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
|
||||
extends Instantiation {
|
||||
Instantiation11(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11];
|
||||
}
|
||||
|
||||
class Instantiation12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
|
||||
final class Instantiation12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
|
||||
extends Instantiation {
|
||||
Instantiation12(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12];
|
||||
}
|
||||
|
||||
class Instantiation13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
|
||||
extends Instantiation {
|
||||
final class Instantiation13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13> extends Instantiation {
|
||||
Instantiation13(Closure f) : super(f);
|
||||
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13];
|
||||
}
|
||||
|
||||
class Instantiation14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14> extends Instantiation {
|
||||
final class Instantiation14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14> extends Instantiation {
|
||||
Instantiation14(Closure f) : super(f);
|
||||
List get _types =>
|
||||
[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14];
|
||||
}
|
||||
|
||||
class Instantiation15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14, T15> extends Instantiation {
|
||||
final class Instantiation15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14, T15> extends Instantiation {
|
||||
Instantiation15(Closure f) : super(f);
|
||||
List get _types =>
|
||||
[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15];
|
||||
}
|
||||
|
||||
class Instantiation16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14, T15, T16> extends Instantiation {
|
||||
final class Instantiation16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14, T15, T16> extends Instantiation {
|
||||
Instantiation16(Closure f) : super(f);
|
||||
List get _types =>
|
||||
[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16];
|
||||
}
|
||||
|
||||
class Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14, T15, T16, T17> extends Instantiation {
|
||||
final class Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14, T15, T16, T17> extends Instantiation {
|
||||
Instantiation17(Closure f) : super(f);
|
||||
List get _types => [
|
||||
T1,
|
||||
|
@ -156,8 +158,8 @@ class Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
|||
];
|
||||
}
|
||||
|
||||
class Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14, T15, T16, T17, T18> extends Instantiation {
|
||||
final class Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14, T15, T16, T17, T18> extends Instantiation {
|
||||
Instantiation18(Closure f) : super(f);
|
||||
List get _types => [
|
||||
T1,
|
||||
|
@ -181,8 +183,8 @@ class Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
|||
];
|
||||
}
|
||||
|
||||
class Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14, T15, T16, T17, T18, T19> extends Instantiation {
|
||||
final class Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14, T15, T16, T17, T18, T19> extends Instantiation {
|
||||
Instantiation19(Closure f) : super(f);
|
||||
List get _types => [
|
||||
T1,
|
||||
|
@ -207,8 +209,8 @@ class Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
|||
];
|
||||
}
|
||||
|
||||
class Instantiation20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
|
||||
T14, T15, T16, T17, T18, T19, T20> extends Instantiation {
|
||||
final class Instantiation20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
|
||||
T13, T14, T15, T16, T17, T18, T19, T20> extends Instantiation {
|
||||
Instantiation20(Closure f) : super(f);
|
||||
List get _types => [
|
||||
T1,
|
||||
|
|
|
@ -342,7 +342,7 @@ abstract class Interceptor {
|
|||
}
|
||||
|
||||
/// The interceptor class for [bool].
|
||||
class JSBool extends Interceptor implements bool {
|
||||
final class JSBool extends Interceptor implements bool {
|
||||
const JSBool();
|
||||
|
||||
// Note: if you change this, also change the function [S].
|
||||
|
@ -366,7 +366,7 @@ class JSBool extends Interceptor implements bool {
|
|||
/// This class defines implementations for *all* methods on [Object] since
|
||||
/// the methods on Object assume the receiver is non-null. This means that
|
||||
/// JSNull will always be in the interceptor set for methods defined on Object.
|
||||
class JSNull extends Interceptor implements Null {
|
||||
final class JSNull extends Interceptor implements Null {
|
||||
const JSNull();
|
||||
|
||||
external bool operator ==(Object other);
|
||||
|
@ -448,7 +448,8 @@ class UnknownJavaScriptObject extends LegacyJavaScriptObject {
|
|||
/// been converted to JavaScript functions.
|
||||
/// These interceptor methods are not always used as the JavaScript function
|
||||
/// object has also been mangled to support Dart function calling conventions.
|
||||
class JavaScriptFunction extends LegacyJavaScriptObject implements Function {
|
||||
final class JavaScriptFunction extends LegacyJavaScriptObject
|
||||
implements Function {
|
||||
const JavaScriptFunction();
|
||||
|
||||
String toString() {
|
||||
|
|
|
@ -50,6 +50,7 @@ import 'dart:_interceptors';
|
|||
import 'dart:_internal' as _symbol_dev;
|
||||
import 'dart:_internal'
|
||||
show
|
||||
checkNotNullable,
|
||||
EfficientLengthIterable,
|
||||
MappedIterable,
|
||||
IterableElementError,
|
||||
|
@ -384,6 +385,35 @@ class Primitives {
|
|||
return result;
|
||||
}
|
||||
|
||||
static bool? parseBool(String source, bool caseSensitive) {
|
||||
checkNotNullable(source, "source");
|
||||
checkNotNullable(caseSensitive, "caseSensitive");
|
||||
// The caseSensitive defaults to true.
|
||||
if (caseSensitive) {
|
||||
return source == "true"
|
||||
? true
|
||||
: source == "false"
|
||||
? false
|
||||
: null;
|
||||
}
|
||||
// Compare case-sensitive when caseSensitive is false.
|
||||
return _compareIgnoreCase(source, "true")
|
||||
? true
|
||||
: _compareIgnoreCase(source, "false")
|
||||
? false
|
||||
: null;
|
||||
}
|
||||
|
||||
static bool _compareIgnoreCase(String input, String lowerCaseTarget) {
|
||||
if (input.length != lowerCaseTarget.length) return false;
|
||||
for (var i = 0; i < input.length; i++) {
|
||||
if (input.codeUnitAt(i) | 0x20 != lowerCaseTarget.codeUnitAt(i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// [: r"$".codeUnitAt(0) :]
|
||||
static const int DOLLAR_CHAR_VALUE = 36;
|
||||
|
||||
|
@ -1848,16 +1878,11 @@ int getLength(var array) {
|
|||
invokeClosure(Function closure, int numberOfArguments, var arg1, var arg2,
|
||||
var arg3, var arg4) {
|
||||
switch (numberOfArguments) {
|
||||
case 0:
|
||||
return closure();
|
||||
case 1:
|
||||
return closure(arg1);
|
||||
case 2:
|
||||
return closure(arg1, arg2);
|
||||
case 3:
|
||||
return closure(arg1, arg2, arg3);
|
||||
case 4:
|
||||
return closure(arg1, arg2, arg3, arg4);
|
||||
case 0: return closure();
|
||||
case 1: return closure(arg1);
|
||||
case 2: return closure(arg1, arg2);
|
||||
case 3: return closure(arg1, arg2, arg3);
|
||||
case 4: return closure(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
throw new Exception('Unsupported number of arguments for wrapped closure');
|
||||
}
|
||||
|
@ -1889,7 +1914,7 @@ convertDartClosureToJS(closure, int arity) {
|
|||
///
|
||||
/// All static, tear-off, function declaration and function expression closures
|
||||
/// extend this class.
|
||||
abstract class Closure implements Function {
|
||||
abstract final class Closure implements Function {
|
||||
/// Global counter to prevent reusing function code objects.
|
||||
///
|
||||
/// V8 will share the underlying function code objects when the same string is
|
||||
|
@ -2376,15 +2401,15 @@ closureFromTearOff(parameters) {
|
|||
}
|
||||
|
||||
/// Base class for closures with no arguments.
|
||||
abstract class Closure0Args extends Closure {}
|
||||
abstract final class Closure0Args extends Closure {}
|
||||
|
||||
/// Base class for closures with two positional arguments.
|
||||
abstract class Closure2Args extends Closure {}
|
||||
abstract final class Closure2Args extends Closure {}
|
||||
|
||||
/// Represents an implicit closure of a function.
|
||||
abstract class TearOffClosure extends Closure {}
|
||||
abstract final class TearOffClosure extends Closure {}
|
||||
|
||||
class StaticClosure extends TearOffClosure {
|
||||
final class StaticClosure extends TearOffClosure {
|
||||
String toString() {
|
||||
String? name =
|
||||
JS('String|Null', '#[#]', this, STATIC_FUNCTION_NAME_PROPERTY_NAME);
|
||||
|
@ -2398,7 +2423,7 @@ class StaticClosure extends TearOffClosure {
|
|||
///
|
||||
/// This is a base class that is extended to create a separate closure class for
|
||||
/// each instance method. The subclass is created at run time.
|
||||
class BoundClosure extends TearOffClosure {
|
||||
final class BoundClosure extends TearOffClosure {
|
||||
/// The Dart receiver.
|
||||
final _receiver;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ part of _interceptors;
|
|||
/// [tryComputeConstantInterceptor] to avoid most interceptor lookups on
|
||||
/// numbers.
|
||||
|
||||
class JSNumber extends Interceptor implements double {
|
||||
final class JSNumber extends Interceptor implements double {
|
||||
const JSNumber();
|
||||
|
||||
int compareTo(num b) {
|
||||
|
@ -486,7 +486,7 @@ class JSNumber extends Interceptor implements double {
|
|||
/// JavaScript all numbers are doubles, so while we want to treat `2.0` as an
|
||||
/// integer for some operations, its interceptor should answer `true` to `is
|
||||
/// double`.
|
||||
class JSInt extends JSNumber implements int {
|
||||
final class JSInt extends JSNumber implements int {
|
||||
const JSInt();
|
||||
|
||||
@override
|
||||
|
@ -689,13 +689,13 @@ class JSInt extends JSNumber implements int {
|
|||
}
|
||||
|
||||
/// Interceptor for JavaScript values that are not a subclass of [JSInt].
|
||||
class JSNumNotInt extends JSNumber implements double {
|
||||
final class JSNumNotInt extends JSNumber implements double {
|
||||
const JSNumNotInt();
|
||||
Type get runtimeType => double;
|
||||
}
|
||||
|
||||
class JSPositiveInt extends JSInt {}
|
||||
final class JSPositiveInt extends JSInt {}
|
||||
|
||||
class JSUInt32 extends JSPositiveInt {}
|
||||
final class JSUInt32 extends JSPositiveInt {}
|
||||
|
||||
class JSUInt31 extends JSUInt32 {}
|
||||
final class JSUInt31 extends JSUInt32 {}
|
||||
|
|
|
@ -8,7 +8,7 @@ part of _interceptors;
|
|||
/// class as an interceptor, and changes references to [:this:] to
|
||||
/// actually use the receiver of the method, which is generated as an extra
|
||||
/// argument added to each member.
|
||||
class JSString extends Interceptor implements String, JSIndexable {
|
||||
final class JSString extends Interceptor implements String, JSIndexable {
|
||||
const JSString();
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
|
@ -192,10 +192,8 @@ class JSString extends Interceptor implements String, JSIndexable {
|
|||
case 0x0D:
|
||||
case 0x20:
|
||||
case 0x85:
|
||||
case 0xA0:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
case 0xA0: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
switch (codeUnit) {
|
||||
|
@ -216,10 +214,8 @@ class JSString extends Interceptor implements String, JSIndexable {
|
|||
case 0x202F:
|
||||
case 0x205F:
|
||||
case 0x3000:
|
||||
case 0xFEFF:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
case 0xFEFF: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import 'dart:math' as Math;
|
|||
import 'dart:typed_data';
|
||||
|
||||
@Native('ArrayBuffer')
|
||||
class NativeByteBuffer extends JavaScriptObject implements ByteBuffer {
|
||||
final class NativeByteBuffer extends JavaScriptObject implements ByteBuffer {
|
||||
@JSName('byteLength')
|
||||
int get lengthInBytes native;
|
||||
|
||||
|
@ -102,7 +102,7 @@ class NativeByteBuffer extends JavaScriptObject implements ByteBuffer {
|
|||
/// A fixed-length list of Float32x4 numbers that is viewable as a
|
||||
/// [TypedData]. For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
class NativeFloat32x4List extends Object
|
||||
final class NativeFloat32x4List extends Object
|
||||
with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
|
||||
implements Float32x4List {
|
||||
final Float32List _storage;
|
||||
|
@ -174,7 +174,7 @@ class NativeFloat32x4List extends Object
|
|||
/// A fixed-length list of Int32x4 numbers that is viewable as a
|
||||
/// [TypedData]. For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
class NativeInt32x4List extends Object
|
||||
final class NativeInt32x4List extends Object
|
||||
with ListMixin<Int32x4>, FixedLengthListMixin<Int32x4>
|
||||
implements Int32x4List {
|
||||
final Int32List _storage;
|
||||
|
@ -246,7 +246,7 @@ class NativeInt32x4List extends Object
|
|||
/// A fixed-length list of Float64x2 numbers that is viewable as a
|
||||
/// [TypedData]. For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
class NativeFloat64x2List extends Object
|
||||
final class NativeFloat64x2List extends Object
|
||||
with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
|
||||
implements Float64x2List {
|
||||
final Float64List _storage;
|
||||
|
@ -310,7 +310,7 @@ class NativeFloat64x2List extends Object
|
|||
}
|
||||
|
||||
@Native('ArrayBufferView')
|
||||
class NativeTypedData extends JavaScriptObject implements TypedData {
|
||||
final class NativeTypedData extends JavaScriptObject implements TypedData {
|
||||
/// Returns the byte buffer associated with this object.
|
||||
@Creates('NativeByteBuffer')
|
||||
@Returns('NativeByteBuffer')
|
||||
|
@ -382,7 +382,7 @@ List _ensureNativeList(List list) {
|
|||
}
|
||||
|
||||
@Native('DataView')
|
||||
class NativeByteData extends NativeTypedData implements ByteData {
|
||||
final class NativeByteData extends NativeTypedData implements ByteData {
|
||||
/// Creates a [ByteData] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
factory NativeByteData(int length) => _create1(_checkLength(length));
|
||||
|
@ -667,7 +667,7 @@ class NativeByteData extends NativeTypedData implements ByteData {
|
|||
JS('NativeByteData', 'new DataView(#, #, #)', arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
abstract class NativeTypedArray<E> extends NativeTypedData
|
||||
abstract final class NativeTypedArray<E> extends NativeTypedData
|
||||
implements JavaScriptIndexingBehavior<E> {
|
||||
int get length => JS('JSUInt32', '#.length', this);
|
||||
|
||||
|
@ -694,7 +694,7 @@ abstract class NativeTypedArray<E> extends NativeTypedData
|
|||
}
|
||||
}
|
||||
|
||||
abstract class NativeTypedArrayOfDouble extends NativeTypedArray<double>
|
||||
abstract final class NativeTypedArrayOfDouble extends NativeTypedArray<double>
|
||||
with ListMixin<double>, FixedLengthListMixin<double> {
|
||||
double operator [](int index) {
|
||||
_checkValidIndex(index, this, this.length);
|
||||
|
@ -716,7 +716,7 @@ abstract class NativeTypedArrayOfDouble extends NativeTypedArray<double>
|
|||
}
|
||||
}
|
||||
|
||||
abstract class NativeTypedArrayOfInt extends NativeTypedArray<int>
|
||||
abstract final class NativeTypedArrayOfInt extends NativeTypedArray<int>
|
||||
with ListMixin<int>, FixedLengthListMixin<int>
|
||||
implements List<int> {
|
||||
// operator[]() is not here since different versions have different return
|
||||
|
@ -738,7 +738,7 @@ abstract class NativeTypedArrayOfInt extends NativeTypedArray<int>
|
|||
}
|
||||
|
||||
@Native('Float32Array')
|
||||
class NativeFloat32List extends NativeTypedArrayOfDouble
|
||||
final class NativeFloat32List extends NativeTypedArrayOfDouble
|
||||
implements Float32List {
|
||||
factory NativeFloat32List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
|
@ -774,7 +774,7 @@ class NativeFloat32List extends NativeTypedArrayOfDouble
|
|||
}
|
||||
|
||||
@Native('Float64Array')
|
||||
class NativeFloat64List extends NativeTypedArrayOfDouble
|
||||
final class NativeFloat64List extends NativeTypedArrayOfDouble
|
||||
implements Float64List {
|
||||
factory NativeFloat64List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
|
@ -810,7 +810,7 @@ class NativeFloat64List extends NativeTypedArrayOfDouble
|
|||
}
|
||||
|
||||
@Native('Int16Array')
|
||||
class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
|
||||
final class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
|
||||
factory NativeInt16List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
factory NativeInt16List.fromList(List<int> elements) =>
|
||||
|
@ -850,7 +850,7 @@ class NativeInt16List extends NativeTypedArrayOfInt implements Int16List {
|
|||
}
|
||||
|
||||
@Native('Int32Array')
|
||||
class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
|
||||
final class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
|
||||
factory NativeInt32List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
factory NativeInt32List.fromList(List<int> elements) =>
|
||||
|
@ -890,7 +890,7 @@ class NativeInt32List extends NativeTypedArrayOfInt implements Int32List {
|
|||
}
|
||||
|
||||
@Native('Int8Array')
|
||||
class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
|
||||
final class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
|
||||
factory NativeInt8List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
factory NativeInt8List.fromList(List<int> elements) =>
|
||||
|
@ -933,7 +933,8 @@ class NativeInt8List extends NativeTypedArrayOfInt implements Int8List {
|
|||
}
|
||||
|
||||
@Native('Uint16Array')
|
||||
class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
|
||||
final class NativeUint16List extends NativeTypedArrayOfInt
|
||||
implements Uint16List {
|
||||
factory NativeUint16List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
factory NativeUint16List.fromList(List<int> list) =>
|
||||
|
@ -973,7 +974,8 @@ class NativeUint16List extends NativeTypedArrayOfInt implements Uint16List {
|
|||
}
|
||||
|
||||
@Native('Uint32Array')
|
||||
class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
|
||||
final class NativeUint32List extends NativeTypedArrayOfInt
|
||||
implements Uint32List {
|
||||
factory NativeUint32List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
factory NativeUint32List.fromList(List<int> elements) =>
|
||||
|
@ -1013,7 +1015,7 @@ class NativeUint32List extends NativeTypedArrayOfInt implements Uint32List {
|
|||
}
|
||||
|
||||
@Native('Uint8ClampedArray,CanvasPixelArray')
|
||||
class NativeUint8ClampedList extends NativeTypedArrayOfInt
|
||||
final class NativeUint8ClampedList extends NativeTypedArrayOfInt
|
||||
implements Uint8ClampedList {
|
||||
factory NativeUint8ClampedList(int length) =>
|
||||
_createLength(_checkLength(length));
|
||||
|
@ -1069,7 +1071,7 @@ class NativeUint8ClampedList extends NativeTypedArrayOfInt
|
|||
// the potential for Uint8ClampedArray to 'accidentally' pick up the
|
||||
// dispatch record for Uint8List.
|
||||
@Native('Uint8Array,!nonleaf')
|
||||
class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
|
||||
final class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
|
||||
factory NativeUint8List(int length) => _createLength(_checkLength(length));
|
||||
|
||||
factory NativeUint8List.fromList(List<int> elements) =>
|
||||
|
@ -1116,7 +1118,7 @@ class NativeUint8List extends NativeTypedArrayOfInt implements Uint8List {
|
|||
/// Implementation of Dart Float32x4 immutable value type and operations.
|
||||
/// Float32x4 stores 4 32-bit floating point values in "lanes".
|
||||
/// The lanes are "x", "y", "z", and "w" respectively.
|
||||
class NativeFloat32x4 implements Float32x4 {
|
||||
final class NativeFloat32x4 implements Float32x4 {
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
|
@ -1452,7 +1454,7 @@ class NativeFloat32x4 implements Float32x4 {
|
|||
/// Interface of Dart Int32x4 and operations.
|
||||
/// Int32x4 stores 4 32-bit bit-masks in "lanes".
|
||||
/// The lanes are "x", "y", "z", and "w" respectively.
|
||||
class NativeInt32x4 implements Int32x4 {
|
||||
final class NativeInt32x4 implements Int32x4 {
|
||||
final int x;
|
||||
final int y;
|
||||
final int z;
|
||||
|
@ -1702,7 +1704,7 @@ class NativeInt32x4 implements Int32x4 {
|
|||
}
|
||||
}
|
||||
|
||||
class NativeFloat64x2 implements Float64x2 {
|
||||
final class NativeFloat64x2 implements Float64x2 {
|
||||
final double x;
|
||||
final double y;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
part of _js_helper;
|
||||
|
||||
/// Base class for all records.
|
||||
abstract class _Record implements Record {
|
||||
abstract final class _Record implements Record {
|
||||
const _Record();
|
||||
|
||||
int get _shapeTag => JS('JSUInt31', '#[#]', this,
|
||||
|
@ -89,7 +89,7 @@ abstract class _Record implements Record {
|
|||
}
|
||||
|
||||
/// The empty record.
|
||||
class _EmptyRecord extends _Record {
|
||||
final class _EmptyRecord extends _Record {
|
||||
const _EmptyRecord();
|
||||
|
||||
@override
|
||||
|
@ -107,7 +107,7 @@ class _EmptyRecord extends _Record {
|
|||
|
||||
/// Base class for all records with two fields.
|
||||
// TODO(49718): Generate this class.
|
||||
class _Record2 extends _Record {
|
||||
final class _Record2 extends _Record {
|
||||
final Object? _0;
|
||||
final Object? _1;
|
||||
|
||||
|
@ -134,7 +134,7 @@ class _Record2 extends _Record {
|
|||
int get hashCode => Object.hash(_shapeTag, _0, _1);
|
||||
}
|
||||
|
||||
class _Record1 extends _Record {
|
||||
final class _Record1 extends _Record {
|
||||
final Object? _0;
|
||||
|
||||
_Record1(this._0);
|
||||
|
@ -156,7 +156,7 @@ class _Record1 extends _Record {
|
|||
int get hashCode => Object.hash(_shapeTag, _0);
|
||||
}
|
||||
|
||||
class _Record3 extends _Record {
|
||||
final class _Record3 extends _Record {
|
||||
final Object? _0;
|
||||
final Object? _1;
|
||||
final Object? _2;
|
||||
|
@ -181,7 +181,7 @@ class _Record3 extends _Record {
|
|||
int get hashCode => Object.hash(_shapeTag, _0, _1, _2);
|
||||
}
|
||||
|
||||
class _RecordN extends _Record {
|
||||
final class _RecordN extends _Record {
|
||||
final JSArray _values;
|
||||
|
||||
_RecordN(this._values);
|
||||
|
|
|
@ -194,7 +194,7 @@ class Float64x2 {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableByteBufferView.
|
||||
class _UnmodifiableByteBufferView
|
||||
final class _UnmodifiableByteBufferView
|
||||
implements ByteBuffer, UnmodifiableByteBufferView {
|
||||
final ByteBuffer _data;
|
||||
|
||||
|
@ -258,7 +258,8 @@ class _UnmodifiableByteBufferView
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableByteDataView.
|
||||
class _UnmodifiableByteDataView implements ByteData, UnmodifiableByteDataView {
|
||||
final class _UnmodifiableByteDataView
|
||||
implements ByteData, UnmodifiableByteDataView {
|
||||
final ByteData _data;
|
||||
|
||||
_UnmodifiableByteDataView(ByteData data) : _data = data;
|
||||
|
@ -333,8 +334,7 @@ class _UnmodifiableByteDataView implements ByteData, UnmodifiableByteDataView {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _UnmodifiableListMixin<N, L extends List<N>,
|
||||
TD extends TypedData> {
|
||||
mixin _UnmodifiableListMixin<N, L extends List<N>, TD extends TypedData> {
|
||||
L get _list;
|
||||
TD get _data => (_list as TD);
|
||||
|
||||
|
@ -366,7 +366,7 @@ abstract class _UnmodifiableListMixin<N, L extends List<N>,
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint8ListView.
|
||||
class _UnmodifiableUint8ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint8ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint8List, Uint8List>
|
||||
implements UnmodifiableUint8ListView {
|
||||
final Uint8List _list;
|
||||
|
@ -379,7 +379,7 @@ class _UnmodifiableUint8ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt8ListView.
|
||||
class _UnmodifiableInt8ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt8ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int8List, Int8List>
|
||||
implements UnmodifiableInt8ListView {
|
||||
final Int8List _list;
|
||||
|
@ -392,7 +392,7 @@ class _UnmodifiableInt8ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint8ClampedListView.
|
||||
class _UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint8ClampedList, Uint8ClampedList>
|
||||
implements UnmodifiableUint8ClampedListView {
|
||||
final Uint8ClampedList _list;
|
||||
|
@ -405,7 +405,7 @@ class _UnmodifiableUint8ClampedListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint16ListView.
|
||||
class _UnmodifiableUint16ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint16ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint16List, Uint16List>
|
||||
implements UnmodifiableUint16ListView {
|
||||
final Uint16List _list;
|
||||
|
@ -418,7 +418,7 @@ class _UnmodifiableUint16ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt16ListView.
|
||||
class _UnmodifiableInt16ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt16ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int16List, Int16List>
|
||||
implements UnmodifiableInt16ListView {
|
||||
final Int16List _list;
|
||||
|
@ -431,7 +431,7 @@ class _UnmodifiableInt16ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint32ListView.
|
||||
class _UnmodifiableUint32ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint32ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint32List, Uint32List>
|
||||
implements UnmodifiableUint32ListView {
|
||||
final Uint32List _list;
|
||||
|
@ -444,7 +444,7 @@ class _UnmodifiableUint32ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt32ListView.
|
||||
class _UnmodifiableInt32ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt32ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int32List, Int32List>
|
||||
implements UnmodifiableInt32ListView {
|
||||
final Int32List _list;
|
||||
|
@ -457,7 +457,7 @@ class _UnmodifiableInt32ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint64ListView.
|
||||
class _UnmodifiableUint64ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableUint64ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Uint64List, Uint64List>
|
||||
implements UnmodifiableUint64ListView {
|
||||
final Uint64List _list;
|
||||
|
@ -470,7 +470,7 @@ class _UnmodifiableUint64ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt64ListView.
|
||||
class _UnmodifiableInt64ListView extends UnmodifiableListBase<int>
|
||||
final class _UnmodifiableInt64ListView extends UnmodifiableListBase<int>
|
||||
with _UnmodifiableListMixin<int, Int64List, Int64List>
|
||||
implements UnmodifiableInt64ListView {
|
||||
final Int64List _list;
|
||||
|
@ -483,7 +483,7 @@ class _UnmodifiableInt64ListView extends UnmodifiableListBase<int>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt32x4ListView.
|
||||
class _UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
|
||||
final class _UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
|
||||
with _UnmodifiableListMixin<Int32x4, Int32x4List, Int32x4List>
|
||||
implements UnmodifiableInt32x4ListView {
|
||||
final Int32x4List _list;
|
||||
|
@ -496,7 +496,8 @@ class _UnmodifiableInt32x4ListView extends UnmodifiableListBase<Int32x4>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat32x4ListView.
|
||||
class _UnmodifiableFloat32x4ListView extends UnmodifiableListBase<Float32x4>
|
||||
final class _UnmodifiableFloat32x4ListView
|
||||
extends UnmodifiableListBase<Float32x4>
|
||||
with _UnmodifiableListMixin<Float32x4, Float32x4List, Float32x4List>
|
||||
implements UnmodifiableFloat32x4ListView {
|
||||
final Float32x4List _list;
|
||||
|
@ -509,7 +510,8 @@ class _UnmodifiableFloat32x4ListView extends UnmodifiableListBase<Float32x4>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat64x2ListView.
|
||||
class _UnmodifiableFloat64x2ListView extends UnmodifiableListBase<Float64x2>
|
||||
final class _UnmodifiableFloat64x2ListView
|
||||
extends UnmodifiableListBase<Float64x2>
|
||||
with _UnmodifiableListMixin<Float64x2, Float64x2List, Float64x2List>
|
||||
implements UnmodifiableFloat64x2ListView {
|
||||
final Float64x2List _list;
|
||||
|
@ -522,7 +524,7 @@ class _UnmodifiableFloat64x2ListView extends UnmodifiableListBase<Float64x2>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat32ListView.
|
||||
class _UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
|
||||
final class _UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
|
||||
with _UnmodifiableListMixin<double, Float32List, Float32List>
|
||||
implements UnmodifiableFloat32ListView {
|
||||
final Float32List _list;
|
||||
|
@ -535,7 +537,7 @@ class _UnmodifiableFloat32ListView extends UnmodifiableListBase<double>
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat64ListView.
|
||||
class _UnmodifiableFloat64ListView extends UnmodifiableListBase<double>
|
||||
final class _UnmodifiableFloat64ListView extends UnmodifiableListBase<double>
|
||||
with _UnmodifiableListMixin<double, Float64List, Float64List>
|
||||
implements UnmodifiableFloat64ListView {
|
||||
final Float64List _list;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
part of "core_patch.dart";
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Double implements double {
|
||||
final class _Double implements double {
|
||||
@pragma("vm:recognized", "asm-intrinsic")
|
||||
@pragma("vm:exact-result-type", _Double)
|
||||
@pragma("vm:external-name", "Double_doubleFromInteger")
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
part of "core_patch.dart";
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Closure implements Function {
|
||||
final class _Closure implements Function {
|
||||
factory _Closure._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
part of "core_patch.dart";
|
||||
|
||||
abstract class _IntegerImplementation implements int {
|
||||
abstract final class _IntegerImplementation implements int {
|
||||
@pragma("vm:recognized", "graph-intrinsic")
|
||||
@pragma("vm:non-nullable-result-type")
|
||||
@pragma("vm:never-inline")
|
||||
|
@ -558,7 +558,7 @@ abstract class _IntegerImplementation implements int {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Smi extends _IntegerImplementation {
|
||||
final class _Smi extends _IntegerImplementation {
|
||||
factory _Smi._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
@ -760,7 +760,7 @@ class _Smi extends _IntegerImplementation {
|
|||
|
||||
// Represents integers that cannot be represented by Smi but fit into 64bits.
|
||||
@pragma("vm:entry-point")
|
||||
class _Mint extends _IntegerImplementation {
|
||||
final class _Mint extends _IntegerImplementation {
|
||||
factory _Mint._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ part of "core_patch.dart";
|
|||
|
||||
// Base class for record instances.
|
||||
@pragma("vm:entry-point")
|
||||
class _Record implements Record {
|
||||
final class _Record implements Record {
|
||||
factory _Record._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class String {
|
|||
* [_StringBase] contains common methods used by concrete String
|
||||
* implementations, e.g., _OneByteString.
|
||||
*/
|
||||
abstract class _StringBase implements String {
|
||||
abstract final class _StringBase implements String {
|
||||
bool _isWhitespace(int codeUnit);
|
||||
|
||||
// Constants used by replaceAll encoding of string slices between matches.
|
||||
|
@ -983,7 +983,7 @@ int _clampedPositiveProduct(int a, int b) {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _OneByteString extends _StringBase {
|
||||
final class _OneByteString extends _StringBase {
|
||||
factory _OneByteString._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
@ -1321,7 +1321,7 @@ class _OneByteString extends _StringBase {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _TwoByteString extends _StringBase {
|
||||
final class _TwoByteString extends _StringBase {
|
||||
factory _TwoByteString._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
@ -1383,7 +1383,7 @@ class _TwoByteString extends _StringBase {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalOneByteString extends _StringBase {
|
||||
final class _ExternalOneByteString extends _StringBase {
|
||||
factory _ExternalOneByteString._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
@ -1403,7 +1403,7 @@ class _ExternalOneByteString extends _StringBase {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalTwoByteString extends _StringBase {
|
||||
final class _ExternalTwoByteString extends _StringBase {
|
||||
factory _ExternalTwoByteString._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
@ -1422,7 +1422,7 @@ class _ExternalTwoByteString extends _StringBase {
|
|||
}
|
||||
}
|
||||
|
||||
class _StringMatch implements Match {
|
||||
final class _StringMatch implements Match {
|
||||
const _StringMatch(this.start, this.input, this.pattern);
|
||||
|
||||
int get end => start + pattern.length;
|
||||
|
@ -1449,7 +1449,7 @@ class _StringMatch implements Match {
|
|||
final String pattern;
|
||||
}
|
||||
|
||||
class _StringAllMatchesIterable extends Iterable<Match> {
|
||||
final class _StringAllMatchesIterable extends Iterable<Match> {
|
||||
final String _input;
|
||||
final String _pattern;
|
||||
final int _index;
|
||||
|
@ -1468,7 +1468,7 @@ class _StringAllMatchesIterable extends Iterable<Match> {
|
|||
}
|
||||
}
|
||||
|
||||
class _StringAllMatchesIterator implements Iterator<Match> {
|
||||
final class _StringAllMatchesIterator implements Iterator<Match> {
|
||||
final String _input;
|
||||
final String _pattern;
|
||||
int _index;
|
||||
|
|
|
@ -55,7 +55,7 @@ class ByteData implements TypedData {
|
|||
// This class does not extend ListBase<T> since that would add type arguments
|
||||
// to instances of _TypeListBase. Instead the subclasses use type specific
|
||||
// mixins (like _IntListMixin, _DoubleListMixin) to implement ListBase<T>.
|
||||
abstract class _TypedListBase {
|
||||
abstract final class _TypedListBase {
|
||||
@pragma("vm:recognized", "graph-intrinsic")
|
||||
@pragma("vm:exact-result-type", "dart:core#_Smi")
|
||||
@pragma("vm:prefer-inline")
|
||||
|
@ -829,7 +829,7 @@ mixin _TypedDoubleListMixin<SpawnedType extends List<double>>
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _Float32x4ListMixin implements List<Float32x4> {
|
||||
mixin _Float32x4ListMixin implements List<Float32x4> {
|
||||
int get elementSizeInBytes;
|
||||
int get offsetInBytes;
|
||||
_ByteBuffer get buffer;
|
||||
|
@ -1187,7 +1187,7 @@ abstract class _Float32x4ListMixin implements List<Float32x4> {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _Int32x4ListMixin implements List<Int32x4> {
|
||||
mixin _Int32x4ListMixin implements List<Int32x4> {
|
||||
int get elementSizeInBytes;
|
||||
int get offsetInBytes;
|
||||
_ByteBuffer get buffer;
|
||||
|
@ -1544,7 +1544,7 @@ abstract class _Int32x4ListMixin implements List<Int32x4> {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _Float64x2ListMixin implements List<Float64x2> {
|
||||
mixin _Float64x2ListMixin implements List<Float64x2> {
|
||||
int get elementSizeInBytes;
|
||||
int get offsetInBytes;
|
||||
_ByteBuffer get buffer;
|
||||
|
@ -1903,7 +1903,7 @@ abstract class _Float64x2ListMixin implements List<Float64x2> {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ByteBuffer implements ByteBuffer {
|
||||
final class _ByteBuffer implements ByteBuffer {
|
||||
final _TypedList _data;
|
||||
|
||||
_ByteBuffer(this._data);
|
||||
|
@ -2046,7 +2046,7 @@ class _ByteBuffer implements ByteBuffer {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _TypedList extends _TypedListBase {
|
||||
abstract final class _TypedList extends _TypedListBase {
|
||||
int get elementSizeInBytes;
|
||||
|
||||
// Default method implementing parts of the TypedData interface.
|
||||
|
@ -2200,7 +2200,7 @@ class Int8List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int8List extends _TypedList
|
||||
final class _Int8List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int8List>
|
||||
implements Int8List {
|
||||
factory _Int8List._uninstantiable() {
|
||||
|
@ -2256,7 +2256,7 @@ class Uint8List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint8List extends _TypedList
|
||||
final class _Uint8List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint8List>
|
||||
implements Uint8List {
|
||||
factory _Uint8List._uninstantiable() {
|
||||
|
@ -2312,7 +2312,7 @@ class Uint8ClampedList {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint8ClampedList extends _TypedList
|
||||
final class _Uint8ClampedList extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint8ClampedList>
|
||||
implements Uint8ClampedList {
|
||||
factory _Uint8ClampedList._uninstantiable() {
|
||||
|
@ -2368,7 +2368,7 @@ class Int16List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int16List extends _TypedList
|
||||
final class _Int16List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int16List>
|
||||
implements Int16List {
|
||||
factory _Int16List._uninstantiable() {
|
||||
|
@ -2444,7 +2444,7 @@ class Uint16List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint16List extends _TypedList
|
||||
final class _Uint16List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint16List>
|
||||
implements Uint16List {
|
||||
factory _Uint16List._uninstantiable() {
|
||||
|
@ -2520,7 +2520,7 @@ class Int32List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int32List extends _TypedList
|
||||
final class _Int32List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int32List>
|
||||
implements Int32List {
|
||||
factory _Int32List._uninstantiable() {
|
||||
|
@ -2583,7 +2583,7 @@ class Uint32List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint32List extends _TypedList
|
||||
final class _Uint32List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint32List>
|
||||
implements Uint32List {
|
||||
factory _Uint32List._uninstantiable() {
|
||||
|
@ -2646,7 +2646,7 @@ class Int64List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int64List extends _TypedList
|
||||
final class _Int64List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int64List>
|
||||
implements Int64List {
|
||||
factory _Int64List._uninstantiable() {
|
||||
|
@ -2709,7 +2709,7 @@ class Uint64List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint64List extends _TypedList
|
||||
final class _Uint64List extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint64List>
|
||||
implements Uint64List {
|
||||
factory _Uint64List._uninstantiable() {
|
||||
|
@ -2772,7 +2772,7 @@ class Float32List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Float32List extends _TypedList
|
||||
final class _Float32List extends _TypedList
|
||||
with _DoubleListMixin, _TypedDoubleListMixin<Float32List>
|
||||
implements Float32List {
|
||||
factory _Float32List._uninstantiable() {
|
||||
|
@ -2836,7 +2836,7 @@ class Float64List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Float64List extends _TypedList
|
||||
final class _Float64List extends _TypedList
|
||||
with _DoubleListMixin, _TypedDoubleListMixin<Float64List>
|
||||
implements Float64List {
|
||||
factory _Float64List._uninstantiable() {
|
||||
|
@ -2899,7 +2899,7 @@ class Float32x4List {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Float32x4List extends _TypedList
|
||||
final class _Float32x4List extends _TypedList
|
||||
with _Float32x4ListMixin
|
||||
implements Float32x4List {
|
||||
factory _Float32x4List._uninstantiable() {
|
||||
|
@ -2961,7 +2961,7 @@ class Int32x4List {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Int32x4List extends _TypedList
|
||||
final class _Int32x4List extends _TypedList
|
||||
with _Int32x4ListMixin
|
||||
implements Int32x4List {
|
||||
factory _Int32x4List._uninstantiable() {
|
||||
|
@ -3023,7 +3023,7 @@ class Float64x2List {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Float64x2List extends _TypedList
|
||||
final class _Float64x2List extends _TypedList
|
||||
with _Float64x2ListMixin
|
||||
implements Float64x2List {
|
||||
factory _Float64x2List._uninstantiable() {
|
||||
|
@ -3069,7 +3069,7 @@ class _Float64x2List extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalInt8Array extends _TypedList
|
||||
final class _ExternalInt8Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int8List>
|
||||
implements Int8List {
|
||||
factory _ExternalInt8Array._uninstantiable() {
|
||||
|
@ -3106,7 +3106,7 @@ class _ExternalInt8Array extends _TypedList
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _ExternalUint8Array extends _TypedList
|
||||
final class _ExternalUint8Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint8List>
|
||||
implements Uint8List {
|
||||
factory _ExternalUint8Array._uninstantiable() {
|
||||
|
@ -3145,7 +3145,7 @@ class _ExternalUint8Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalUint8ClampedArray extends _TypedList
|
||||
final class _ExternalUint8ClampedArray extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint8ClampedList>
|
||||
implements Uint8ClampedList {
|
||||
factory _ExternalUint8ClampedArray._uninstantiable() {
|
||||
|
@ -3184,7 +3184,7 @@ class _ExternalUint8ClampedArray extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalInt16Array extends _TypedList
|
||||
final class _ExternalInt16Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int16List>
|
||||
implements Int16List {
|
||||
factory _ExternalInt16Array._uninstantiable() {
|
||||
|
@ -3228,7 +3228,7 @@ class _ExternalInt16Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalUint16Array extends _TypedList
|
||||
final class _ExternalUint16Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint16List>
|
||||
implements Uint16List {
|
||||
factory _ExternalUint16Array._uninstantiable() {
|
||||
|
@ -3272,7 +3272,7 @@ class _ExternalUint16Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalInt32Array extends _TypedList
|
||||
final class _ExternalInt32Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int32List>
|
||||
implements Int32List {
|
||||
factory _ExternalInt32Array._uninstantiable() {
|
||||
|
@ -3316,7 +3316,7 @@ class _ExternalInt32Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalUint32Array extends _TypedList
|
||||
final class _ExternalUint32Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint32List>
|
||||
implements Uint32List {
|
||||
factory _ExternalUint32Array._uninstantiable() {
|
||||
|
@ -3360,7 +3360,7 @@ class _ExternalUint32Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalInt64Array extends _TypedList
|
||||
final class _ExternalInt64Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Int64List>
|
||||
implements Int64List {
|
||||
factory _ExternalInt64Array._uninstantiable() {
|
||||
|
@ -3404,7 +3404,7 @@ class _ExternalInt64Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalUint64Array extends _TypedList
|
||||
final class _ExternalUint64Array extends _TypedList
|
||||
with _IntListMixin, _TypedIntListMixin<Uint64List>
|
||||
implements Uint64List {
|
||||
factory _ExternalUint64Array._uninstantiable() {
|
||||
|
@ -3448,7 +3448,7 @@ class _ExternalUint64Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalFloat32Array extends _TypedList
|
||||
final class _ExternalFloat32Array extends _TypedList
|
||||
with _DoubleListMixin, _TypedDoubleListMixin<Float32List>
|
||||
implements Float32List {
|
||||
factory _ExternalFloat32Array._uninstantiable() {
|
||||
|
@ -3492,7 +3492,7 @@ class _ExternalFloat32Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalFloat64Array extends _TypedList
|
||||
final class _ExternalFloat64Array extends _TypedList
|
||||
with _DoubleListMixin, _TypedDoubleListMixin<Float64List>
|
||||
implements Float64List {
|
||||
factory _ExternalFloat64Array._uninstantiable() {
|
||||
|
@ -3536,7 +3536,7 @@ class _ExternalFloat64Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalFloat32x4Array extends _TypedList
|
||||
final class _ExternalFloat32x4Array extends _TypedList
|
||||
with _Float32x4ListMixin
|
||||
implements Float32x4List {
|
||||
factory _ExternalFloat32x4Array._uninstantiable() {
|
||||
|
@ -3580,7 +3580,7 @@ class _ExternalFloat32x4Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalInt32x4Array extends _TypedList
|
||||
final class _ExternalInt32x4Array extends _TypedList
|
||||
with _Int32x4ListMixin
|
||||
implements Int32x4List {
|
||||
factory _ExternalInt32x4Array._uninstantiable() {
|
||||
|
@ -3624,7 +3624,7 @@ class _ExternalInt32x4Array extends _TypedList
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _ExternalFloat64x2Array extends _TypedList
|
||||
final class _ExternalFloat64x2Array extends _TypedList
|
||||
with _Float64x2ListMixin
|
||||
implements Float64x2List {
|
||||
factory _ExternalFloat64x2Array._uninstantiable() {
|
||||
|
@ -3717,7 +3717,7 @@ class Float32x4 {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Float32x4 implements Float32x4 {
|
||||
final class _Float32x4 implements Float32x4 {
|
||||
@pragma("vm:recognized", "graph-intrinsic")
|
||||
@pragma("vm:exact-result-type", _Float32x4)
|
||||
@pragma("vm:external-name", "Float32x4_add")
|
||||
|
@ -3908,7 +3908,7 @@ class Int32x4 {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Int32x4 implements Int32x4 {
|
||||
final class _Int32x4 implements Int32x4 {
|
||||
@pragma("vm:external-name", "Int32x4_or")
|
||||
external Int32x4 operator |(Int32x4 other);
|
||||
@pragma("vm:external-name", "Int32x4_and")
|
||||
|
@ -4087,7 +4087,7 @@ class Float64x2 {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _Float64x2 implements Float64x2 {
|
||||
final class _Float64x2 implements Float64x2 {
|
||||
@pragma("vm:recognized", "graph-intrinsic")
|
||||
@pragma("vm:external-name", "Float64x2_add")
|
||||
external Float64x2 operator +(Float64x2 other);
|
||||
|
@ -4164,7 +4164,7 @@ class _Float64x2 implements Float64x2 {
|
|||
external Float64x2 sqrt();
|
||||
}
|
||||
|
||||
class _TypedListIterator<E> implements Iterator<E> {
|
||||
final class _TypedListIterator<E> implements Iterator<E> {
|
||||
final List<E> _array;
|
||||
final int _length;
|
||||
int _position;
|
||||
|
@ -4192,7 +4192,8 @@ class _TypedListIterator<E> implements Iterator<E> {
|
|||
E get current => _current as E;
|
||||
}
|
||||
|
||||
abstract class _TypedListView extends _TypedListBase implements TypedData {
|
||||
abstract final class _TypedListView extends _TypedListBase
|
||||
implements TypedData {
|
||||
// Method(s) implementing the TypedData interface.
|
||||
|
||||
int get lengthInBytes {
|
||||
|
@ -4218,7 +4219,7 @@ abstract class _TypedListView extends _TypedListBase implements TypedData {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int8ArrayView extends _TypedListView
|
||||
final class _Int8ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Int8List>
|
||||
implements Int8List {
|
||||
// Constructor.
|
||||
|
@ -4262,7 +4263,7 @@ class _Int8ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint8ArrayView extends _TypedListView
|
||||
final class _Uint8ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Uint8List>
|
||||
implements Uint8List {
|
||||
// Constructor.
|
||||
|
@ -4306,7 +4307,7 @@ class _Uint8ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint8ClampedArrayView extends _TypedListView
|
||||
final class _Uint8ClampedArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Uint8ClampedList>
|
||||
implements Uint8ClampedList {
|
||||
// Constructor.
|
||||
|
@ -4350,7 +4351,7 @@ class _Uint8ClampedArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int16ArrayView extends _TypedListView
|
||||
final class _Int16ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Int16List>
|
||||
implements Int16List {
|
||||
// Constructor.
|
||||
|
@ -4407,7 +4408,7 @@ class _Int16ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint16ArrayView extends _TypedListView
|
||||
final class _Uint16ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Uint16List>
|
||||
implements Uint16List {
|
||||
// Constructor.
|
||||
|
@ -4465,7 +4466,7 @@ class _Uint16ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int32ArrayView extends _TypedListView
|
||||
final class _Int32ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Int32List>
|
||||
implements Int32List {
|
||||
// Constructor.
|
||||
|
@ -4509,7 +4510,7 @@ class _Int32ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint32ArrayView extends _TypedListView
|
||||
final class _Uint32ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Uint32List>
|
||||
implements Uint32List {
|
||||
// Constructor.
|
||||
|
@ -4553,7 +4554,7 @@ class _Uint32ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int64ArrayView extends _TypedListView
|
||||
final class _Int64ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Int64List>
|
||||
implements Int64List {
|
||||
// Constructor.
|
||||
|
@ -4597,7 +4598,7 @@ class _Int64ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Uint64ArrayView extends _TypedListView
|
||||
final class _Uint64ArrayView extends _TypedListView
|
||||
with _IntListMixin, _TypedIntListMixin<Uint64List>
|
||||
implements Uint64List {
|
||||
// Constructor.
|
||||
|
@ -4641,7 +4642,7 @@ class _Uint64ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Float32ArrayView extends _TypedListView
|
||||
final class _Float32ArrayView extends _TypedListView
|
||||
with _DoubleListMixin, _TypedDoubleListMixin<Float32List>
|
||||
implements Float32List {
|
||||
// Constructor.
|
||||
|
@ -4685,7 +4686,7 @@ class _Float32ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Float64ArrayView extends _TypedListView
|
||||
final class _Float64ArrayView extends _TypedListView
|
||||
with _DoubleListMixin, _TypedDoubleListMixin<Float64List>
|
||||
implements Float64List {
|
||||
// Constructor.
|
||||
|
@ -4729,7 +4730,7 @@ class _Float64ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Float32x4ArrayView extends _TypedListView
|
||||
final class _Float32x4ArrayView extends _TypedListView
|
||||
with _Float32x4ListMixin
|
||||
implements Float32x4List {
|
||||
// Constructor.
|
||||
|
@ -4771,7 +4772,7 @@ class _Float32x4ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Int32x4ArrayView extends _TypedListView
|
||||
final class _Int32x4ArrayView extends _TypedListView
|
||||
with _Int32x4ListMixin
|
||||
implements Int32x4List {
|
||||
// Constructor.
|
||||
|
@ -4813,7 +4814,7 @@ class _Int32x4ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _Float64x2ArrayView extends _TypedListView
|
||||
final class _Float64x2ArrayView extends _TypedListView
|
||||
with _Float64x2ListMixin
|
||||
implements Float64x2List {
|
||||
// Constructor.
|
||||
|
@ -4855,7 +4856,7 @@ class _Float64x2ArrayView extends _TypedListView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _ByteDataView implements ByteData {
|
||||
final class _ByteDataView implements ByteData {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _ByteDataView)
|
||||
@pragma("vm:external-name", "TypedDataView_ByteDataView_new")
|
||||
|
@ -5382,7 +5383,7 @@ abstract class UnmodifiableFloat64ListView implements Float64List {
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableInt8ArrayView extends _Int8ArrayView
|
||||
final class _UnmodifiableInt8ArrayView extends _Int8ArrayView
|
||||
implements UnmodifiableInt8ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableInt8ArrayView)
|
||||
|
@ -5399,7 +5400,7 @@ class _UnmodifiableInt8ArrayView extends _Int8ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableUint8ArrayView extends _Uint8ArrayView
|
||||
final class _UnmodifiableUint8ArrayView extends _Uint8ArrayView
|
||||
implements UnmodifiableUint8ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableUint8ArrayView)
|
||||
|
@ -5416,7 +5417,7 @@ class _UnmodifiableUint8ArrayView extends _Uint8ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableUint8ClampedArrayView extends _Uint8ClampedArrayView
|
||||
final class _UnmodifiableUint8ClampedArrayView extends _Uint8ClampedArrayView
|
||||
implements UnmodifiableUint8ClampedListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableUint8ClampedArrayView)
|
||||
|
@ -5433,7 +5434,7 @@ class _UnmodifiableUint8ClampedArrayView extends _Uint8ClampedArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableInt16ArrayView extends _Int16ArrayView
|
||||
final class _UnmodifiableInt16ArrayView extends _Int16ArrayView
|
||||
implements UnmodifiableInt16ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableInt16ArrayView)
|
||||
|
@ -5450,7 +5451,7 @@ class _UnmodifiableInt16ArrayView extends _Int16ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableUint16ArrayView extends _Uint16ArrayView
|
||||
final class _UnmodifiableUint16ArrayView extends _Uint16ArrayView
|
||||
implements UnmodifiableUint16ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableUint16ArrayView)
|
||||
|
@ -5467,7 +5468,7 @@ class _UnmodifiableUint16ArrayView extends _Uint16ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableInt32ArrayView extends _Int32ArrayView
|
||||
final class _UnmodifiableInt32ArrayView extends _Int32ArrayView
|
||||
implements UnmodifiableInt32ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableInt32ArrayView)
|
||||
|
@ -5484,7 +5485,7 @@ class _UnmodifiableInt32ArrayView extends _Int32ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableUint32ArrayView extends _Uint32ArrayView
|
||||
final class _UnmodifiableUint32ArrayView extends _Uint32ArrayView
|
||||
implements UnmodifiableUint32ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableUint32ArrayView)
|
||||
|
@ -5501,7 +5502,7 @@ class _UnmodifiableUint32ArrayView extends _Uint32ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableInt64ArrayView extends _Int64ArrayView
|
||||
final class _UnmodifiableInt64ArrayView extends _Int64ArrayView
|
||||
implements UnmodifiableInt64ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableInt64ArrayView)
|
||||
|
@ -5518,7 +5519,7 @@ class _UnmodifiableInt64ArrayView extends _Int64ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableUint64ArrayView extends _Uint64ArrayView
|
||||
final class _UnmodifiableUint64ArrayView extends _Uint64ArrayView
|
||||
implements UnmodifiableUint64ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableUint64ArrayView)
|
||||
|
@ -5535,7 +5536,7 @@ class _UnmodifiableUint64ArrayView extends _Uint64ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableFloat32ArrayView extends _Float32ArrayView
|
||||
final class _UnmodifiableFloat32ArrayView extends _Float32ArrayView
|
||||
implements UnmodifiableFloat32ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableFloat32ArrayView)
|
||||
|
@ -5552,7 +5553,7 @@ class _UnmodifiableFloat32ArrayView extends _Float32ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableFloat64ArrayView extends _Float64ArrayView
|
||||
final class _UnmodifiableFloat64ArrayView extends _Float64ArrayView
|
||||
implements UnmodifiableFloat64ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableFloat64ArrayView)
|
||||
|
@ -5569,7 +5570,7 @@ class _UnmodifiableFloat64ArrayView extends _Float64ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableFloat32x4ArrayView extends _Float32x4ArrayView
|
||||
final class _UnmodifiableFloat32x4ArrayView extends _Float32x4ArrayView
|
||||
implements UnmodifiableFloat32x4ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableFloat32x4ArrayView)
|
||||
|
@ -5586,7 +5587,7 @@ class _UnmodifiableFloat32x4ArrayView extends _Float32x4ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableInt32x4ArrayView extends _Int32x4ArrayView
|
||||
final class _UnmodifiableInt32x4ArrayView extends _Int32x4ArrayView
|
||||
implements UnmodifiableInt32x4ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableInt32x4ArrayView)
|
||||
|
@ -5603,7 +5604,7 @@ class _UnmodifiableInt32x4ArrayView extends _Int32x4ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableFloat64x2ArrayView extends _Float64x2ArrayView
|
||||
final class _UnmodifiableFloat64x2ArrayView extends _Float64x2ArrayView
|
||||
implements UnmodifiableFloat64x2ListView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableFloat64x2ArrayView)
|
||||
|
@ -5620,7 +5621,7 @@ class _UnmodifiableFloat64x2ArrayView extends _Float64x2ArrayView
|
|||
|
||||
@pragma("vm:entry-point")
|
||||
@pragma("wasm:entry-point")
|
||||
class _UnmodifiableByteDataView extends _ByteDataView
|
||||
final class _UnmodifiableByteDataView extends _ByteDataView
|
||||
implements UnmodifiableByteDataView {
|
||||
@pragma("vm:recognized", "other")
|
||||
@pragma("vm:exact-result-type", _UnmodifiableByteDataView)
|
||||
|
@ -5676,7 +5677,7 @@ class _UnmodifiableByteDataView extends _ByteDataView
|
|||
_ByteBuffer get buffer => new _UnmodifiableByteBufferView(_typedData.buffer);
|
||||
}
|
||||
|
||||
class _UnmodifiableByteBufferView extends _ByteBuffer
|
||||
final class _UnmodifiableByteBufferView extends _ByteBuffer
|
||||
implements UnmodifiableByteBufferView {
|
||||
_UnmodifiableByteBufferView(ByteBuffer data)
|
||||
: super(unsafeCast<_ByteBuffer>(data)._data);
|
||||
|
|
|
@ -17,7 +17,7 @@ class bool {
|
|||
}
|
||||
|
||||
@pragma("wasm:entry-point")
|
||||
class _BoxedBool extends bool {
|
||||
final class _BoxedBool extends bool {
|
||||
// A boxed bool contains an unboxed bool.
|
||||
@pragma("wasm:entry-point")
|
||||
bool value = false;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
part of "core_patch.dart";
|
||||
|
||||
/// Base class for closure objects.
|
||||
class _Closure implements Function {
|
||||
final class _Closure implements Function {
|
||||
@pragma("wasm:entry-point")
|
||||
WasmStructRef context;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class double {
|
|||
}
|
||||
|
||||
@pragma("wasm:entry-point")
|
||||
class _BoxedDouble extends double {
|
||||
final class _BoxedDouble extends double {
|
||||
// A boxed double contains an unboxed double.
|
||||
@pragma("wasm:entry-point")
|
||||
double value = 0.0;
|
||||
|
|
|
@ -26,7 +26,7 @@ class int {
|
|||
}
|
||||
|
||||
@pragma("wasm:entry-point")
|
||||
class _BoxedInt extends int {
|
||||
final class _BoxedInt extends int {
|
||||
// A boxed int contains an unboxed int.
|
||||
@pragma("wasm:entry-point")
|
||||
int value = 0;
|
||||
|
|
|
@ -107,7 +107,7 @@ class Float64x2 {
|
|||
factory Float64x2.fromFloat32x4(Float32x4 v) = _NaiveFloat64x2.fromFloat32x4;
|
||||
}
|
||||
|
||||
class _NaiveInt32x4List extends Object
|
||||
final class _NaiveInt32x4List extends Object
|
||||
with ListMixin<Int32x4>, FixedLengthListMixin<Int32x4>
|
||||
implements Int32x4List {
|
||||
final Int32List _storage;
|
||||
|
@ -170,7 +170,7 @@ class _NaiveInt32x4List extends Object
|
|||
}
|
||||
}
|
||||
|
||||
class _NaiveFloat32x4List extends Object
|
||||
final class _NaiveFloat32x4List extends Object
|
||||
with ListMixin<Float32x4>, FixedLengthListMixin<Float32x4>
|
||||
implements Float32x4List {
|
||||
final Float32List _storage;
|
||||
|
@ -236,7 +236,7 @@ class _NaiveFloat32x4List extends Object
|
|||
}
|
||||
}
|
||||
|
||||
class _NaiveFloat64x2List extends Object
|
||||
final class _NaiveFloat64x2List extends Object
|
||||
with ListMixin<Float64x2>, FixedLengthListMixin<Float64x2>
|
||||
implements Float64x2List {
|
||||
final Float64List _storage;
|
||||
|
@ -296,7 +296,7 @@ class _NaiveFloat64x2List extends Object
|
|||
}
|
||||
}
|
||||
|
||||
class _NaiveFloat32x4 implements Float32x4 {
|
||||
final class _NaiveFloat32x4 implements Float32x4 {
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
|
@ -591,7 +591,7 @@ class _NaiveFloat32x4 implements Float32x4 {
|
|||
}
|
||||
}
|
||||
|
||||
class _NaiveFloat64x2 implements Float64x2 {
|
||||
final class _NaiveFloat64x2 implements Float64x2 {
|
||||
final double x;
|
||||
final double y;
|
||||
|
||||
|
@ -665,7 +665,7 @@ class _NaiveFloat64x2 implements Float64x2 {
|
|||
Float64x2 sqrt() => _NaiveFloat64x2._doubles(math.sqrt(x), math.sqrt(y));
|
||||
}
|
||||
|
||||
class _NaiveInt32x4 implements Int32x4 {
|
||||
final class _NaiveInt32x4 implements Int32x4 {
|
||||
final int x;
|
||||
final int y;
|
||||
final int z;
|
||||
|
|
|
@ -60,7 +60,7 @@ class String {
|
|||
* [_StringBase] contains common methods used by concrete String
|
||||
* implementations, e.g., _OneByteString.
|
||||
*/
|
||||
abstract class _StringBase implements String {
|
||||
abstract final class _StringBase implements String {
|
||||
bool _isWhitespace(int codeUnit);
|
||||
|
||||
// Constants used by replaceAll encoding of string slices between matches.
|
||||
|
@ -1031,7 +1031,7 @@ abstract class _StringBase implements String {
|
|||
}
|
||||
|
||||
@pragma("wasm:entry-point")
|
||||
class _OneByteString extends _StringBase {
|
||||
final class _OneByteString extends _StringBase {
|
||||
@pragma("wasm:entry-point")
|
||||
WasmIntArray<WasmI8> _array;
|
||||
|
||||
|
@ -1367,7 +1367,7 @@ class _OneByteString extends _StringBase {
|
|||
}
|
||||
|
||||
@pragma("wasm:entry-point")
|
||||
class _TwoByteString extends _StringBase {
|
||||
final class _TwoByteString extends _StringBase {
|
||||
@pragma("wasm:entry-point")
|
||||
WasmIntArray<WasmI16> _array;
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ part of dart.async;
|
|||
/// `Future<Object>`.
|
||||
@pragma("vm:entry-point")
|
||||
abstract class FutureOr<T> {
|
||||
// Private generative constructor, so that it is not subclassable, mixable, or
|
||||
// instantiable.
|
||||
// Private generative constructor, so that it is not subclassable, mixable,
|
||||
// or instantiable.
|
||||
FutureOr._() {
|
||||
throw new UnsupportedError("FutureOr can't be instantiated");
|
||||
throw new UnsupportedError("FutureOr cannot be instantiated");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -768,7 +768,7 @@ abstract class _StreamController<T> implements _StreamControllerBase<T> {
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _SyncStreamControllerDispatch<T>
|
||||
mixin _SyncStreamControllerDispatch<T>
|
||||
implements _StreamController<T>, SynchronousStreamController<T> {
|
||||
void _sendData(T data) {
|
||||
_subscription._add(data);
|
||||
|
@ -783,8 +783,7 @@ abstract class _SyncStreamControllerDispatch<T>
|
|||
}
|
||||
}
|
||||
|
||||
abstract class _AsyncStreamControllerDispatch<T>
|
||||
implements _StreamController<T> {
|
||||
mixin _AsyncStreamControllerDispatch<T> implements _StreamController<T> {
|
||||
void _sendData(T data) {
|
||||
_subscription._addPending(_DelayedData<T>(data));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ part of dart.collection;
|
|||
/// This [Iterable] mixin implements all [Iterable] members except `iterator`.
|
||||
///
|
||||
/// All other methods are implemented in terms of `iterator`.
|
||||
abstract class IterableMixin<E> implements Iterable<E> {
|
||||
abstract mixin class IterableMixin<E> implements Iterable<E> {
|
||||
// This class has methods copied verbatim into:
|
||||
// - IterableBase
|
||||
// - SetMixin
|
||||
|
|
|
@ -270,7 +270,7 @@ class _LinkedListIterator<E extends LinkedListEntry<E>> implements Iterator<E> {
|
|||
/// linked list, and otherwise the `list` property is `null`.
|
||||
///
|
||||
/// When created, an entry is not in any linked list.
|
||||
abstract class LinkedListEntry<E extends LinkedListEntry<E>> {
|
||||
abstract base mixin class LinkedListEntry<E extends LinkedListEntry<E>> {
|
||||
LinkedList<E>? _list;
|
||||
E? _next;
|
||||
E? _previous;
|
||||
|
|
|
@ -69,7 +69,7 @@ abstract class ListBase<E> extends Object with ListMixin<E> {
|
|||
/// To avoid this, override 'add' and 'addAll' to also forward directly
|
||||
/// to the growable list, or, if possible, use `DelegatingList` from
|
||||
/// "package:collection/collection.dart" instead of a `ListMixin`.
|
||||
abstract class ListMixin<E> implements List<E> {
|
||||
abstract mixin class ListMixin<E> implements List<E> {
|
||||
// Iterable interface.
|
||||
// TODO(lrn): When we get composable mixins, reuse IterableMixin instead
|
||||
// of redeclaring everything.
|
||||
|
|
|
@ -108,7 +108,7 @@ abstract class MapBase<K, V> extends MapMixin<K, V> {
|
|||
///
|
||||
/// A more efficient implementation is usually possible by overriding
|
||||
/// some of the other members as well.
|
||||
abstract class MapMixin<K, V> implements Map<K, V> {
|
||||
abstract mixin class MapMixin<K, V> implements Map<K, V> {
|
||||
Iterable<K> get keys;
|
||||
V? operator [](Object? key);
|
||||
operator []=(K key, V value);
|
||||
|
@ -263,7 +263,7 @@ class _MapBaseValueIterator<K, V> implements Iterator<V> {
|
|||
|
||||
/// Mixin that overrides mutating map operations with implementations that
|
||||
/// throw.
|
||||
abstract class _UnmodifiableMapMixin<K, V> implements Map<K, V> {
|
||||
mixin _UnmodifiableMapMixin<K, V> implements Map<K, V> {
|
||||
/// This operation is not supported by an unmodifiable map.
|
||||
void operator []=(K key, V value) {
|
||||
throw UnsupportedError("Cannot modify unmodifiable map");
|
||||
|
|
|
@ -20,7 +20,7 @@ part of dart.collection;
|
|||
/// Implementations of `Set` using this mixin should consider also implementing
|
||||
/// `clear` in constant time. The default implementation works by removing every
|
||||
/// element.
|
||||
abstract class SetMixin<E> implements Set<E> {
|
||||
abstract mixin class SetMixin<E> implements Set<E> {
|
||||
// This class reimplements all of [IterableMixin].
|
||||
// If/when Dart mixins get more powerful, we should just create a single
|
||||
// Mixin class from IterableMixin and the new methods of this class.
|
||||
|
@ -341,7 +341,7 @@ abstract class _SetBase<E> with SetMixin<E> {
|
|||
Set<E> toSet() => _newSet()..addAll(this);
|
||||
}
|
||||
|
||||
abstract class _UnmodifiableSetMixin<E> implements Set<E> {
|
||||
mixin _UnmodifiableSetMixin<E> implements Set<E> {
|
||||
static Never _throwUnmodifiable() {
|
||||
throw UnsupportedError("Cannot change an unmodifiable set");
|
||||
}
|
||||
|
|
|
@ -882,7 +882,7 @@ abstract class _JsonStringifier {
|
|||
/// [Map] objects using the specified indent value.
|
||||
///
|
||||
/// Subclasses should implement [writeIndentation].
|
||||
abstract class _JsonPrettyPrintMixin implements _JsonStringifier {
|
||||
mixin _JsonPrettyPrintMixin implements _JsonStringifier {
|
||||
int _indentLevel = 0;
|
||||
|
||||
/// Add [indentLevel] indentations to the JSON output.
|
||||
|
|
|
@ -155,7 +155,7 @@ abstract class StringConversionSinkBase extends StringConversionSinkMixin {}
|
|||
|
||||
/// This class provides a mixin for converters that need to accept String
|
||||
/// inputs.
|
||||
abstract class StringConversionSinkMixin implements StringConversionSink {
|
||||
abstract mixin class StringConversionSinkMixin implements StringConversionSink {
|
||||
void addSlice(String str, int start, int end, bool isLast);
|
||||
void close();
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ part of dart.core;
|
|||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// bool.
|
||||
@pragma("vm:entry-point")
|
||||
class bool {
|
||||
final class bool {
|
||||
/// Returns the boolean value of the environment declaration [name].
|
||||
///
|
||||
/// The boolean value of the declaration is `true` if the declared value is
|
||||
|
|
|
@ -21,7 +21,7 @@ part of dart.core;
|
|||
/// * [num] the super class for [double].
|
||||
/// * [Numbers](https://dart.dev/guides/language/numbers) in
|
||||
/// [A tour of the Dart language](https://dart.dev/guides/language/language-tour).
|
||||
abstract class double extends num {
|
||||
abstract final class double extends num {
|
||||
static const double nan = 0.0 / 0.0;
|
||||
static const double infinity = 1.0 / 0.0;
|
||||
static const double negativeInfinity = -infinity;
|
||||
|
|
|
@ -8,10 +8,10 @@ part of dart.core;
|
|||
///
|
||||
/// This class is implemented by all types and values
|
||||
/// introduced using an `enum` declaration.
|
||||
/// Non-platform classes cannot implement, extend or
|
||||
/// mix in this class.
|
||||
/// Non-platform classes cannot extend or mix in this class.
|
||||
/// Concrete classes cannot implement the interface.
|
||||
@Since("2.14")
|
||||
abstract class Enum {
|
||||
abstract interface class Enum {
|
||||
/// A numeric identifier for the enumerated value.
|
||||
///
|
||||
/// The values of a single enumeration are numbered
|
||||
|
|
|
@ -101,7 +101,7 @@ part of dart.core;
|
|||
/// Function? maybeFun = Random().nextBool() ? fun : null;
|
||||
/// print(maybeFun?.call(1)); // Prints "1" or "null".
|
||||
/// ```
|
||||
abstract class Function {
|
||||
abstract final class Function {
|
||||
/// Dynamically call [function] with the specified arguments.
|
||||
///
|
||||
/// Acts the same as dynamically calling [function] with
|
||||
|
|
|
@ -25,7 +25,7 @@ part of dart.core;
|
|||
/// * [num] the super class for [int].
|
||||
/// * [Numbers](https://dart.dev/guides/language/numbers) in
|
||||
/// [A tour of the Dart language](https://dart.dev/guides/language/language-tour).
|
||||
abstract class int extends num {
|
||||
abstract final class int extends num {
|
||||
/// Returns the integer value of the given environment declaration [name].
|
||||
///
|
||||
/// The result is the same as would be returned by:
|
||||
|
|
|
@ -21,7 +21,7 @@ part of dart.core;
|
|||
/// [...? e6] // spreads e6 into the list literal, unless e6 is null.
|
||||
/// ```
|
||||
@pragma("vm:entry-point")
|
||||
class Null {
|
||||
final class Null {
|
||||
factory Null._uninstantiable() {
|
||||
throw UnsupportedError('class Null cannot be instantiated');
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@ part of dart.core;
|
|||
/// * [double]: A double-precision floating point number.
|
||||
/// * [Numbers](https://dart.dev/guides/language/numbers) in
|
||||
/// [A tour of the Dart language](https://dart.dev/guides/language/language-tour).
|
||||
|
||||
abstract class num implements Comparable<num> {
|
||||
sealed class num implements Comparable<num> {
|
||||
/// Test whether this value is numerically equal to `other`.
|
||||
///
|
||||
/// If both operands are [double]s, they are equal if they have the same
|
||||
|
|
|
@ -8,4 +8,4 @@ part of dart.core;
|
|||
///
|
||||
/// The run-time type of a record object is a record type, and as such, a
|
||||
/// subtype of [Record].
|
||||
abstract class Record {}
|
||||
abstract final class Record {}
|
||||
|
|
|
@ -105,7 +105,7 @@ part of dart.core;
|
|||
/// * [RegExp] to work with regular expressions.
|
||||
/// * [Strings and regular expressions](https://dart.dev/guides/libraries/library-tour#strings-and-regular-expressions)
|
||||
@pragma('vm:entry-point')
|
||||
abstract class String implements Comparable<String>, Pattern {
|
||||
abstract final class String implements Comparable<String>, Pattern {
|
||||
/// Allocates a new string containing the specified [charCodes].
|
||||
///
|
||||
/// The [charCodes] can be both UTF-16 code units and runes.
|
||||
|
|
|
@ -5913,7 +5913,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
|
|||
// items in the MEMBERS set if you want that functionality.
|
||||
}
|
||||
|
||||
abstract class CssStyleDeclarationBase {
|
||||
abstract mixin class CssStyleDeclarationBase {
|
||||
String getPropertyValue(String propertyName);
|
||||
void setProperty(String propertyName, String? value, [String? priority]);
|
||||
|
||||
|
@ -37899,7 +37899,7 @@ class _Html5NodeValidator implements NodeValidator {
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
abstract class ImmutableListMixin<E> implements List<E> {
|
||||
abstract mixin class ImmutableListMixin<E> implements List<E> {
|
||||
// From Iterable<$E>:
|
||||
Iterator<E> get iterator {
|
||||
// Note: NodeLists are not fixed size. And most probably length shouldn't
|
||||
|
|
|
@ -9,7 +9,7 @@ part of dart._internal;
|
|||
*
|
||||
* Intended to mix-in on top of [ListMixin] for fixed-length lists.
|
||||
*/
|
||||
abstract class FixedLengthListMixin<E> {
|
||||
mixin FixedLengthListMixin<E> {
|
||||
/** This operation is not supported by a fixed length list. */
|
||||
set length(int newLength) {
|
||||
throw new UnsupportedError(
|
||||
|
@ -84,7 +84,7 @@ abstract class FixedLengthListMixin<E> {
|
|||
* This mixin is intended to be mixed in on top of [ListMixin] on
|
||||
* unmodifiable lists.
|
||||
*/
|
||||
abstract class UnmodifiableListMixin<E> implements List<E> {
|
||||
mixin UnmodifiableListMixin<E> implements List<E> {
|
||||
/** This operation is not supported by an unmodifiable list. */
|
||||
void operator []=(int index, E value) {
|
||||
throw new UnsupportedError("Cannot modify an unmodifiable list");
|
||||
|
|
|
@ -7,7 +7,7 @@ part of dart.io;
|
|||
int _nextServiceId = 1;
|
||||
|
||||
// TODO(ajohnsen): Use other way of getting a unique id.
|
||||
abstract class _ServiceObject {
|
||||
mixin _ServiceObject {
|
||||
int __serviceId = 0;
|
||||
int get _serviceId {
|
||||
if (__serviceId == 0) __serviceId = _nextServiceId++;
|
||||
|
|
|
@ -27,7 +27,7 @@ part "unmodifiable_typed_data.dart";
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// ByteBuffer.
|
||||
abstract class ByteBuffer {
|
||||
abstract final class ByteBuffer {
|
||||
/// Returns the length of this byte buffer, in bytes.
|
||||
int get lengthInBytes;
|
||||
|
||||
|
@ -346,7 +346,7 @@ abstract class ByteBuffer {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// TypedData.
|
||||
abstract class TypedData {
|
||||
abstract final class TypedData {
|
||||
/// Returns the number of bytes in the representation of each element in this
|
||||
/// list.
|
||||
int get elementSizeInBytes;
|
||||
|
@ -361,7 +361,7 @@ abstract class TypedData {
|
|||
ByteBuffer get buffer;
|
||||
}
|
||||
|
||||
abstract class _TypedIntList extends TypedData {
|
||||
abstract final class _TypedIntList extends TypedData {
|
||||
/// Returns the concatenation of this list and [other].
|
||||
///
|
||||
/// If other is also a typed-data integer list, the returned list will
|
||||
|
@ -371,7 +371,7 @@ abstract class _TypedIntList extends TypedData {
|
|||
List<int> operator +(List<int> other);
|
||||
}
|
||||
|
||||
abstract class _TypedFloatList extends TypedData {
|
||||
abstract final class _TypedFloatList extends TypedData {
|
||||
/// Returns the concatenation of this list and [other].
|
||||
///
|
||||
/// If other is also a typed-data floating point number list,
|
||||
|
@ -386,7 +386,7 @@ abstract class _TypedFloatList extends TypedData {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Endian.
|
||||
class Endian {
|
||||
final class Endian {
|
||||
final bool _littleEndian;
|
||||
const Endian._(this._littleEndian);
|
||||
|
||||
|
@ -433,7 +433,7 @@ class Endian {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// ByteData.
|
||||
abstract class ByteData implements TypedData {
|
||||
abstract final class ByteData implements TypedData {
|
||||
/// Creates a [ByteData] of the specified length (in elements), all of
|
||||
/// whose bytes are initially zero.
|
||||
@pragma("vm:entry-point")
|
||||
|
@ -719,7 +719,7 @@ abstract class ByteData implements TypedData {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Int8List.
|
||||
abstract class Int8List implements List<int>, _TypedIntList {
|
||||
abstract final class Int8List implements List<int>, _TypedIntList {
|
||||
/// Creates an [Int8List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -832,7 +832,7 @@ abstract class Int8List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Uint8List.
|
||||
abstract class Uint8List implements List<int>, _TypedIntList {
|
||||
abstract final class Uint8List implements List<int>, _TypedIntList {
|
||||
/// Creates a [Uint8List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -952,7 +952,7 @@ abstract class Uint8List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Uint8ClampedList.
|
||||
abstract class Uint8ClampedList implements List<int>, _TypedIntList {
|
||||
abstract final class Uint8ClampedList implements List<int>, _TypedIntList {
|
||||
/// Creates a [Uint8ClampedList] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -1068,7 +1068,7 @@ abstract class Uint8ClampedList implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Int16List.
|
||||
abstract class Int16List implements List<int>, _TypedIntList {
|
||||
abstract final class Int16List implements List<int>, _TypedIntList {
|
||||
/// Creates an [Int16List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -1193,7 +1193,7 @@ abstract class Int16List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Uint16List.
|
||||
abstract class Uint16List implements List<int>, _TypedIntList {
|
||||
abstract final class Uint16List implements List<int>, _TypedIntList {
|
||||
/// Creates a [Uint16List] of the specified length (in elements), all
|
||||
/// of whose elements are initially zero.
|
||||
///
|
||||
|
@ -1319,7 +1319,7 @@ abstract class Uint16List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Int32List.
|
||||
abstract class Int32List implements List<int>, _TypedIntList {
|
||||
abstract final class Int32List implements List<int>, _TypedIntList {
|
||||
/// Creates an [Int32List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -1444,7 +1444,7 @@ abstract class Int32List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Uint32List.
|
||||
abstract class Uint32List implements List<int>, _TypedIntList {
|
||||
abstract final class Uint32List implements List<int>, _TypedIntList {
|
||||
/// Creates a [Uint32List] of the specified length (in elements), all
|
||||
/// of whose elements are initially zero.
|
||||
///
|
||||
|
@ -1570,7 +1570,7 @@ abstract class Uint32List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Int64List.
|
||||
abstract class Int64List implements List<int>, _TypedIntList {
|
||||
abstract final class Int64List implements List<int>, _TypedIntList {
|
||||
/// Creates an [Int64List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -1695,7 +1695,7 @@ abstract class Int64List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Uint64List.
|
||||
abstract class Uint64List implements List<int>, _TypedIntList {
|
||||
abstract final class Uint64List implements List<int>, _TypedIntList {
|
||||
/// Creates a [Uint64List] of the specified length (in elements), all
|
||||
/// of whose elements are initially zero.
|
||||
///
|
||||
|
@ -1822,7 +1822,7 @@ abstract class Uint64List implements List<int>, _TypedIntList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Float32List.
|
||||
abstract class Float32List implements List<double>, _TypedFloatList {
|
||||
abstract final class Float32List implements List<double>, _TypedFloatList {
|
||||
/// Creates a [Float32List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -1944,7 +1944,7 @@ abstract class Float32List implements List<double>, _TypedFloatList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Float64List.
|
||||
abstract class Float64List implements List<double>, _TypedFloatList {
|
||||
abstract final class Float64List implements List<double>, _TypedFloatList {
|
||||
/// Creates a [Float64List] of the specified length (in elements), all of
|
||||
/// whose elements are initially zero.
|
||||
///
|
||||
|
@ -2062,7 +2062,7 @@ abstract class Float64List implements List<double>, _TypedFloatList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Float32x4List.
|
||||
abstract class Float32x4List implements List<Float32x4>, TypedData {
|
||||
abstract final class Float32x4List implements List<Float32x4>, TypedData {
|
||||
/// Creates a [Float32x4List] of the specified length (in elements),
|
||||
/// all of whose elements are initially zero.
|
||||
///
|
||||
|
@ -2183,7 +2183,7 @@ abstract class Float32x4List implements List<Float32x4>, TypedData {
|
|||
///
|
||||
/// For long lists, this implementation will be considerably more
|
||||
/// space- and time-efficient than the default [List] implementation.
|
||||
abstract class Int32x4List implements List<Int32x4>, TypedData {
|
||||
abstract final class Int32x4List implements List<Int32x4>, TypedData {
|
||||
/// Creates a [Int32x4List] of the specified length (in elements),
|
||||
/// all of whose elements are initially zero.
|
||||
///
|
||||
|
@ -2307,7 +2307,7 @@ abstract class Int32x4List implements List<Int32x4>, TypedData {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Float64x2List.
|
||||
abstract class Float64x2List implements List<Float64x2>, TypedData {
|
||||
abstract final class Float64x2List implements List<Float64x2>, TypedData {
|
||||
/// Creates a [Float64x2List] of the specified length (in elements),
|
||||
/// all of whose elements have all lanes set to zero.
|
||||
///
|
||||
|
@ -2430,7 +2430,7 @@ abstract class Float64x2List implements List<Float64x2>, TypedData {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Float32x4.
|
||||
abstract class Float32x4 {
|
||||
abstract final class Float32x4 {
|
||||
external factory Float32x4(double x, double y, double z, double w);
|
||||
external factory Float32x4.splat(double v);
|
||||
external factory Float32x4.zero();
|
||||
|
@ -2800,7 +2800,7 @@ abstract class Float32x4 {
|
|||
///
|
||||
/// Int32x4 stores 4 32-bit bit-masks in "lanes".
|
||||
/// The lanes are "x", "y", "z", and "w" respectively.
|
||||
abstract class Int32x4 {
|
||||
abstract final class Int32x4 {
|
||||
external factory Int32x4(int x, int y, int z, int w);
|
||||
external factory Int32x4.bool(bool x, bool y, bool z, bool w);
|
||||
external factory Int32x4.fromFloat32x4Bits(Float32x4 x);
|
||||
|
@ -3154,7 +3154,7 @@ abstract class Int32x4 {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// Float64x2.
|
||||
abstract class Float64x2 {
|
||||
abstract final class Float64x2 {
|
||||
external factory Float64x2(double x, double y);
|
||||
external factory Float64x2.splat(double v);
|
||||
external factory Float64x2.zero();
|
||||
|
|
|
@ -8,7 +8,7 @@ part of dart.typed_data;
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableByteBufferView.
|
||||
abstract class UnmodifiableByteBufferView implements ByteBuffer {
|
||||
abstract final class UnmodifiableByteBufferView implements ByteBuffer {
|
||||
external factory UnmodifiableByteBufferView(ByteBuffer data);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ abstract class UnmodifiableByteBufferView implements ByteBuffer {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableByteDataView.
|
||||
abstract class UnmodifiableByteDataView implements ByteData {
|
||||
abstract final class UnmodifiableByteDataView implements ByteData {
|
||||
external factory UnmodifiableByteDataView(ByteData data);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ abstract class UnmodifiableByteDataView implements ByteData {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint8ListView.
|
||||
abstract class UnmodifiableUint8ListView implements Uint8List {
|
||||
abstract final class UnmodifiableUint8ListView implements Uint8List {
|
||||
external factory UnmodifiableUint8ListView(Uint8List list);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ abstract class UnmodifiableUint8ListView implements Uint8List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt8ListView.
|
||||
abstract class UnmodifiableInt8ListView implements Int8List {
|
||||
abstract final class UnmodifiableInt8ListView implements Int8List {
|
||||
external factory UnmodifiableInt8ListView(Int8List list);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ abstract class UnmodifiableInt8ListView implements Int8List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint8ClampedListView.
|
||||
abstract class UnmodifiableUint8ClampedListView implements Uint8ClampedList {
|
||||
abstract final class UnmodifiableUint8ClampedListView implements Uint8ClampedList {
|
||||
external factory UnmodifiableUint8ClampedListView(Uint8ClampedList list);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ abstract class UnmodifiableUint8ClampedListView implements Uint8ClampedList {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint16ListView.
|
||||
abstract class UnmodifiableUint16ListView implements Uint16List {
|
||||
abstract final class UnmodifiableUint16ListView implements Uint16List {
|
||||
external factory UnmodifiableUint16ListView(Uint16List list);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ abstract class UnmodifiableUint16ListView implements Uint16List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt16ListView.
|
||||
abstract class UnmodifiableInt16ListView implements Int16List {
|
||||
abstract final class UnmodifiableInt16ListView implements Int16List {
|
||||
external factory UnmodifiableInt16ListView(Int16List list);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ abstract class UnmodifiableInt16ListView implements Int16List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint32ListView.
|
||||
abstract class UnmodifiableUint32ListView implements Uint32List {
|
||||
abstract final class UnmodifiableUint32ListView implements Uint32List {
|
||||
external factory UnmodifiableUint32ListView(Uint32List list);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ abstract class UnmodifiableUint32ListView implements Uint32List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt32ListView.
|
||||
abstract class UnmodifiableInt32ListView implements Int32List {
|
||||
abstract final class UnmodifiableInt32ListView implements Int32List {
|
||||
external factory UnmodifiableInt32ListView(Int32List list);
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ abstract class UnmodifiableInt32ListView implements Int32List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableUint64ListView.
|
||||
abstract class UnmodifiableUint64ListView implements Uint64List {
|
||||
abstract final class UnmodifiableUint64ListView implements Uint64List {
|
||||
external factory UnmodifiableUint64ListView(Uint64List list);
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ abstract class UnmodifiableUint64ListView implements Uint64List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt64ListView.
|
||||
abstract class UnmodifiableInt64ListView implements Int64List {
|
||||
abstract final class UnmodifiableInt64ListView implements Int64List {
|
||||
external factory UnmodifiableInt64ListView(Int64List list);
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ abstract class UnmodifiableInt64ListView implements Int64List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableInt32x4ListView.
|
||||
abstract class UnmodifiableInt32x4ListView implements Int32x4List {
|
||||
abstract final class UnmodifiableInt32x4ListView implements Int32x4List {
|
||||
external factory UnmodifiableInt32x4ListView(Int32x4List list);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ abstract class UnmodifiableInt32x4ListView implements Int32x4List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat32x4ListView.
|
||||
abstract class UnmodifiableFloat32x4ListView implements Float32x4List {
|
||||
abstract final class UnmodifiableFloat32x4ListView implements Float32x4List {
|
||||
external factory UnmodifiableFloat32x4ListView(Float32x4List list);
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ abstract class UnmodifiableFloat32x4ListView implements Float32x4List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat64x2ListView.
|
||||
abstract class UnmodifiableFloat64x2ListView implements Float64x2List {
|
||||
abstract final class UnmodifiableFloat64x2ListView implements Float64x2List {
|
||||
external factory UnmodifiableFloat64x2ListView(Float64x2List list);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ abstract class UnmodifiableFloat64x2ListView implements Float64x2List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat32ListView.
|
||||
abstract class UnmodifiableFloat32ListView implements Float32List {
|
||||
abstract final class UnmodifiableFloat32ListView implements Float32List {
|
||||
external factory UnmodifiableFloat32ListView(Float32List list);
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,6 @@ abstract class UnmodifiableFloat32ListView implements Float32List {
|
|||
///
|
||||
/// It is a compile-time error for a class to attempt to extend or implement
|
||||
/// UnmodifiableFloat64ListView.
|
||||
abstract class UnmodifiableFloat64ListView implements Float64List {
|
||||
abstract final class UnmodifiableFloat64ListView implements Float64List {
|
||||
external factory UnmodifiableFloat64ListView(Float64List list);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// Introduce an aliased type.
|
||||
|
@ -20,6 +19,26 @@ abstract class C {
|
|||
// [cfe] unspecified
|
||||
}
|
||||
|
||||
class D1<X> extends T<X> {}
|
||||
// ^^^^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D2 extends C with T<int> {}
|
||||
// ^^^^^^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D3<X, Y> implements T<T> {}
|
||||
// ^^^^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D4 = C with T<void>;
|
||||
// ^^^^^^^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
X foo<X>(X x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// Introduce an aliased type.
|
||||
|
@ -43,11 +42,6 @@ class C1 implements C {
|
|||
noSuchMethod(Invocation invocation) => throw 0;
|
||||
}
|
||||
|
||||
class D1<X> extends T<X> {}
|
||||
abstract class D2 extends C with T<int> {}
|
||||
abstract class D3<X, Y> implements T<T> {}
|
||||
abstract class D4 = C with T<void>;
|
||||
|
||||
extension E on T<dynamic> {
|
||||
T<dynamic> foo(T<dynamic> t) => t;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,17 @@ abstract class C {
|
|||
// [cfe] unspecified
|
||||
}
|
||||
|
||||
abstract class D2 extends C with T {}
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D4 = C with T;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
|
||||
X foo<X>(X x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// @dart = 2.9
|
||||
// Requirements=nnbd-weak
|
||||
|
||||
|
||||
// Test that a generic type alias `T` denoting `Function`
|
||||
// can give rise to the expected erros.
|
||||
|
||||
|
@ -47,12 +46,8 @@ class C1 implements C {
|
|||
|
||||
class D1<X> extends T<X> {}
|
||||
|
||||
abstract class D2 extends C with T<int> {}
|
||||
|
||||
abstract class D3<X, Y> implements T<T> {}
|
||||
|
||||
abstract class D4 = C with T<void>;
|
||||
|
||||
extension E on T<dynamic> {
|
||||
T<dynamic> foo(T<dynamic> t) => t;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
// @dart = 2.9
|
||||
// Requirements=nnbd-weak
|
||||
|
||||
|
||||
// Test that a type alias `T` denoting `Function` can be used.
|
||||
|
||||
import 'usage_function_lib.dart';
|
||||
|
@ -45,12 +44,8 @@ class C1 implements C {
|
|||
|
||||
class D1 extends T {}
|
||||
|
||||
abstract class D2 extends C with T {}
|
||||
|
||||
abstract class D3 implements T {}
|
||||
|
||||
abstract class D4 = C with T;
|
||||
|
||||
extension E on T {
|
||||
T foo(T t) => t;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
// Introduce an aliased type.
|
||||
|
||||
typedef T = Function;
|
||||
|
@ -18,6 +17,26 @@ abstract class C {
|
|||
// [cfe] unspecified
|
||||
}
|
||||
|
||||
class D1<X> extends T {}
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D2 extends C with T {}
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D3<X, Y> implements T {}
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
abstract class D4 = C with T;
|
||||
// ^
|
||||
// [analyzer] unspecified
|
||||
// [cfe] unspecified
|
||||
|
||||
X foo<X>(X x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
|
||||
// Introduce an aliased type.
|
||||
|
||||
typedef T = Function;
|
||||
|
@ -41,14 +40,6 @@ class C1 implements C {
|
|||
noSuchMethod(Invocation invocation) => throw 0;
|
||||
}
|
||||
|
||||
// Awaiting updates in front end to handle crash caused by null from
|
||||
// `ClassHierarchyBuilder.getKernelTypeAsInstanceOf`. So for now the
|
||||
// following are multi-test cases, so that the rest can be tested.
|
||||
class D1 extends T {} //# 01: ok
|
||||
abstract class D2 extends C with T {} //# 02: ok
|
||||
abstract class D3 implements T {} //# 03: ok
|
||||
abstract class D4 = C with T; //# 04: ok
|
||||
|
||||
extension E on T {
|
||||
T foo(T t) => t;
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
|
|||
// items in the MEMBERS set if you want that functionality.
|
||||
}
|
||||
|
||||
abstract class CssStyleDeclarationBase {
|
||||
abstract mixin class CssStyleDeclarationBase {
|
||||
String getPropertyValue(String propertyName);
|
||||
void setProperty(String propertyName, String$NULLABLE value,
|
||||
[String$NULLABLE priority]);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
part of dart.dom.html;
|
||||
|
||||
abstract class ImmutableListMixin<E> implements List<E> {
|
||||
abstract mixin class ImmutableListMixin<E> implements List<E> {
|
||||
// From Iterable<$E>:
|
||||
Iterator<E> get iterator {
|
||||
// Note: NodeLists are not fixed size. And most probably length shouldn't
|
||||
|
|
|
@ -1855,7 +1855,7 @@ class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
|
|||
// items in the MEMBERS set if you want that functionality.
|
||||
}
|
||||
|
||||
abstract class CssStyleDeclarationBase {
|
||||
abstract mixin class CssStyleDeclarationBase {
|
||||
String getPropertyValue(String propertyName);
|
||||
void setProperty(String propertyName, String$NULLABLE value,
|
||||
[String$NULLABLE priority]);
|
||||
|
|
|
@ -142,9 +142,11 @@ features:
|
|||
|
||||
sealed-class:
|
||||
help: "Sealed class"
|
||||
experimentalReleaseVersion: "3.0.0"
|
||||
|
||||
class-modifiers:
|
||||
help: "Class modifiers"
|
||||
experimentalReleaseVersion: "3.0.0"
|
||||
|
||||
# Experiment flag only used for testing.
|
||||
test-experiment:
|
||||
|
|
Loading…
Reference in a new issue