Version 1.24.0-dev.6.9
Cherry-pick 33fe148c518e3aa9dcecf4ba73500d38e2bd0559 to dev
Cherry-pick 3cbacefbe3567688b17c7cc4cd10a307847f5601 to dev
Cherry-pick e41c56580a402dd450ee291233e2ca9cc295d135 to dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 553dcce..0399791 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,10 +4,12 @@
* During a dynamic type check, `void` is not required to be `null` anymore.
In practice, this makes overriding `void` functions with non-`void` functions
safer.
+
* During static analysis, a function or setter declared using `=>` with return
type `void` now allows the returned expression to have any type. For example,
assuming the declaration `int x;`, it is now type correct to have
`void f() => ++x;`.
+
* A new function-type syntax has been added to the language.
Intuitively, the type of a function can be constructed by textually replacing
the function's name with `Function` in its declaration. For instance, the
@@ -15,11 +17,13 @@
wherever a type can be written. It is thus now possible to declare fields
containing functions without needing to write typedefs: `void Function() x;`.
The new function type has one restriction: it may not contain the old-style
- function-type syntax for its parameters. The following is thus
- illegal: `void Function(int f())`.
+ function-type syntax for its parameters. The following is thus illegal:
+ `void Function(int f())`.
`typedefs` have been updated to support this new syntax.
+
Examples:
- ```
+
+ ```dart
typedef F = void Function(); // F is the name for a `void` callback.
int Function(int) f; // A field `f` that contains an int->int function.
@@ -33,47 +37,107 @@
typedef Invoker = T Function<T>(T Function() callback);
```
-#### Strong Mode
-
-* Removed ad hoc Future.then inference in favor of using FutureOr. Prior to
-adding FutureOr to the language, the analyzer implented an ad hoc type inference
-for Future.then (and overrides) treating it as if the onValue callback was typed
-to return FutureOr for the purposes of inference. This ad hoc inference has
-been removed now that FutureOr has been added.
-
-Packages that implement `Future` must either type the `onValue` parameter to
-`.then` as returning `FutureOr<T>`, or else must leave the type of the parameter
-entirely to allow inference to fill in the type.
-
-* The following is also a change in strong mode: During static analysis, a
- function or setter declared using `=>` with return type `void` now allows the
- returned expression to have any type.
-* The new function-type syntax is also supported by strong mode.
-
### Core library changes
+* `dart:async`, `dart:core`, `dart:io`
+ * Adding to a closed sink, including `IOSink`, is no longer not allowed. In
+ 1.24, violations are only reported (on stdout or stderr), but a future
+ version of the Dart SDK will change this to throwing a `StateError`.
+
+* `dart:convert`
+ * **BREAKING** Removed the deprecated `ChunkedConverter` class.
+ * JSON maps are now typed as `Map<String, dynamic>` instead of
+ `Map<dynamic, dynamic>`. A JSON-map is not a `HashMap` or `LinkedHashMap`
+ anymore (but just a `Map`).
+
* `dart:io`
* Added `Platform.localeName`, needed for accessing the locale on platforms
that don't store it in an environment variable.
* Added `ProcessInfo.currentRss` and `ProcessInfo.maxRss` for inspecting
the Dart VM process current and peak resident set size.
- * Added 'RawSynchronousSocket', a basic synchronous socket implementation.
-* `dart:convert`
- * Removed deprecated `ChunkedConverter` class.
- * JSON maps are now typed as `Map<String, dynamic>` instead of
- `Map<dynamic, dynamic>`. A JSON-map is not a `HashMap` or `LinkedHashMap`
- anymore (but just a `Map`).
-* `dart:async`, `dart:io`, `dart:core`
- * Adding to a closed sink, including `IOSink`, is not allowed anymore. In
- 1.24, violations are only reported (on stdout or stderr), but a future
- version of the Dart SDK will change this to throwing a `StateError`.
+ * Added `RawSynchronousSocket`, a basic synchronous socket implementation.
-### Dart VM
+* `dart:` web APIs have been updated to align with Chrome v50.
+ This change includes **a large number of changes**, many of which are
+ breaking. In some cases, new class names may conflict with names that exist
+ in existing code.
+
+* `dart:html`
+
+ * **REMOVED** classes: `Bluetooth`, `BluetoothDevice`,
+ `BluetoothGattCharacteristic`, `BluetoothGattRemoteServer`,
+ `BluetoothGattService`, `BluetoothUuid`, `CrossOriginConnectEvent`,
+ `DefaultSessionStartEvent`, `DomSettableTokenList`, `MediaKeyError`,
+ `PeriodicSyncEvent`, `PluginPlaceholderElement`, `ReadableStream`,
+ `StashedMessagePort`, `SyncRegistration`
+
+ * **REMOVED** members:
+ * `texImage2DCanvas` was removed from `RenderingContext`.
+ * `endClip` and `startClip` were removed from `Animation`.
+ * `after` and `before` were removed from `CharacterData`, `ChildNode` and
+ `Element`.
+ * `keyLocation` was removed from `KeyboardEvent`. Use `location` instead.
+ * `generateKeyRequest`, `keyAddedEvent`, `keyErrorEvent`, `keyMessageEvent`,
+ `mediaGroup`, `needKeyEvent`, `onKeyAdded`, `onKeyError`, `onKeyMessage`,
+ and `onNeedKey` were removed from `MediaElement`.
+ * `getStorageUpdates` was removed from `Navigator`
+ * `status` was removed from `PermissionStatus`
+ * `getAvailability` was removed from `PreElement`
+
+ * Other behavior changes:
+ * URLs returned in CSS or html are formatted with quoted string.
+ Like `url("http://google.com")` instead of `url(http://google.com)`.
+ * Event timestamp property type changed from `int` to `num`.
+ * Chrome introduced slight layout changes of UI objects.
+ In addition many height/width dimensions are returned in subpixel values
+ (`num` instead of whole numbers).
+ * `setRangeText` with a `selectionMode` value of 'invalid' is no longer
+ valid. Only "select", "start", "end", "preserve" are allowed.
+
+* `dart:svg`
+
+ * A large number of additions and removals. Review your use of `dart:svg`
+ carefully.
+
+* `dart:web_audio`
+
+ * new method on `AudioContext` – `createIirFilter` returns a new class
+ `IirFilterNode`.
+
+* `dart:web_gl`
+
+ * new classes: `CompressedTextureAstc`, `ExtColorBufferFloat`,
+ `ExtDisjointTimerQuery`, and `TimerQueryExt`.
+
+ * `ExtFragDepth` added: `readPixels2` and `texImage2D2`.
+
+#### Strong Mode
+
+* Removed ad hoc `Future.then` inference in favor of using `FutureOr`. Prior to
+ adding `FutureOr` to the language, the analyzer implented an ad hoc type
+ inference for `Future.then` (and overrides) treating it as if the onValue
+ callback was typed to return `FutureOr` for the purposes of inference.
+ This ad hoc inference has been removed now that `FutureOr` has been added.
+
+ Packages that implement `Future` must either type the `onValue` parameter to
+ `.then` as returning `FutureOr<T>`, or else must leave the type of the parameter
+ entirely to allow inference to fill in the type.
+
+* During static analysis, a function or setter declared using `=>` with return
+ type `void` now allows the returned expression to have any type.
### Tool Changes
+* Dartium
+
+ Dartium is now based on Chrome v50. See *Core library changes* above for
+ details on the changed APIs.
+
* Pub
- * Added support for the Dart Development Compiler in `build` and `serve`.
+
+ * `pub build` and `pub serve`
+
+ * Added support for the Dart Development Compiler.
Unlike dart2js, this new compiler is modular, which allows pub to do
incremental re-builds for `pub serve`, and potentially `pub build` in the
@@ -113,14 +177,20 @@
* The `--no-dart2js` flag has been deprecated in favor of
`--web-compiler=none`.
- * Added support for the UNLICENSE file when validating licenses on
- `pub lish`.
- * Better handling for network errors when fetching packages. These are no
- longer unhandled errors and won't print a stack trace unless you are
- running in verbose mode.
+
* `pub build` will use a failing exit code if there are errors in any
transformer.
- * Allow publishing packages that depend on the Flutter SDK.
+
+ * `pub publish`
+
+ * Added support for the UNLICENSE file.
+
+ * Packages that depend on the Flutter SDK may be published.
+
+ * `pub get` and `pub upgrade`
+
+ * Don't dump a stack trace when a network error occurs while fetching
+ packages.
* dartfmt
* Preserve type parameters in new generic function typedef syntax.
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index d0cb36a..c07f01b 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -39,7 +39,7 @@
import 'dart:svg' show SvgSvgElement;
import 'dart:web_audio' as web_audio;
import 'dart:web_gl' as gl;
-import 'dart:web_gl' show RenderingContext;
+import 'dart:web_gl' show RenderingContext, RenderingContext2;
import 'dart:web_sql';
import 'dart:_isolate_helper' show IsolateNatives;
import 'dart:_foreign_helper' show JS, JS_INTERCEPTOR_CONSTANT;
@@ -2023,8 +2023,8 @@
@DomName('HTMLCanvasElement.getContext')
@DocsEditable()
- @Creates('CanvasRenderingContext2D|RenderingContext')
- @Returns('CanvasRenderingContext2D|RenderingContext|Null')
+ @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
+ @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
Object getContext(String contextId, [Map attributes]) {
if (attributes != null) {
var attributes_1 = convertDartToNative_Dictionary(attributes);
@@ -2036,14 +2036,14 @@
@JSName('getContext')
@DomName('HTMLCanvasElement.getContext')
@DocsEditable()
- @Creates('CanvasRenderingContext2D|RenderingContext')
- @Returns('CanvasRenderingContext2D|RenderingContext|Null')
+ @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
+ @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
Object _getContext_1(contextId, attributes) native;
@JSName('getContext')
@DomName('HTMLCanvasElement.getContext')
@DocsEditable()
- @Creates('CanvasRenderingContext2D|RenderingContext')
- @Returns('CanvasRenderingContext2D|RenderingContext|Null')
+ @Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')
+ @Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')
Object _getContext_2(contextId) native;
@DomName('HTMLCanvasElement.toBlob')
diff --git a/tools/VERSION b/tools/VERSION
index 47b9977..dc31d08 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -28,4 +28,4 @@
MINOR 24
PATCH 0
PRERELEASE 6
-PRERELEASE_PATCH 8
+PRERELEASE_PATCH 9
diff --git a/tools/dom/scripts/dartmetadata.py b/tools/dom/scripts/dartmetadata.py
index 25f00ce..6e77214 100644
--- a/tools/dom/scripts/dartmetadata.py
+++ b/tools/dom/scripts/dartmetadata.py
@@ -192,8 +192,8 @@
],
'HTMLCanvasElement.getContext': [
- "@Creates('CanvasRenderingContext2D|RenderingContext')",
- "@Returns('CanvasRenderingContext2D|RenderingContext|Null')",
+ "@Creates('CanvasRenderingContext2D|RenderingContext|RenderingContext2')",
+ "@Returns('CanvasRenderingContext2D|RenderingContext|RenderingContext2|Null')",
],
'HTMLInputElement.valueAsDate': [
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index cc2f4f9..cac23bf 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -48,7 +48,7 @@
import 'dart:svg' show SvgSvgElement;
import 'dart:web_audio' as web_audio;
import 'dart:web_gl' as gl;
-import 'dart:web_gl' show RenderingContext;
+import 'dart:web_gl' show RenderingContext,RenderingContext2;
import 'dart:web_sql';
import 'dart:_js_helper' show
convertDartClosureToJS, Creates, JavaScriptIndexingBehavior,
diff --git a/tools/sdks/linux/dart-sdk.tar.gz.sha1 b/tools/sdks/linux/dart-sdk.tar.gz.sha1
index 9615cfa..cd1d4a8 100644
--- a/tools/sdks/linux/dart-sdk.tar.gz.sha1
+++ b/tools/sdks/linux/dart-sdk.tar.gz.sha1
@@ -1 +1 @@
-428d821370b10d92e527f8dab36f9bef921b1abe
\ No newline at end of file
+a0e3a9252d8cc5e2c3d97e2328f54c8bd17fe5dc
\ No newline at end of file
diff --git a/tools/sdks/mac/dart-sdk.tar.gz.sha1 b/tools/sdks/mac/dart-sdk.tar.gz.sha1
index 91003e2..79e0558 100644
--- a/tools/sdks/mac/dart-sdk.tar.gz.sha1
+++ b/tools/sdks/mac/dart-sdk.tar.gz.sha1
@@ -1 +1 @@
-4ddb8626000a4252de62c9e242c4d3eac0d15be1
\ No newline at end of file
+73761575140191659e41b8911e01da90499360f8
\ No newline at end of file
diff --git a/tools/sdks/win/dart-sdk.tar.gz.sha1 b/tools/sdks/win/dart-sdk.tar.gz.sha1
index 7a9cacf..dbcf5e1 100644
--- a/tools/sdks/win/dart-sdk.tar.gz.sha1
+++ b/tools/sdks/win/dart-sdk.tar.gz.sha1
@@ -1 +1 @@
-883609e7401e49ee6d77fb02b7ea0487ec9ca48a
\ No newline at end of file
+aaa34195474dcef8c5c199c37953df3ae58a3a54
\ No newline at end of file