mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:03:19 +00:00
Replace package:expect annotations with @pragma
Change-Id: Ib43d0d71a3ee8b0f0e6d676e6a3e448a107b7ca5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95180 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
parent
45e6f83cd6
commit
204651f3ab
|
@ -486,10 +486,6 @@ abstract class CommonElements {
|
|||
|
||||
ClassEntity get jsGetNameEnum;
|
||||
|
||||
ClassEntity get expectNoInlineClass;
|
||||
|
||||
ClassEntity get expectAssumeDynamicClass;
|
||||
|
||||
/// Returns `true` if [member] is a "foreign helper", that is, a member whose
|
||||
/// semantics is defined synthetically and not through Dart code.
|
||||
///
|
||||
|
@ -1724,39 +1720,6 @@ class CommonElementsImpl
|
|||
_env.lookupLibrary(Uris.dart__js_embedded_names, required: true),
|
||||
'JsBuiltin');
|
||||
|
||||
static final Uri PACKAGE_EXPECT =
|
||||
new Uri(scheme: 'package', path: 'expect/expect.dart');
|
||||
|
||||
bool _expectAnnotationChecked = false;
|
||||
ClassEntity _expectNoInlineClass;
|
||||
ClassEntity _expectAssumeDynamicClass;
|
||||
|
||||
void _ensureExpectAnnotations() {
|
||||
if (!_expectAnnotationChecked) {
|
||||
_expectAnnotationChecked = true;
|
||||
LibraryEntity library = _env.lookupLibrary(PACKAGE_EXPECT);
|
||||
if (library != null) {
|
||||
_expectNoInlineClass = _env.lookupClass(library, 'NoInline');
|
||||
_expectAssumeDynamicClass = _env.lookupClass(library, 'AssumeDynamic');
|
||||
if (_expectNoInlineClass == null || _expectAssumeDynamicClass == null) {
|
||||
// This is not the package you're looking for.
|
||||
_expectNoInlineClass = null;
|
||||
_expectAssumeDynamicClass = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ClassEntity get expectNoInlineClass {
|
||||
_ensureExpectAnnotations();
|
||||
return _expectNoInlineClass;
|
||||
}
|
||||
|
||||
ClassEntity get expectAssumeDynamicClass {
|
||||
_ensureExpectAnnotations();
|
||||
return _expectAssumeDynamicClass;
|
||||
}
|
||||
|
||||
static final Uri PACKAGE_META_DART2JS =
|
||||
new Uri(scheme: 'package', path: 'meta/dart2js.dart');
|
||||
|
||||
|
|
|
@ -14,28 +14,6 @@ import '../options.dart';
|
|||
import '../serialization/serialization.dart';
|
||||
import '../util/enumset.dart';
|
||||
|
||||
/// Returns `true` if inference of parameter types is disabled for [element].
|
||||
bool _assumeDynamic(KElementEnvironment elementEnvironment,
|
||||
KCommonElements commonElements, MemberEntity element) {
|
||||
return _hasAnnotation(
|
||||
elementEnvironment, element, commonElements.expectAssumeDynamicClass);
|
||||
}
|
||||
|
||||
/// Returns `true` if [element] is annotated with [annotationClass].
|
||||
bool _hasAnnotation(KElementEnvironment elementEnvironment,
|
||||
MemberEntity element, ClassEntity annotationClass) {
|
||||
if (annotationClass == null) return false;
|
||||
for (ConstantValue value in elementEnvironment.getMemberMetadata(element)) {
|
||||
if (value.isConstructedObject) {
|
||||
ConstructedConstantValue constructedConstant = value;
|
||||
if (constructedConstant.type.element == annotationClass) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class PragmaAnnotation {
|
||||
final int _index;
|
||||
final String name;
|
||||
|
@ -81,13 +59,12 @@ class PragmaAnnotation {
|
|||
5, 'noSideEffects',
|
||||
forFunctionsOnly: true, internalOnly: true);
|
||||
|
||||
// TODO(johnniwinther): Remove this.
|
||||
static const PragmaAnnotation trustTypeAnnotations = const PragmaAnnotation(
|
||||
6, 'trustTypeAnnotations',
|
||||
forFunctionsOnly: true, internalOnly: true);
|
||||
|
||||
/// Use this as metadata on method declarations to disable closed world
|
||||
/// assumptions on parameters, effectively assuming that the runtime arguments
|
||||
/// could be any value. Note that the constraints due to static types still
|
||||
/// apply.
|
||||
static const PragmaAnnotation assumeDynamic = const PragmaAnnotation(
|
||||
7, 'assumeDynamic',
|
||||
6, 'assumeDynamic',
|
||||
forFunctionsOnly: true, internalOnly: true);
|
||||
|
||||
static const List<PragmaAnnotation> values = [
|
||||
|
@ -97,7 +74,6 @@ class PragmaAnnotation {
|
|||
noElision,
|
||||
noThrows,
|
||||
noSideEffects,
|
||||
trustTypeAnnotations,
|
||||
assumeDynamic,
|
||||
];
|
||||
}
|
||||
|
@ -111,10 +87,6 @@ Set<PragmaAnnotation> processMemberAnnotations(
|
|||
MemberEntity element) {
|
||||
EnumSet<PragmaAnnotation> values = new EnumSet<PragmaAnnotation>();
|
||||
|
||||
if (_assumeDynamic(elementEnvironment, commonElements, element)) {
|
||||
values.add(PragmaAnnotation.assumeDynamic);
|
||||
}
|
||||
|
||||
LibraryEntity library = element.library;
|
||||
bool platformAnnotationsAllowed = options.testMode ||
|
||||
library.canonicalUri.scheme == 'dart' ||
|
||||
|
@ -139,13 +111,7 @@ Set<PragmaAnnotation> processMemberAnnotations(
|
|||
}
|
||||
}
|
||||
|
||||
if (cls == commonElements.expectNoInlineClass) {
|
||||
values.add(PragmaAnnotation.noInline);
|
||||
if (element is! FunctionEntity) {
|
||||
reporter.internalError(element,
|
||||
"@pragma('dart2js:noInline') is only allowed in methods and constructors.");
|
||||
}
|
||||
} else if (cls == commonElements.metaNoInlineClass) {
|
||||
if (cls == commonElements.metaNoInlineClass) {
|
||||
values.add(PragmaAnnotation.noInline);
|
||||
if (element is! FunctionEntity) {
|
||||
reporter.internalError(
|
||||
|
@ -237,7 +203,7 @@ abstract class AnnotationsData {
|
|||
/// Serializes this [AnnotationsData] to [sink].
|
||||
void writeToDataSink(DataSink sink);
|
||||
|
||||
/// Returns `true` if [member] has an `@AssumeDynamic()` annotation.
|
||||
/// Returns `true` if [member] has an `@pragma('dart2js:assumeDynamic')` annotation.
|
||||
bool hasAssumeDynamic(MemberEntity member);
|
||||
|
||||
/// Returns `true` if [member] has a `@noInline`, or
|
||||
|
|
|
@ -668,20 +668,6 @@ class ExpectException implements Exception {
|
|||
String toString() => message;
|
||||
}
|
||||
|
||||
/// Annotation class for testing of dart2js. Use this as metadata on method
|
||||
/// declarations to disable inlining of the annotated method.
|
||||
class NoInline {
|
||||
const NoInline();
|
||||
}
|
||||
|
||||
/// Annotation class for testing of dart2js. Use this as metadata on method
|
||||
/// declarations to disable closed world assumptions on parameters, effectively
|
||||
/// assuming that the runtime arguments could be any value. Note that the
|
||||
/// constraints due to [TrustTypeAnnotations] still apply.
|
||||
class AssumeDynamic {
|
||||
const AssumeDynamic();
|
||||
}
|
||||
|
||||
/// Is true iff type assertions are enabled.
|
||||
// TODO(rnystrom): Remove this once all tests are no longer using it.
|
||||
final bool typeAssertionsEnabled = (() {
|
||||
|
|
|
@ -125,40 +125,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -144,40 +144,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -177,40 +177,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -299,40 +299,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -143,40 +143,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -125,40 +125,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -186,40 +186,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -196,40 +196,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -180,40 +180,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -125,40 +125,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -183,40 +183,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -183,40 +183,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -162,40 +162,6 @@ ExpectException:
|
|||
Object.==
|
||||
interfaceSetters:
|
||||
|
||||
NoInline:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
AssumeDynamic:
|
||||
superclasses:
|
||||
Object
|
||||
interfaces:
|
||||
classMembers:
|
||||
Object.toString
|
||||
Object.runtimeType
|
||||
Object._simpleInstanceOf
|
||||
Object._instanceOf
|
||||
Object.noSuchMethod
|
||||
Object._identityHashCode
|
||||
Object.hashCode
|
||||
Object._simpleInstanceOfFalse
|
||||
Object._simpleInstanceOfTrue
|
||||
Object.==
|
||||
classSetters:
|
||||
|
||||
Immutable:
|
||||
superclasses:
|
||||
Object
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import 'package:expect/expect.dart';
|
||||
import 'package:async_helper/async_helper.dart';
|
||||
import 'package:compiler/src/compiler.dart';
|
||||
import 'package:compiler/src/commandline_options.dart';
|
||||
import 'package:compiler/src/elements/entities.dart';
|
||||
import 'package:compiler/src/inferrer/typemasks/masks.dart';
|
||||
import 'package:compiler/src/inferrer/types.dart';
|
||||
|
@ -18,7 +19,7 @@ import 'package:expect/expect.dart';
|
|||
|
||||
int method(String arg) => arg.length;
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
int methodAssumeDynamic(String arg) => arg.length;
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
|
@ -39,15 +40,11 @@ main() {
|
|||
}
|
||||
|
||||
runTest() async {
|
||||
CompilationResult result =
|
||||
await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
|
||||
CompilationResult result = await runCompiler(
|
||||
memorySourceFiles: MEMORY_SOURCE_FILES, options: [Flags.testMode]);
|
||||
Compiler compiler = result.compiler;
|
||||
JClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
|
||||
Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation');
|
||||
Expect.isNotNull(closedWorld.commonElements.expectNoInlineClass,
|
||||
'NoInlineClass is unresolved.');
|
||||
Expect.isNotNull(closedWorld.commonElements.expectAssumeDynamicClass,
|
||||
'AssumeDynamicClass is unresolved.');
|
||||
|
||||
void testTypeMatch(FunctionEntity function, TypeMask expectedParameterType,
|
||||
TypeMask expectedReturnType, GlobalTypeInferenceResults results) {
|
||||
|
@ -80,7 +77,8 @@ runTest() async {
|
|||
Expect.equals(
|
||||
expectAssumeDynamic,
|
||||
closedWorld.annotationsData.hasAssumeDynamic(method),
|
||||
"Unexpected annotation of @AssumeDynamic() on '$method'.");
|
||||
"Unexpected annotation of @pragma('dart2js:assumeDynamic') on "
|
||||
"'$method'.");
|
||||
GlobalTypeInferenceResults results =
|
||||
compiler.globalInference.resultsForTesting;
|
||||
if (expectAssumeDynamic) {
|
||||
|
|
|
@ -2,8 +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 'package:expect/expect.dart';
|
||||
|
||||
/*element: main:[null]*/
|
||||
main() {
|
||||
assumeDynamic();
|
||||
|
@ -21,7 +19,7 @@ main() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: _assumeDynamic:[null|subclass=Object]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
_assumeDynamic(/*[null|subclass=Object]*/ o) => o;
|
||||
|
||||
/*element: assumeDynamic:[null]*/
|
||||
|
|
|
@ -2,8 +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 'package:expect/expect.dart';
|
||||
|
||||
/*element: main:[null]*/
|
||||
main() {
|
||||
refineToClass();
|
||||
|
@ -98,7 +96,7 @@ _noRefinementUpdatedVariable(/*[null|exact=Class1]*/ o) {
|
|||
}
|
||||
|
||||
/*element: _condition:Value([exact=JSBool], value: false)*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
get _condition => false;
|
||||
|
||||
/*element: refineToClass:[null]*/
|
||||
|
|
|
@ -2,8 +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 'package:expect/expect.dart';
|
||||
|
||||
/*element: Class.:[exact=Class]*/
|
||||
class Class {
|
||||
/*element: Class.field:[exact=JSUInt31]*/
|
||||
|
@ -34,7 +32,7 @@ main() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: statementOrderFieldAccess:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
statementOrderFieldAccess(/*[null|subclass=Object]*/ o) {
|
||||
o.field;
|
||||
o. /*[subclass=Object]*/ field;
|
||||
|
@ -45,7 +43,7 @@ statementOrderFieldAccess(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: statementOrderFieldUpdate:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
statementOrderFieldUpdate(/*[null|subclass=Object]*/ o) {
|
||||
o.field = 42;
|
||||
o. /*update: [subclass=Object]*/ field = 42;
|
||||
|
@ -56,7 +54,7 @@ statementOrderFieldUpdate(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: statementOrderInvocation:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
statementOrderInvocation(/*[null|subclass=Object]*/ o) {
|
||||
o.method(null);
|
||||
o. /*invoke: [subclass=Object]*/ method(null);
|
||||
|
@ -67,7 +65,7 @@ statementOrderInvocation(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: receiverVsArgument:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
receiverVsArgument(/*[null|subclass=Object]*/ o) {
|
||||
// TODO(johnniwinther): The arguments should refine the receiver.
|
||||
o.method(o.field);
|
||||
|
@ -79,7 +77,7 @@ receiverVsArgument(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: argumentsOrder:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
argumentsOrder(/*[null|subclass=Object]*/ o) {
|
||||
// TODO(johnniwinther): The arguments should refine the receiver.
|
||||
o.method(o.field, o. /*[subclass=Object]*/ field);
|
||||
|
@ -91,7 +89,7 @@ argumentsOrder(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: operatorOrder:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
operatorOrder(/*[null|subclass=Object]*/ o) {
|
||||
o.field /*invoke: [exact=JSUInt31]*/ < o. /*[subclass=Object]*/ field;
|
||||
o. /*[subclass=Object]*/ field;
|
||||
|
@ -102,7 +100,7 @@ operatorOrder(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: updateVsRhs:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
updateVsRhs(/*[null|subclass=Object]*/ o) {
|
||||
// TODO(johnniwinther): The right-hand side should refine the left-hand side
|
||||
// receiver.
|
||||
|
@ -115,7 +113,7 @@ updateVsRhs(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: logicalOr:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
logicalOr(/*[null|subclass=Object]*/ o) {
|
||||
o.field || o. /*[subclass=Object]*/ field;
|
||||
o. /*[subclass=Object]*/ field;
|
||||
|
@ -126,7 +124,7 @@ logicalOr(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: conditionalCondition:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
conditionalCondition(/*[null|subclass=Object]*/ o) {
|
||||
o.field ? o. /*[subclass=Object]*/ field : o. /*[subclass=Object]*/ field;
|
||||
o. /*[subclass=Object]*/ field;
|
||||
|
@ -137,7 +135,7 @@ conditionalCondition(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: conditionalBothBranches:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
conditionalBothBranches(/*[null|subclass=Object]*/ o) {
|
||||
// ignore: DEAD_CODE
|
||||
true ? o.field : o.field;
|
||||
|
@ -149,7 +147,7 @@ conditionalBothBranches(/*[null|subclass=Object]*/ o) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*element: conditionalOneBranchOnly:[null]*/
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
conditionalOneBranchOnly(/*[null|subclass=Object]*/ o) {
|
||||
// ignore: DEAD_CODE
|
||||
true ? o.field : null;
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
|
||||
// Test constant folding on numbers.
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
int confuse(int x) => x;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class S<Y> {
|
|||
class TS<A, B> = T<A> with S<B>;
|
||||
|
||||
@pragma('dart2js:noInline')
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
dyn(x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -9,14 +9,12 @@
|
|||
// Kind of minified name: instance
|
||||
// Expected deobfuscated name: m1
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
dynamic x = confuse(new B());
|
||||
x.m1();
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
||||
|
|
|
@ -6,15 +6,13 @@
|
|||
// Kind of minified name: instance
|
||||
// Expected deobfuscated name: m1
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
confuse(new A());
|
||||
dynamic x = confuse(new B());
|
||||
x.m1();
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
||||
|
|
|
@ -6,15 +6,13 @@
|
|||
// Kind of minified name: global
|
||||
// Expected deobfuscated name: B
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
confuse(new A());
|
||||
dynamic x = confuse(new B());
|
||||
x.m1();
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
// Kind of minified name: instance
|
||||
// Expected deobfuscated name: g1
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
try {
|
||||
confuse(new A());
|
||||
|
@ -18,7 +16,7 @@ main() {
|
|||
}
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
// Kind of minified name: instance
|
||||
// Expected deobfuscated name: g1=
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
try {
|
||||
confuse(new A());
|
||||
|
@ -18,7 +16,7 @@ main() {
|
|||
}
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ checkExpectation(MinifiedNameTest test, bool minified) async {
|
|||
print('-- ${minified ? 'minified' : 'not-minified'}:');
|
||||
D8Result result = await runWithD8(
|
||||
memorySourceFiles: {'main.dart': test.code},
|
||||
options: minified ? [Flags.minify] : []);
|
||||
options: minified ? [Flags.minify, Flags.testMode] : [Flags.testMode]);
|
||||
String stdout = result.runResult.stdout;
|
||||
String error = _extractError(stdout);
|
||||
print(' error: $error');
|
||||
|
|
|
@ -17,6 +17,6 @@ main() {
|
|||
}
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
id(x) => x;
|
||||
|
|
|
@ -11,8 +11,8 @@ import 'package:expect/expect.dart';
|
|||
foo([a = '\u00a0']) => a;
|
||||
bar() => '';
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -15,8 +15,8 @@ class N {
|
|||
}
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
get NEVER => false;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// Used to fail when methods contain a name starting with `get`
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class MA {
|
||||
|
|
|
@ -16,8 +16,8 @@ class C<T> {
|
|||
Map<String, ItemListFilter<T>> f = {};
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -14,7 +14,7 @@ class D {
|
|||
foo<U, V>() => [U, V];
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(dynamic x) {
|
||||
dynamic typeArguments = x.foo<int, String>();
|
||||
Expect.equals(int, typeArguments[0]);
|
||||
|
|
|
@ -19,12 +19,12 @@ typedef Converter<V> ConvertFactory<V>(int input);
|
|||
|
||||
class B<W> {
|
||||
final field = new Wrap<ConvertFactory<W>>();
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
B();
|
||||
}
|
||||
|
||||
class Wrap<X> {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
Wrap();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
||||
testFalse(name, fault) {
|
||||
|
|
|
@ -12,7 +12,7 @@ class A {
|
|||
|
||||
factory A(a, x) = A.q;
|
||||
|
||||
// @NoInline() // This annotation causes the test to compile on SSA backend.
|
||||
// @pragma('dart2js:noInline') // This annotation causes the test to compile on SSA backend.
|
||||
A.q(this.a, x) : b = x == null ? null : new W(x);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,6 @@ main() {
|
|||
}
|
||||
|
||||
class Class {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method<T extends num>() => null;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@ main() {
|
|||
}
|
||||
|
||||
class Class<T> {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method<S extends T>() => null;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@ main() {
|
|||
}
|
||||
|
||||
class Class {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method<S extends num>() => S;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@ main() {
|
|||
}
|
||||
|
||||
class Class<T> {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method<S extends T>() => S;
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@ class A<T> {
|
|||
}
|
||||
|
||||
class B<T> {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
m(f) => f is Function(T);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
create() => new B<A<int>>();
|
||||
|
||||
main() {
|
||||
|
|
|
@ -12,7 +12,7 @@ class B {
|
|||
int field;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
assign(d) {
|
||||
d.field = 0;
|
||||
}
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
import 'package:expect/expect.dart';
|
||||
|
||||
class A<T> {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
m() {
|
||||
return (T t, String s) {};
|
||||
}
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is void Function(int);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
// SharedOptions=--enable-null-aware-operators
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class A {
|
||||
|
|
|
@ -6,8 +6,8 @@ import "package:expect/expect.dart";
|
|||
|
||||
// Test that optimized '+' and slow path '+' produce the same error.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
void check2(String name, name1, f1, name2, f2) {
|
||||
|
|
|
@ -7,8 +7,8 @@ import "package:expect/expect.dart";
|
|||
// Test that optimized codeUnitAt and slow path codeUnitAt produce the same
|
||||
// error.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
void check2(String name, name1, f1, name2, f2) {
|
||||
|
|
|
@ -7,8 +7,8 @@ import "dart:typed_data";
|
|||
|
||||
// Test that optimized indexing and slow path indexing produce the same error.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class TooHigh {
|
||||
|
|
|
@ -7,8 +7,8 @@ import "dart:typed_data";
|
|||
|
||||
// Test that optimized indexing and slow path indexing produce the same error.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class TooHigh {
|
||||
|
|
|
@ -7,8 +7,8 @@ import "dart:typed_data";
|
|||
|
||||
// Test that optimized indexing and slow path indexing produce the same error.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class TooHigh {
|
||||
|
|
|
@ -8,8 +8,8 @@ import "package:expect/expect.dart";
|
|||
//
|
||||
// They don't, sometimes we generate null.$add, sometimes JSNull_methods.$add.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
void check2(String name, name1, f1, name2, f2) {
|
||||
|
|
|
@ -8,8 +8,8 @@ import "package:expect/expect.dart";
|
|||
|
||||
// Test that optimized '-' and slow path '-' produce the same error.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
void check2(String name, name1, f1, name2, f2) {
|
||||
|
|
|
@ -16,5 +16,5 @@ main() {
|
|||
});
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
dontInline(x) => x;
|
||||
|
|
|
@ -17,5 +17,5 @@ main() async {
|
|||
Expect.isFalse(confuse(a.A) == confuse(a.B));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
|
|
@ -19,5 +19,5 @@ main() async {
|
|||
Expect.isFalse(confuse(a.C) == confuse(a.D));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
confuse(x) => x;
|
||||
|
|
|
@ -16,5 +16,5 @@ main() {
|
|||
});
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
dontInline(x) => x;
|
||||
|
|
|
@ -18,8 +18,8 @@ class B extends A {}
|
|||
/// If the check `y is A` is generated as `y.$isA` then the issue is not
|
||||
/// exposed. We use `AssumeDynamic` to ensure that we generate as `y instanceof
|
||||
/// A` in JS.
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
check(y) => Expect.isTrue(y is A);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -17,7 +17,7 @@ class D {
|
|||
dynamic f2 = new C2();
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
id(o) => o;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -19,7 +19,7 @@ class SuperClass<T> extends Object with Mixin<T> {}
|
|||
|
||||
class Class extends SuperClass<int> {}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
createClass() => new Class();
|
||||
|
||||
main() {
|
||||
|
|
|
@ -22,7 +22,7 @@ class SuperClass<T> {
|
|||
|
||||
class Class extends SuperClass<int> {}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
createClass() => new Class();
|
||||
|
||||
main() {
|
||||
|
|
|
@ -23,7 +23,7 @@ class SuperClass<T> extends SuperSuperClass<T> {
|
|||
|
||||
class Class extends SuperClass<int> {}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
createClass() => new Class();
|
||||
|
||||
main() {
|
||||
|
|
|
@ -13,16 +13,16 @@ class C<T> {}
|
|||
class D {}
|
||||
|
||||
class E {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
m<T>() => new C<T>();
|
||||
}
|
||||
|
||||
class F {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
m<T>() => false;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is C<A>;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -12,10 +12,10 @@ class C<T> {}
|
|||
|
||||
class D {}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
m<T>() => new C<T>();
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is C<A>;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -7,8 +7,8 @@ import "package:expect/expect.dart";
|
|||
// dart2js specific test to make sure hashCode on intercepted types behaves as
|
||||
// intended.
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class Hasher {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
main(args) {
|
||||
|
|
|
@ -7,30 +7,30 @@
|
|||
import 'package:expect/expect.dart';
|
||||
|
||||
// This needs one-arg instantiation.
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
T f1a<T>(T t) => t;
|
||||
|
||||
// This needs no instantiation because it is not closurized.
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
T f1b<T>(T t1, T t2) => t1;
|
||||
|
||||
class Class {
|
||||
// This needs two-arg instantiation.
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
bool f2a<T, S>(T t, S s) => t == s;
|
||||
|
||||
// This needs no instantiation because it is not closurized.
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
bool f2b<T, S>(T t, S s1, S s2) => t == s1;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int method1(int i, int Function(int) f) => f(i);
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
bool method2(int a, int b, bool Function(int, int) f) => f(a, b);
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int method3(int a, int b, int c, int Function(int, int, int) f) => f(a, b, c);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -19,27 +19,27 @@ class Other {
|
|||
}
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
bool wontTell(bool x) => x;
|
||||
|
||||
// Ensure that we use the interceptor only once per context so that we
|
||||
// actually get a one-shot interceptor. This is a little brittle...
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
testA(thing) {
|
||||
Expect.equals(0, thing.createFragment(null));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
testB(thing) {
|
||||
Expect.equals(2, thing.createFragment(null, validator: 1));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
testC(thing) {
|
||||
Expect.equals(1, thing.createFragment(null, treeSanitizer: 1));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
testD(thing) {
|
||||
Expect.equals(3, thing.createFragment(null, validator: 1, treeSanitizer: 1));
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
Error getError(action(), name, part) {
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
Error getError(action()) {
|
||||
|
|
|
@ -11,7 +11,7 @@ method1() {
|
|||
return local;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is S Function<S>(S);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -92,7 +92,7 @@ num Function(num) //# 01: continued
|
|||
return local;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is num Function(num);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -44,7 +44,7 @@ class Class4<T> {
|
|||
}
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is num Function(num);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test1(o) => o is Function(int);
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test2(o) => o is Function<T>(T);
|
||||
|
||||
class C<S> {
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(bool expected) {
|
||||
local1(int i) {}
|
||||
local2<T>(T t) {}
|
||||
|
|
|
@ -32,7 +32,7 @@ T method8<T>(num n) => null;
|
|||
|
||||
num method9<T>(num n, T t) => null;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is num Function(num);
|
||||
|
||||
forceInstantiation(num Function(num) f) => f;
|
||||
|
|
|
@ -32,7 +32,7 @@ num method8(int n) => null;
|
|||
|
||||
Object method9(num n) => null;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o is num Function(num);
|
||||
|
||||
main() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
num minusZero() => -0;
|
||||
|
||||
void main() {
|
||||
|
|
|
@ -36,7 +36,7 @@ class D5 extends C with M5 {}
|
|||
|
||||
class E5 extends D5 {}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) {}
|
||||
|
||||
main() {
|
||||
|
@ -50,4 +50,4 @@ main() {
|
|||
Expect.subtype<D4, M4>();
|
||||
Expect.subtype<D5, M5>();
|
||||
Expect.subtype<E5, M5>();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ abstract class B {}
|
|||
|
||||
class C = B with A;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => o.runtimeType;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -36,6 +36,6 @@ main() {
|
|||
Expect.equals(-1, (a._m4)());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
asNum(x) {
|
||||
var result = confuse(x);
|
||||
if (result is num) return result;
|
||||
throw new ArgumentError.value(x);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
uint31(x) {
|
||||
var result = confuse(x);
|
||||
if (x is int) {
|
||||
|
@ -25,7 +25,7 @@ uint31(x) {
|
|||
throw new ArgumentError('Not uint31: $x');
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
uint32(x) {
|
||||
var result = confuse(x);
|
||||
if (x is int) {
|
||||
|
@ -35,67 +35,67 @@ uint32(x) {
|
|||
throw new ArgumentError('Not uint32: $x');
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int zero() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int one() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int minus1() {
|
||||
return 0 - 1;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int minus2() {
|
||||
return 0 - 2;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int two() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int three() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int five() {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int minus5() {
|
||||
return 0 - 5;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int ninetyNine() {
|
||||
return 99;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int four99() {
|
||||
return 499;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int four99times99() {
|
||||
return 499 * 99;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
int four99times99plus1() {
|
||||
return 499 * 99 + 1;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void addTest() {
|
||||
var m1 = 0 - 1;
|
||||
Expect.equals(0, 0 + 0);
|
||||
|
@ -111,7 +111,7 @@ void addTest() {
|
|||
Expect.equals(2, one() + one());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void subTest() {
|
||||
var m1 = 0 - 1;
|
||||
Expect.equals(0, 0 - 0);
|
||||
|
@ -123,7 +123,7 @@ void subTest() {
|
|||
Expect.equals(0, one() - one());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void mulTest() {
|
||||
var m1 = 0 - 1;
|
||||
Expect.equals(0, 0 * 0);
|
||||
|
@ -135,7 +135,7 @@ void mulTest() {
|
|||
Expect.equals(49401, four99() * 99);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void divTest() {
|
||||
var m1 = 0.0 - 1.0;
|
||||
var m2 = 0 - 2;
|
||||
|
@ -158,7 +158,7 @@ void divTest() {
|
|||
Expect.equals(1.5, confuse(150) / confuse(100));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void tdivTest() {
|
||||
var m1 = 0 - 1;
|
||||
var m2 = 0 - 2;
|
||||
|
@ -232,7 +232,7 @@ void tdivTest() {
|
|||
Expect.throws(() => double.nan ~/ 2);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void modTest() {
|
||||
var m5 = 0 - 5;
|
||||
var m3 = 0 - 3;
|
||||
|
@ -250,7 +250,7 @@ void modTest() {
|
|||
Expect.equals(2, five() % m3);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void remainderTest() {
|
||||
var m5 = 0 - 5;
|
||||
Expect.equals(2, confuse(5).remainder(3));
|
||||
|
@ -279,7 +279,7 @@ void remainderTest() {
|
|||
Expect.equals(2, five().remainder(-3));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void shlTest() {
|
||||
Expect.equals(2, 1 << 1);
|
||||
Expect.equals(8, 1 << 3);
|
||||
|
@ -298,7 +298,7 @@ void shlTest() {
|
|||
Expect.equals(24, 3 << asNum(3));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void shrTest() {
|
||||
Expect.equals(1, 2 >> 1);
|
||||
Expect.equals(1, 8 >> 3);
|
||||
|
@ -318,7 +318,7 @@ void shrTest() {
|
|||
Expect.equals(0, asNum(0xffffffff) >> 32);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void andTest() {
|
||||
Expect.equals(2, 10 & 3);
|
||||
Expect.equals(7, 15 & 7);
|
||||
|
@ -332,7 +332,7 @@ void andTest() {
|
|||
Expect.equals(0, asNum(0x7ffffffe) & asNum(1));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void orTest() {
|
||||
Expect.equals(11, 10 | 3);
|
||||
Expect.equals(15, 15 | 7);
|
||||
|
@ -346,7 +346,7 @@ void orTest() {
|
|||
Expect.equals(10, asNum(10) | 10);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void xorTest() {
|
||||
Expect.equals(9, 10 ^ 3);
|
||||
Expect.equals(8, 15 ^ 7);
|
||||
|
@ -358,12 +358,12 @@ void xorTest() {
|
|||
Expect.equals(6, minus5() ^ -3);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void notTest() {
|
||||
Expect.equals(4, ~minus5());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void negateTest() {
|
||||
Expect.equals(minus5(), -5);
|
||||
Expect.equals(-5, -five());
|
||||
|
@ -377,7 +377,7 @@ void negateTest() {
|
|||
Expect.equals(3, -asNum(-3));
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void equalsTest() {
|
||||
// Equality of normal numbers is already well tested with "Expect.equals".
|
||||
Expect.equals(true, true == true);
|
||||
|
@ -421,7 +421,7 @@ void equalsTest() {
|
|||
Expect.equals(false, null == falseValue);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void lessTest() {
|
||||
var m1 = minus1();
|
||||
Expect.equals(true, 1 < 2);
|
||||
|
@ -449,7 +449,7 @@ void lessTest() {
|
|||
Expect.equals(false, minus1() < minus1());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void lessEqualTest() {
|
||||
var m1 = minus1();
|
||||
Expect.equals(true, 1 <= 2);
|
||||
|
@ -485,7 +485,7 @@ void lessEqualTest() {
|
|||
Expect.equals(true, minus1() <= minus1());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void greaterTest() {
|
||||
var m1 = minus1();
|
||||
Expect.equals(false, 1 > 2);
|
||||
|
@ -513,7 +513,7 @@ void greaterTest() {
|
|||
Expect.equals(false, minus1() > minus1());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void greaterEqualTest() {
|
||||
var m1 = minus1();
|
||||
Expect.equals(false, 1 >= 2);
|
||||
|
|
|
@ -13,7 +13,7 @@ class Class<T> {
|
|||
|
||||
class A {}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
test(o) => Expect.notEquals('dynamic', '$o');
|
||||
|
||||
main() {
|
||||
|
|
|
@ -65,7 +65,8 @@ const int NI6 = -PI6;
|
|||
const int NI7 = -PI7;
|
||||
|
||||
/// Ensures that the behaviour of `action()` is the same as `value.round()`.
|
||||
@NoInline() // To ensure 'value.round()' has a non-constant receiver.
|
||||
@pragma(
|
||||
'dart2js:noInline') // To ensure 'value.round()' has a non-constant receiver.
|
||||
check(value, action) {
|
||||
var result1, result2;
|
||||
try {
|
||||
|
@ -90,7 +91,7 @@ check(value, action) {
|
|||
}
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
void unusedCall(num x) {
|
||||
x.round(); // This call should not be removed since it might throw.
|
||||
}
|
||||
|
|
|
@ -5,23 +5,21 @@
|
|||
import 'package:expect/expect.dart';
|
||||
|
||||
class S {}
|
||||
|
||||
class M {}
|
||||
|
||||
class SuperC = S with M;
|
||||
|
||||
class SuperA {
|
||||
}
|
||||
class SuperA {}
|
||||
|
||||
class SuperB extends SuperA implements SuperC {
|
||||
}
|
||||
class SuperB extends SuperA implements SuperC {}
|
||||
|
||||
mixin Mixin on SuperC, SuperA {
|
||||
}
|
||||
mixin Mixin on SuperC, SuperA {}
|
||||
|
||||
class Class extends SuperB with Mixin {}
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
test(c) {
|
||||
Expect.isTrue(c is Mixin, "Unexpected result for $c is Mixin");
|
||||
Expect.isTrue(c is SuperC, "Unexpected result for $c is SuperC");
|
||||
|
|
|
@ -5,23 +5,21 @@
|
|||
import 'package:expect/expect.dart';
|
||||
|
||||
class S {}
|
||||
|
||||
class M {}
|
||||
|
||||
class SuperC = S with M;
|
||||
|
||||
class SuperA {
|
||||
}
|
||||
class SuperA {}
|
||||
|
||||
class SuperB extends SuperA implements SuperC {
|
||||
}
|
||||
class SuperB extends SuperA implements SuperC {}
|
||||
|
||||
mixin Mixin on SuperA, SuperC {
|
||||
}
|
||||
mixin Mixin on SuperA, SuperC {}
|
||||
|
||||
class Class extends SuperB with Mixin {}
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
test(c) {
|
||||
Expect.isTrue(c is Mixin, "Unexpected result for $c is Mixin");
|
||||
Expect.isTrue(c is SuperC, "Unexpected result for $c is SuperC");
|
||||
|
|
|
@ -60,7 +60,7 @@ switcher2(val) {
|
|||
|
||||
var x = 0;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
switcher3(val) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
void find1(expected, thunk) {
|
||||
|
@ -20,8 +20,8 @@ void find1(expected, thunk) {
|
|||
exceptionText = '$e';
|
||||
}
|
||||
if (exceptionText == null) {
|
||||
Expect
|
||||
.fail('Expected exception containing "$expected", returned: $returned');
|
||||
Expect.fail(
|
||||
'Expected exception containing "$expected", returned: $returned');
|
||||
}
|
||||
Expect.isTrue(exceptionText.contains(expected),
|
||||
'Expected "$expected" in "$exceptionText"');
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class CCCC {
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'native_testing.dart';
|
|||
// `"5"`, then converts it to a number for negation, giving a number result
|
||||
// instead of a string result.
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
checkString(r) {
|
||||
Expect.isTrue(
|
||||
r is String, 'Expected string, found ${r} of type ${r.runtimeType}');
|
||||
|
|
|
@ -12,7 +12,7 @@ class B extends A {
|
|||
int b;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
escape(v) {
|
||||
g = v;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class B {
|
|||
@pragma('dart2js:noElision')
|
||||
static var g;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method1(a) {
|
||||
g = '(Method1Tag)'; // Tag to identify compiled JavaScript method.
|
||||
A x = makeA();
|
||||
|
@ -34,7 +34,7 @@ class B {
|
|||
return x.foo(3, 10, 30);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method2() {
|
||||
g = '(Method2Tag)';
|
||||
A x = makeA();
|
||||
|
@ -43,7 +43,7 @@ class B {
|
|||
return r1 + r2;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
method3() {
|
||||
g = '(Method3Tag)';
|
||||
A x = makeA();
|
||||
|
|
|
@ -52,7 +52,7 @@ void setup() {
|
|||
})()""");
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -29,7 +29,7 @@ void setup() {
|
|||
})()""");
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
staticTests() {
|
||||
A a = makeA();
|
||||
Expect.equals(null, a.returnNull());
|
||||
|
@ -43,7 +43,7 @@ staticTests() {
|
|||
Expect.equals(0, a.returnZero());
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
dynamicTests() {
|
||||
A a = makeA();
|
||||
Expect.equals(null, confuse(a).returnNull());
|
||||
|
|
|
@ -43,6 +43,6 @@ void nativeTesting() {
|
|||
''');
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
|
|
@ -25,8 +25,8 @@ class Callable {
|
|||
int call(int x, int y) => x + y;
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
returnStringOrNull() {
|
||||
return new DateTime.now().millisecondsSinceEpoch == 0 ? 'foo' : null;
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ class NotAnInt {
|
|||
NotAnInt operator &(b) => this;
|
||||
}
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
id(x) => x;
|
||||
|
||||
main() {
|
||||
|
|
|
@ -5,8 +5,8 @@ import "dart:async";
|
|||
import "package:expect/expect.dart";
|
||||
import "package:async_helper/async_helper.dart";
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) {
|
||||
return x;
|
||||
}
|
||||
|
@ -42,8 +42,8 @@ testEvaluation(Future<void> fn()) async {
|
|||
|
||||
test2() async {
|
||||
await testEvaluation(() async {
|
||||
Expect
|
||||
.isFalse(await confuse(traceA(false)) && await confuse(traceB(false)));
|
||||
Expect.isFalse(
|
||||
await confuse(traceA(false)) && await confuse(traceB(false)));
|
||||
Expect.equals("a", trace);
|
||||
});
|
||||
await testEvaluation(() async {
|
||||
|
@ -60,8 +60,8 @@ test2() async {
|
|||
});
|
||||
|
||||
await testEvaluation(() async {
|
||||
Expect
|
||||
.isFalse(await confuse(traceA(false)) || await confuse(traceB(false)));
|
||||
Expect.isFalse(
|
||||
await confuse(traceA(false)) || await confuse(traceB(false)));
|
||||
Expect.equals("ab", trace);
|
||||
});
|
||||
await testEvaluation(() async {
|
||||
|
|
|
@ -8,7 +8,7 @@ import "package:async_helper/async_helper.dart";
|
|||
class A {
|
||||
int a = -1;
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
foo(ignored, val) {
|
||||
Expect.equals(val, this.a);
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ testA() async {
|
|||
a.foo(await false, 0);
|
||||
}
|
||||
|
||||
@NoInline()
|
||||
@AssumeDynamic()
|
||||
@pragma('dart2js:noInline')
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
confuse(x) => x;
|
||||
|
||||
class B {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@NoInline()
|
||||
@pragma('dart2js:noInline')
|
||||
String check({bool a, bool b}) {
|
||||
String aString = a ? 'a' : '';
|
||||
String bString = b ? 'b' : '';
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
foo() => 1;
|
||||
|
||||
@AssumeDynamic()
|
||||
@NoInline()
|
||||
@pragma('dart2js:assumeDynamic')
|
||||
@pragma('dart2js:noInline')
|
||||
throwException() => throw 'x';
|
||||
|
||||
main() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue