1ef4399df0
This uses optional new/const and `=` in named argument defaults. All changes are automated, except for: - utils/dartdevc/BUILD.gn: run DDC build scripts with --preview-dart-2 - pkg/dev_compiler/tool/patch_sdk.dart: add a TODO that Analyzer doesn't supporting implicit const in libraries.dart - pkg/dev_compiler/tool/input_sdk/libraries.dart: was not formatted due to the aforementioned Analyzer bug - tools/bots/test_matrix.json: run DDC sourcemap suite in Dart 2 mode - pkg/pkg.status: skip pkg/dev_compiler if running in Dart 1 mode Change-Id: I9b80ccba0c2cc7b66efc662a0b16562e3660aee3 Reviewed-on: https://dart-review.googlesource.com/60402 Commit-Queue: Jenny Messerly <jmesserly@google.com> Reviewed-by: Bob Nystrom <rnystrom@google.com>
84 lines
2.5 KiB
Dart
84 lines
2.5 KiB
Dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// 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.
|
|
|
|
part of dart._js_helper;
|
|
|
|
/// Tells the optimizing compiler to always inline the annotated method.
|
|
class ForceInline {
|
|
const ForceInline();
|
|
}
|
|
|
|
class _NotNull {
|
|
const _NotNull();
|
|
}
|
|
|
|
/// Marks a variable or API to be non-nullable.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence should never be used
|
|
/// on any public interface where user code could subclass, implement,
|
|
/// or otherwise cause the contract to be violated.
|
|
/// TODO(leafp): Consider adding static checking and exposing
|
|
/// this to user code.
|
|
const notNull = _NotNull();
|
|
|
|
/// Marks a generic function or static method API to be not reified.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence should be used very carefully for
|
|
/// internal SDK APIs only.
|
|
class NoReifyGeneric {
|
|
const NoReifyGeneric();
|
|
}
|
|
|
|
/// Enables/disables reificiation of functions within the body of this function.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence should be used very carefully for
|
|
/// internal SDK APIs only.
|
|
class ReifyFunctionTypes {
|
|
final bool value;
|
|
const ReifyFunctionTypes(this.value);
|
|
}
|
|
|
|
class _NullCheck {
|
|
const _NullCheck();
|
|
}
|
|
|
|
/// Tells the development compiler to check a variable for null at its
|
|
/// declaration point, and then to assume that the variable is non-null
|
|
/// from that point forward.
|
|
/// ****CAUTION******
|
|
/// This is currently unchecked, and hence will not catch re-assignments
|
|
/// of a variable with null
|
|
const nullCheck = _NullCheck();
|
|
|
|
/// Tells the optimizing compiler that the annotated method cannot throw.
|
|
/// Requires @NoInline() to function correctly.
|
|
class NoThrows {
|
|
const NoThrows();
|
|
}
|
|
|
|
/// Tells the optimizing compiler to not inline the annotated method.
|
|
class NoInline {
|
|
const NoInline();
|
|
}
|
|
|
|
/// Marks a class as native and defines its JavaScript name(s).
|
|
class Native {
|
|
final String name;
|
|
const Native(this.name);
|
|
}
|
|
|
|
class JsPeerInterface {
|
|
/// The JavaScript type that we should match the API of.
|
|
/// Used for classes where Dart subclasses should be callable from JavaScript
|
|
/// matching the JavaScript calling conventions.
|
|
final String name;
|
|
const JsPeerInterface({this.name});
|
|
}
|
|
|
|
/// A Dart interface may only be implemented by a native JavaScript object
|
|
/// if it is marked with this annotation.
|
|
class SupportJsExtensionMethods {
|
|
const SupportJsExtensionMethods();
|
|
}
|