@@ -13,15 +13,15 @@ import 'dart:isolate';
1313
1414@patch
1515@ForceInline ()
16- bool debugger ({bool when = true , String message}) {
16+ bool debugger ({bool when = true , String ? message}) {
1717 if (when ) {
1818 JS ('' , 'debugger' );
1919 }
2020 return when ;
2121}
2222
2323@patch
24- Object inspect (Object object) {
24+ Object ? inspect (Object ? object) {
2525 // Note: this log level does not show up by default in Chrome.
2626 // This is used for communication with the debugger service.
2727 JS ('' , 'console.debug("dart.developer.inspect", #)' , object);
@@ -30,13 +30,13 @@ Object inspect(Object object) {
3030
3131@patch
3232void log (String message,
33- {DateTime time,
34- int sequenceNumber,
33+ {DateTime ? time,
34+ int ? sequenceNumber,
3535 int level = 0 ,
3636 String name = '' ,
37- Zone zone,
38- Object error,
39- StackTrace stackTrace}) {
37+ Zone ? zone,
38+ Object ? error,
39+ StackTrace ? stackTrace}) {
4040 Object items =
4141 JS ('!' , '{ message: #, name: #, level: # }' , message, name, level);
4242 if (time != null ) JS ('' , '#.time = #' , items, time);
@@ -50,10 +50,10 @@ void log(String message,
5050 JS ('' , 'console.debug("dart.developer.log", #)' , items);
5151}
5252
53- final _extensions = Map <String , ServiceExtensionHandler >() ;
53+ final _extensions = < String , ServiceExtensionHandler > {} ;
5454
5555@patch
56- ServiceExtensionHandler _lookupExtension (String method) {
56+ ServiceExtensionHandler ? _lookupExtension (String method) {
5757 return _extensions[method];
5858}
5959
@@ -79,7 +79,7 @@ _invokeExtension(String methodName, String encodedJson) {
7979 return JS ('' , 'new #.Promise(#)' , dart.global_,
8080 (Function (Object ) resolve, Function (Object ) reject) async {
8181 try {
82- var method = _lookupExtension (methodName);
82+ var method = _lookupExtension (methodName)! ;
8383 var parameters = (json.decode (encodedJson) as Map ).cast <String , String >();
8484 var result = await method (methodName, parameters);
8585 resolve (result._toString ());
@@ -164,7 +164,7 @@ void _webServerControl(SendPort sendPort, bool enable) {
164164}
165165
166166@patch
167- String _getIsolateIDFromSendPort (SendPort sendPort) {
167+ String ? _getIsolateIDFromSendPort (SendPort sendPort) {
168168 return null ;
169169}
170170
@@ -178,7 +178,7 @@ class UserTag {
178178}
179179
180180class _FakeUserTag implements UserTag {
181- static Map _instances = {};
181+ static final _instances = < String , _FakeUserTag > {};
182182
183183 _FakeUserTag .real (this .label);
184184
@@ -193,10 +193,7 @@ class _FakeUserTag implements UserTag {
193193 throw UnsupportedError (
194194 'UserTag instance limit (${UserTag .MAX_USER_TAGS }) reached.' );
195195 }
196- // Create a new instance and add it to the instance map.
197- var instance = _FakeUserTag .real (label);
198- _instances[label] = instance;
199- return instance;
196+ return _instances[label] = _FakeUserTag .real (label);
200197 }
201198
202199 final String label;
0 commit comments