[dartdevc,nnbd] analyze whole sdk, fix isolate errors

This should fix all ddc isolate errors.  Remaining two io/_http errors are due to:
https://github.com/dart-lang/sdk/issues/40482

The rest are mirrors.  Do we think we'll be able to remove it altogether?  If not,
I can take a pass to fix.

Change-Id: I4cef9773b5fa36490bdfbc08a06fae6cd80c5eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134860
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Vijay Menon 2020-02-07 20:50:16 +00:00
parent 7869bc39c6
commit 05b806ace7
3 changed files with 56 additions and 6 deletions

View file

@ -46,11 +46,60 @@ void main(List<String> argv) {
'--nnbd',
]);
var emptyProgramUri = baseUri.resolve('empty_program.dart');
File.fromUri(emptyProgramUri).writeAsStringSync('''
var isWeb = false;
var isNative = false;
switch (target) {
case 'dartdevc':
case 'dart2js':
isWeb = true;
break;
case 'flutter':
case 'vm':
isNative = true;
break;
}
var core = '''
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
import 'dart:core';
import 'dart:developer';
import 'dart:math';
import 'dart:typed_data';
''';
var web = !isWeb
? ''
: '''
import 'dart:js';
import 'dart:js_util';
import 'dart:indexed_db';
import 'dart:html';
import 'dart:html_common';
import 'dart:svg';
import 'dart:web_audio';
import 'dart:web_gl';
import 'dart:web_sql';
''';
var native = !isNative
? '''
import 'dart:io';
import 'dart:isolate';
'''
: '''
import 'dart:ffi';
import 'dart:io';
import 'dart:isolate';
import 'dart:mirrors';
''';
var emptyProgramUri = baseUri.resolve('empty_program.dart');
File.fromUri(emptyProgramUri).writeAsStringSync('''
$core
$web
$native
main() {}
''');

View file

@ -1 +1,2 @@
ERROR|STATIC_WARNING|UNCHECKED_USE_OF_NULLABLE_VALUE|lib/_http/http.dart|7638|7|11|The expression is nullable and must be null-checked before it can be used.
ERROR|STATIC_WARNING|UNCHECKED_USE_OF_NULLABLE_VALUE|lib/_http/http.dart|8726|5|24|The expression is nullable and must be null-checked before it can be used.

View file

@ -43,7 +43,7 @@ class Isolate {
bool errorsAreFatal = true,
bool? checked,
Map<String, String>? environment,
Uri packageRoot,
Uri? packageRoot,
Uri? packageConfig,
bool automaticPackageResolution = false,
String? debugName}) =>
@ -69,7 +69,7 @@ class Isolate {
void kill({int priority = beforeNextEvent}) => _unsupported();
@patch
void ping(SendPort responsePort,
{Object response, int priority = immediate}) =>
{Object? response, int priority = immediate}) =>
_unsupported();
@patch
@ -101,7 +101,7 @@ class _ReceivePort extends Stream implements ReceivePort {
StreamSubscription listen(void Function(dynamic)? onData,
{Function? onError,
void Function()? onDone,
bool cancelOnError = true}) =>
bool? cancelOnError = true}) =>
_unsupported();
}