Skip to content

Commit 2ddcfae

Browse files
committed
Version 2.0.0-dev.37.0
Merge commit 'a3c352a6e4db5ebb13f55a445ba7122525fc55db' into dev
2 parents 8a3b7c7 + a3c352a commit 2ddcfae

File tree

330 files changed

+6132
-1605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+6132
-1605
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
## 2.0.0-dev.37.0
2+
3+
### Tool Changes
4+
5+
* dart2js
6+
7+
* The dart2js compiler now uses the common front-end by default. This is a
8+
step towards supporting Dart 2.0. At this time dart2js has no semantic
9+
changes: the Dart 2.0 strong-mode semantics are not enabled, so dart2js
10+
continues to support the Dart 1 type system. This change however lets us
11+
start supporting new syntactic features of Dart 2.0, like optional
12+
new/const. With this change you may notice:
13+
14+
* small code differences (~1% code size): some code is generated slightly
15+
different, this is expected because the internal representation of the
16+
program has small differences between the old and new front end.
17+
18+
* source-maps changes: with the new front-end, dart2js also is using a new
19+
mechanism to generate source-map files. We don't expect big differences
20+
here either, the new source-maps try to encode more data for locations
21+
that are commonly used during debugging.
22+
23+
* some missing errors: the CFE is not complete and may not report some
24+
static errors that the old front-end did. This is temporary. If you run
25+
the analyzer on all your project already, you may never notice those
26+
missing error messages.
27+
28+
* as announced earlier, this is the first version of dart2js that no longer
29+
supports `dart:mirrors`.
30+
31+
* this is the first version of dart2js that no longer supports
32+
`--package-root`, which long ago was deprecated in favor of `--packages`.
33+
134
## 2.0.0-dev.36.0
235

336
### Core library changes
@@ -76,6 +109,9 @@ the assignment to `y`.
76109
* `MapBase`: added `mapToString`.
77110
* `LinkedHashMap` no longer implements `HashMap`
78111
* `LinkedHashSet` no longer implements `HashSet`.
112+
* Added `of` constructor to `Queue`, `ListQueue`,
113+
`DoubleLinkedQueue`, `HashSet`, `LinkedHashSet`, `SplayTreeSet`,
114+
`Map`, `HashMap`, `LinkedHashMap`, `SplayTreeMap`.
79115

80116
* `dart:convert`
81117

@@ -115,6 +151,7 @@ the assignment to `y`.
115151
* *Note*: if a class extends `IterableBase`, `ListBase`, `SetBase` or
116152
`MapBase` (or uses the corresponding mixins) from `dart:collection`, the
117153
new members are implemented automatically.
154+
* Added `of` constructor to `List`, `Set`, `Map`.
118155
* Renamed `double.INFINITY`, `double.NEGATIVE_INFINITY`, `double.NAN`,
119156
`double.MAX_FINITE` and `double.MIN_POSITIVE`
120157
to `double.infinity`, `double.negativeInfinity`, `double.nan`,
@@ -346,6 +383,9 @@ the `PUB_ALLOW_PRERELEASE_SDK` environment variable to `false`.
346383
* Fix `pub global run` for packages activated from a local path that also have
347384
relative path dependencies ([issue 1751][pub#1751]).
348385

386+
* `pub build` and `pub serve` support using the common front-end in the dart2js
387+
transformer.
388+
349389
[pub#1684]: https://github.com/dart-lang/pub/issues/1684
350390
[pub#1719]: https://github.com/dart-lang/pub/issues/1719
351391
[pub#1679]: https://github.com/dart-lang/pub/issues/1679

DEPS

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ vars = {
5050
"gperftools_revision": "@02eeed29df112728564a5dde6417fa4622b57a06",
5151

5252
# Revisions of /third_party/* dependencies.
53-
"args_tag": "@0.13.7",
53+
"args_tag": "@1.4.1",
5454
"async_tag": "@2.0.6",
5555
"barback-0.13.0_rev": "@34853",
5656
"barback-0.14.0_rev": "@36398",
@@ -63,7 +63,7 @@ vars = {
6363
"charcode_tag": "@v1.1.1",
6464
"chrome_rev" : "@19997",
6565
"cli_util_tag" : "@0.1.2+1",
66-
"collection_tag": "@6ff408a512df30559c1a18b37cfac9fc51a4ceef",
66+
"collection_tag": "@1.14.6",
6767
"convert_tag": "@2.0.1",
6868
"crypto_tag" : "@2.0.2+1",
6969
"csslib_tag" : "@0.14.1",
@@ -83,7 +83,7 @@ vars = {
8383
# For more details, see https://github.com/dart-lang/sdk/issues/30164
8484
"dart_style_tag": "@1.0.10", # Please see the note above before updating.
8585

86-
"dartdoc_tag" : "@v0.17.0",
86+
"dartdoc_tag" : "@v0.17.1+1",
8787
"fixnum_tag": "@0.10.5",
8888
"func_rev": "@25eec48146a58967d75330075ab376b3838b18a8",
8989
"glob_tag": "@1.1.5",
@@ -92,16 +92,16 @@ vars = {
9292
"http_multi_server_tag" : "@2.0.4",
9393
"http_parser_tag" : "@3.1.1",
9494
"http_retry_tag": "@0.1.0",
95-
"http_tag" : "@0.11.3+14",
95+
"http_tag" : "@0.11.3+16",
9696
"http_throttle_tag" : "@1.0.1",
9797
"idl_parser_rev": "@7fbe68cab90c38147dee4f48c30ad0d496c17915",
9898
"intl_tag": "@0.15.2",
9999
"isolate_tag": "@1.1.0",
100100
"jinja2_rev": "@2222b31554f03e62600cd7e383376a7c187967a1",
101101
"json_rpc_2_tag": "@2.0.6",
102-
"linter_tag": "@0.1.43",
102+
"linter_tag": "@0.1.44",
103103
"logging_tag": "@0.11.3+1",
104-
"markdown_tag": "@1.0.0",
104+
"markdown_tag": "@1.1.1",
105105
"matcher_tag": "@0.12.1+4",
106106
"mime_tag": "@0.9.6",
107107
"mockito_tag": "@a92db054fba18bc2d605be7670aee74b7cadc00a",
@@ -115,21 +115,21 @@ vars = {
115115
"ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
116116
"pool_tag": "@1.3.4",
117117
"protobuf_tag": "@0.7.1",
118-
"pub_rev": "@73ff0d3d9f80f60d41e3135ac44597d011abb4f3",
118+
"pub_rev": "@d2755745e88b63448d0adfbf2d04af9050f45ed3",
119119
"pub_semver_tag": "@1.3.2",
120120
"quiver_tag": "@5aaa3f58c48608af5b027444d561270b53f15dbf",
121121
"resource_rev":"@af5a5bf65511943398146cf146e466e5f0b95cb9",
122122
"root_certificates_rev": "@16ef64be64c7dfdff2b9f4b910726e635ccc519e",
123-
"shelf_static_rev": "@3558aa35a0d2f0f35868c3fd64b258e140db0122",
123+
"shelf_static_rev": "@v0.2.7",
124124
"shelf_packages_handler_tag": "@1.0.3",
125-
"shelf_tag": "@0.7.1",
125+
"shelf_tag": "@0.7.2",
126126
"shelf_web_socket_tag": "@0.2.2",
127127
"source_map_stack_trace_tag": "@1.1.4",
128128
"source_maps-0.9.4_rev": "@38524",
129129
"source_maps_tag": "@0.10.4",
130130
"source_span_tag": "@1.4.0",
131-
"stack_trace_tag": "@1.9.0",
132-
"stream_channel_tag": "@1.6.2",
131+
"stack_trace_tag": "@1.9.2",
132+
"stream_channel_tag": "@1.6.4",
133133
"string_scanner_tag": "@1.0.2",
134134
"sunflower_rev": "@879b704933413414679396b129f5dfa96f7a0b1e",
135135
"test_descriptor_tag": "@1.0.3",

pkg/analysis_server/test/analysis/get_hover_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ main() {
420420
expect(hover.containingLibraryPath, isNull);
421421
expect(hover.containingClassDescription, isNull);
422422
expect(hover.dartdoc, isNull);
423-
expect(hover.elementDescription, 'dynamic vvv');
423+
expect(hover.elementDescription, 'int vvv');
424424
expect(hover.elementKind, 'local variable');
425425
// types
426-
expect(hover.staticType, 'dynamic');
427-
expect(hover.propagatedType, 'int');
426+
expect(hover.staticType, 'int');
427+
expect(hover.propagatedType, null);
428428
}
429429

430430
test_expression_variable_inMethod() async {
@@ -446,7 +446,7 @@ class A {
446446
expect(hover.elementKind, 'local variable');
447447
// types
448448
expect(hover.staticType, 'num');
449-
expect(hover.propagatedType, 'int');
449+
expect(hover.propagatedType, null);
450450
// no parameter
451451
expect(hover.parameter, isNull);
452452
}

pkg/analysis_server/test/analysis/notification_analysis_options_test.dart

Lines changed: 16 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ main() {
5959
handleSuccessfulRequest(request);
6060
}
6161

62-
void setStrongMode(bool isSet) {
63-
addOptionsFile('''
64-
analyzer:
65-
strong-mode: $isSet
66-
''');
67-
}
68-
6962
@override
7063
void setUp() {
7164
generateSummaryFiles = true;
@@ -202,19 +195,23 @@ linter:
202195

203196
await waitForTasksFinished();
204197

205-
// Verify strong-mode disabled.
206-
verifyStrongMode(enabled: false);
198+
// Verify that lints are disabled.
199+
expect(analysisOptions.lint, false);
207200

208201
// Clear errors.
209202
filesErrors[testFile] = [];
210203

211-
// Add options file with strong mode enabled.
212-
setStrongMode(true);
204+
// Add options file with a lint enabled.
205+
addOptionsFile('''
206+
linter:
207+
rules:
208+
- camel_case_types
209+
''');
213210

214211
await pumpEventQueue();
215212
await waitForTasksFinished();
216213

217-
verifyStrongMode(enabled: true);
214+
verifyLintsEnabled(['camel_case_types']);
218215
}
219216

220217
test_options_file_parse_error() async {
@@ -232,14 +229,18 @@ linter:
232229
}
233230

234231
test_options_file_removed() async {
235-
setStrongMode(true);
232+
addOptionsFile('''
233+
linter:
234+
rules:
235+
- camel_case_types
236+
''');
236237

237238
addTestFile(testSource);
238239
setAnalysisRoot();
239240

240241
await waitForTasksFinished();
241242

242-
verifyStrongMode(enabled: true);
243+
verifyLintsEnabled(['camel_case_types']);
243244

244245
// Clear errors.
245246
filesErrors[testFile] = [];
@@ -249,46 +250,7 @@ linter:
249250
await pumpEventQueue();
250251
await waitForTasksFinished();
251252

252-
verifyStrongMode(enabled: false);
253-
}
254-
255-
test_strong_mode_changed_off() async {
256-
setStrongMode(true);
257-
258-
addTestFile(testSource);
259-
setAnalysisRoot();
260-
261-
await waitForTasksFinished();
262-
263-
verifyStrongMode(enabled: true);
264-
265-
// Clear errors.
266-
filesErrors[testFile] = [];
267-
268-
setStrongMode(false);
269-
270-
await pumpEventQueue();
271-
await waitForTasksFinished();
272-
273-
verifyStrongMode(enabled: false);
274-
}
275-
276-
test_strong_mode_changed_on() async {
277-
setStrongMode(false);
278-
279-
addTestFile(testSource);
280-
setAnalysisRoot();
281-
282-
await waitForTasksFinished();
283-
284-
verifyStrongMode(enabled: false);
285-
286-
setStrongMode(true);
287-
288-
await pumpEventQueue();
289-
await waitForTasksFinished();
290-
291-
verifyStrongMode(enabled: true);
253+
expect(analysisOptions.lint, false);
292254
}
293255

294256
void verifyLintsEnabled(List<String> lints) {
@@ -297,21 +259,6 @@ linter:
297259
var rules = options.lintRules.map((rule) => rule.name);
298260
expect(rules, unorderedEquals(lints));
299261
}
300-
301-
verifyStrongMode({bool enabled}) {
302-
// Verify strong-mode enabled.
303-
expect(analysisOptions.strongMode, enabled);
304-
305-
if (enabled) {
306-
// Should produce a type warning.
307-
expect(errors.map((error) => error.type),
308-
unorderedEquals([AnalysisErrorType.STATIC_TYPE_WARNING]));
309-
} else {
310-
// Should only produce a hint.
311-
expect(errors.map((error) => error.type),
312-
unorderedEquals([AnalysisErrorType.HINT]));
313-
}
314-
}
315262
}
316263

317264
@reflectiveTest

pkg/analysis_server/test/analysis/notification_errors_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ version: 1.3.2
188188
createProject();
189189
addTestFile('''
190190
main() {
191-
print(UNKNOWN);
191+
final int foo;
192+
print(foo);
192193
}
193194
''');
194195
await waitForTasksFinished();

pkg/analysis_server/test/completion_test.dart

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -294,27 +294,6 @@ void r() {
294294
}
295295
}''', <String>["1+toUpperCase", "2-getKeys"]);
296296

297-
// Type propagation.
298-
buildTests('testCommentSnippets053', '''
299-
class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
300-
void r() {
301-
var v;
302-
while (v is String) {
303-
v.!1toUpperCase;
304-
v.!2getKeys;
305-
}
306-
}''', <String>["1+toUpperCase", "2-getKeys"]);
307-
308-
buildTests('testCommentSnippets054', '''
309-
class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
310-
void r() {
311-
var v;
312-
for (; v is String; v.!1isEmpty) {
313-
v.!2toUpperCase;
314-
v.!3getKeys;
315-
}
316-
}''', <String>["1+isEmpty", "2+toUpperCase", "3-getKeys"]);
317-
318297
buildTests('testCommentSnippets055', '''
319298
class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
320299
void r() {
@@ -324,25 +303,6 @@ void r() {
324303
}
325304
}''', <String>["1+toUpperCase"]);
326305

327-
// Type propagation.
328-
buildTests('testCommentSnippets056', '''
329-
class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
330-
void f(var v) {
331-
if (v is!! String) {
332-
return;
333-
}
334-
v.!1toUpperCase;
335-
}''', <String>["1+toUpperCase"]);
336-
337-
// Type propagation.
338-
buildTests('testCommentSnippets057', '''
339-
class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
340-
void f(var v) {
341-
if ((v as String).!2length == 0) {
342-
v.!1toUpperCase;
343-
}
344-
}''', <String>["1+toUpperCase", "2+length"]);
345-
346306
buildTests(
347307
'testCommentSnippets058',
348308
'''
@@ -372,15 +332,6 @@ class Z {
372332
class A{m(){!1f(3);!2}}n(){!3f(3);!4}f(x)=>x*3;''',
373333
<String>["1+f", "1+n", "2+f", "2+n", "3+f", "3+n", "4+f", "4+n"]);
374334

375-
// Type propagation.
376-
buildTests('testCommentSnippets063', '''
377-
class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
378-
void r(var v) {
379-
v.!1toUpperCase;
380-
assert(v is String);
381-
v.!2toUpperCase;
382-
}''', <String>["1-toUpperCase", "2+toUpperCase"]);
383-
384335
buildTests('testCommentSnippets064', '''
385336
class Spline {
386337
Line c;
@@ -2363,8 +2314,7 @@ class A {
23632314

23642315
// test analysis of untyped fields and top-level vars
23652316
buildTests('test035', '''class Y {final x='hi';mth() {x.!1length;}}''',
2366-
<String>["1+length"],
2367-
failingTests: '1');
2317+
<String>["1+length"]);
23682318

23692319
// TODO(scheglov) decide what to do with Type for untyped field (not
23702320
// supported by the new store)

pkg/analyzer/lib/src/command_line/arguments.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ContextBuilderOptions createContextBuilderOptions(ArgResults args,
116116
// Declared variables.
117117
//
118118
Map<String, String> declaredVariables = <String, String>{};
119-
List<String> variables = args[defineVariableOption] as List<String>;
119+
List<String> variables = (args[defineVariableOption] as List).cast<String>();
120120
for (String variable in variables) {
121121
int index = variable.indexOf('=');
122122
if (index < 0) {

0 commit comments

Comments
 (0)