Skip to content

Commit

Permalink
Remove deprecated SDK constant declarations.
Browse files Browse the repository at this point in the history
Change-Id: I0e4208b6fa957765403608103128c28562280657
Reviewed-on: https://dart-review.googlesource.com/51841
Commit-Queue: Lasse R.H. Nielsen <[email protected]>
Reviewed-by: Leaf Petersen <[email protected]>
Reviewed-by: Lasse R.H. Nielsen <[email protected]>
  • Loading branch information
lrhn authored and [email protected] committed Jul 18, 2018
1 parent e7c6416 commit f2402b3
Show file tree
Hide file tree
Showing 26 changed files with 4,653 additions and 1,219 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#### Other Tools

### Core library changes
* Remove deprecated UPPER_CASE constant names. Use the lower-case names only
from now on. Example `HTML_ESCAPE` is now only `htmlEscape`.
* `dart:collection`, `dart:core`:
* Re-enable `Iterable.whereType`. The method was disabled because code
was still being compiled in Dart 1 mode, and the function was
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ vars = {
"mockito_tag": "d39ac507483b9891165e422ec98d9fb480037c8b",
"mustache4dart_tag" : "v2.1.2",
"oauth2_tag": "1.2.1",
"observatory_pub_packages_rev": "129400266c6839365b9e93147f53fc0970e1d440",
"observatory_pub_packages_rev": "0894122173b0f98eb08863a7712e78407d4477bc",
"package_config_tag": "1.0.3",
"package_resolver_tag": "1.0.3",
"path_tag": "1.5.1",
Expand Down
2 changes: 0 additions & 2 deletions sdk/lib/async/zone.dart
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ abstract class Zone {
* desired behavior.
*/
static const Zone root = _rootZone;
@Deprecated("Use root instead")
static const Zone ROOT = root;

/** The currently running zone. */
static Zone _current = _rootZone;
Expand Down
2 changes: 0 additions & 2 deletions sdk/lib/convert/ascii.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ part of dart.convert;
* ```
*/
const AsciiCodec ascii = const AsciiCodec();
@Deprecated("Use ascii instead")
const AsciiCodec ASCII = ascii;

const int _asciiMask = 0x7F;

Expand Down
4 changes: 0 additions & 4 deletions sdk/lib/convert/base64.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ part of dart.convert;
* var decoded = base64.decode("YmzDpWLDpnJncsO4ZAo=");
*/
const Base64Codec base64 = const Base64Codec();
@Deprecated("Use base64 instead")
const Base64Codec BASE64 = base64;

/**
* A [base64url](https://tools.ietf.org/html/rfc4648) encoder and decoder.
Expand All @@ -35,8 +33,6 @@ const Base64Codec BASE64 = base64;
* var decoded = base64Url.decode("YmzDpWLDpnJncsO4ZAo=");
*/
const Base64Codec base64Url = const Base64Codec.urlSafe();
@Deprecated("Use base64Url instead")
const Base64Codec BASE64URL = base64Url;

/**
* Encodes [bytes] using [base64](https://tools.ietf.org/html/rfc4648) encoding.
Expand Down
10 changes: 0 additions & 10 deletions sdk/lib/convert/html_escape.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ part of dart.convert;
* tag, but not inside a quoted attribute value, is still dangerous.
*/
const HtmlEscape htmlEscape = const HtmlEscape();
@Deprecated("Use htmlEscape instead")
const HtmlEscape HTML_ESCAPE = htmlEscape;

/**
* HTML escape modes.
Expand Down Expand Up @@ -72,8 +70,6 @@ class HtmlEscapeMode {
*/
static const HtmlEscapeMode unknown =
const HtmlEscapeMode._('unknown', true, true, true, true);
@Deprecated("Use unknown instead")
static const HtmlEscapeMode UNKNOWN = unknown;

/**
* Escaping mode for text going into double-quoted HTML attribute values.
Expand All @@ -87,8 +83,6 @@ class HtmlEscapeMode {
*/
static const HtmlEscapeMode attribute =
const HtmlEscapeMode._('attribute', true, true, false, false);
@Deprecated("Use attribute instead")
static const HtmlEscapeMode ATTRIBUTE = attribute;

/**
* Escaping mode for text going into single-quoted HTML attribute values.
Expand All @@ -102,8 +96,6 @@ class HtmlEscapeMode {
*/
static const HtmlEscapeMode sqAttribute =
const HtmlEscapeMode._('attribute', true, false, true, false);
@Deprecated("Use sqAttribute instead")
static const HtmlEscapeMode SQ_ATTRIBUTE = sqAttribute;

/**
* Escaping mode for text going into HTML element content.
Expand All @@ -116,8 +108,6 @@ class HtmlEscapeMode {
*/
static const HtmlEscapeMode element =
const HtmlEscapeMode._('element', true, false, false, false);
@Deprecated("Use element instead")
static const HtmlEscapeMode ELEMENT = element;

const HtmlEscapeMode._(this._name, this.escapeLtGt, this.escapeQuot,
this.escapeApos, this.escapeSlash);
Expand Down
2 changes: 0 additions & 2 deletions sdk/lib/convert/json.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ class JsonCyclicError extends JsonUnsupportedObjectError {
* var decoded = json.decode('["foo", { "bar": 499 }]');
*/
const JsonCodec json = const JsonCodec();
@Deprecated("Use json instead")
const JsonCodec JSON = json;

/**
* Converts [value] to a JSON string.
Expand Down
2 changes: 0 additions & 2 deletions sdk/lib/convert/latin1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ part of dart.convert;
* ```
*/
const Latin1Codec latin1 = const Latin1Codec();
@Deprecated("Use latin1 instead")
const Latin1Codec LATIN1 = latin1;

const int _latin1Mask = 0xFF;

Expand Down
6 changes: 0 additions & 6 deletions sdk/lib/convert/utf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ part of dart.convert;

/** The Unicode Replacement character `U+FFFD` (�). */
const int unicodeReplacementCharacterRune = 0xFFFD;
@Deprecated("Use unicodeReplacementCharacterRune instead")
const int UNICODE_REPLACEMENT_CHARACTER_RUNE = unicodeReplacementCharacterRune;

/** The Unicode Byte Order Marker (BOM) character `U+FEFF`. */
const int unicodeBomCharacterRune = 0xFEFF;
@Deprecated("Use unicodeBomCharacterRune instead")
const int UNICODE_BOM_CHARACTER_RUNE = unicodeBomCharacterRune;

/**
* An instance of the default implementation of the [Utf8Codec].
Expand All @@ -27,8 +23,6 @@ const int UNICODE_BOM_CHARACTER_RUNE = unicodeBomCharacterRune;
* 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
*/
const Utf8Codec utf8 = const Utf8Codec();
@Deprecated("Use utf8 instead")
const Utf8Codec UTF8 = utf8;

/**
* A [Utf8Codec] encodes strings to utf-8 code units (bytes) and decodes
Expand Down
44 changes: 0 additions & 44 deletions sdk/lib/core/date_time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,6 @@ class DateTime implements Comparable<DateTime> {
static const int sunday = 7;
static const int daysPerWeek = 7;

@Deprecated("Use monday instead")
static const int MONDAY = monday;
@Deprecated("Use tuesday instead")
static const int TUESDAY = tuesday;
@Deprecated("Use wednesday instead")
static const int WEDNESDAY = wednesday;
@Deprecated("Use thursday instead")
static const int THURSDAY = thursday;
@Deprecated("Use friday instead")
static const int FRIDAY = friday;
@Deprecated("Use saturday instead")
static const int SATURDAY = saturday;
@Deprecated("Use sunday instead")
static const int SUNDAY = sunday;
@Deprecated("Use daysPerWeek instead")
static const int DAYS_PER_WEEK = daysPerWeek;

// Month constants that are returned by the [month] getter.
static const int january = 1;
static const int february = 2;
Expand All @@ -163,33 +146,6 @@ class DateTime implements Comparable<DateTime> {
static const int december = 12;
static const int monthsPerYear = 12;

@Deprecated("Use january instead")
static const int JANUARY = january;
@Deprecated("Use february instead")
static const int FEBRUARY = february;
@Deprecated("Use march instead")
static const int MARCH = march;
@Deprecated("Use april instead")
static const int APRIL = april;
@Deprecated("Use may instead")
static const int MAY = may;
@Deprecated("Use june instead")
static const int JUNE = june;
@Deprecated("Use july instead")
static const int JULY = july;
@Deprecated("Use august instead")
static const int AUGUST = august;
@Deprecated("Use september instead")
static const int SEPTEMBER = september;
@Deprecated("Use october instead")
static const int OCTOBER = october;
@Deprecated("Use november instead")
static const int NOVEMBER = november;
@Deprecated("Use december instead")
static const int DECEMBER = december;
@Deprecated("Use monthsPerYear instead")
static const int MONTHS_PER_YEAR = monthsPerYear;

/**
* The value of this DateTime.
*
Expand Down
10 changes: 0 additions & 10 deletions sdk/lib/core/double.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,10 @@ part of dart.core;
* double.
*/
abstract class double extends num {
@Deprecated("Use nan instead")
static const double NAN = nan;
static const double nan = 0.0 / 0.0;
@Deprecated("Use infinity instead")
static const double INFINITY = infinity;
static const double infinity = 1.0 / 0.0;
@Deprecated("Use negativeInfinity instead")
static const double NEGATIVE_INFINITY = negativeInfinity;
static const double negativeInfinity = -infinity;
@Deprecated("Use minPositive instead")
static const double MIN_POSITIVE = minPositive;
static const double minPositive = 5e-324;
@Deprecated("Use maxFinite instead")
static const double MAX_FINITE = maxFinite;
static const double maxFinite = 1.7976931348623157e+308;

double remainder(num other);
Expand Down
33 changes: 0 additions & 33 deletions sdk/lib/core/duration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,39 +76,6 @@ class Duration implements Comparable<Duration> {

static const Duration zero = const Duration(seconds: 0);

@Deprecated("Use microsecondsPerMillisecond instead")
static const int MICROSECONDS_PER_MILLISECOND = microsecondsPerMillisecond;
@Deprecated("Use millisecondsPerSecond instead")
static const int MILLISECONDS_PER_SECOND = millisecondsPerSecond;
@Deprecated("Use secondsPerMinute instead")
static const int SECONDS_PER_MINUTE = secondsPerMinute;
@Deprecated("Use minutesPerHour instead")
static const int MINUTES_PER_HOUR = minutesPerHour;
@Deprecated("Use hoursPerDay instead")
static const int HOURS_PER_DAY = hoursPerDay;
@Deprecated("Use microsecondsPerSecond instead")
static const int MICROSECONDS_PER_SECOND = microsecondsPerSecond;
@Deprecated("Use microsecondsPerMinute instead")
static const int MICROSECONDS_PER_MINUTE = microsecondsPerMinute;
@Deprecated("Use microsecondsPerHour instead")
static const int MICROSECONDS_PER_HOUR = microsecondsPerHour;
@Deprecated("Use microsecondsPerDay instead")
static const int MICROSECONDS_PER_DAY = microsecondsPerDay;
@Deprecated("Use millisecondsPerMinute instead")
static const int MILLISECONDS_PER_MINUTE = millisecondsPerMinute;
@Deprecated("Use millisecondsPerHour instead")
static const int MILLISECONDS_PER_HOUR = millisecondsPerHour;
@Deprecated("Use millisecondsPerDay instead")
static const int MILLISECONDS_PER_DAY = millisecondsPerDay;
@Deprecated("Use secondsPerHour instead")
static const int SECONDS_PER_HOUR = secondsPerHour;
@Deprecated("Use secondsPerDay instead")
static const int SECONDS_PER_DAY = secondsPerDay;
@Deprecated("Use minutesPerDay instead")
static const int MINUTES_PER_DAY = minutesPerDay;
@Deprecated("Use zero instead")
static const Duration ZERO = zero;

/*
* The value of this Duration object in microseconds.
*/
Expand Down
4 changes: 0 additions & 4 deletions sdk/lib/isolate/isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,8 @@ class IsolateSpawnException implements Exception {
class Isolate {
/** Argument to `ping` and `kill`: Ask for immediate action. */
static const int immediate = 0;
@Deprecated("Use immediate instead")
static const int IMMEDIATE = immediate;
/** Argument to `ping` and `kill`: Ask for action before the next event. */
static const int beforeNextEvent = 1;
@Deprecated("Use beforeNextEvent instead")
static const int BEFORE_NEXT_EVENT = beforeNextEvent;

/**
* Control port used to send control messages to the isolate.
Expand Down
17 changes: 0 additions & 17 deletions sdk/lib/math/math.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,6 @@ const double sqrt1_2 = 0.7071067811865476;
*/
const double sqrt2 = 1.4142135623730951;

@Deprecated("Use e instead")
const double E = e;
@Deprecated("Use ln10 instead")
const double LN10 = ln10;
@Deprecated("Use ln2 instead")
const double LN2 = ln2;
@Deprecated("Use log2e instead")
const double LOG2E = log2e;
@Deprecated("Use log10e instead")
const double LOG10E = log10e;
@Deprecated("Use pi instead")
const double PI = pi;
@Deprecated("Use sqrt1_2 instead")
const double SQRT1_2 = sqrt1_2;
@Deprecated("Use sqrt2 instead")
const double SQRT2 = sqrt2;

/**
* Returns the lesser of two numbers.
*
Expand Down
Loading

0 comments on commit f2402b3

Please sign in to comment.