mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[dart2js] Migrate developer patch file to nnbd.
Note: This is mostly just the DDC developer patch file. Change-Id: I98277304b2fbe8fa939dc7e6fb4bd9e0c199b2b0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135535 Commit-Queue: Joshua Litt <joshualitt@google.com> Reviewed-by: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
parent
0838c9ebc2
commit
166edab750
|
@ -1,3 +1,4 @@
|
|||
ERROR|COMPILE_TIME_ERROR|CONST_EVAL_THROWS_EXCEPTION|lib/developer/developer.dart|522|5|73|Evaluation of this constant expression throws an exception.
|
||||
ERROR|COMPILE_TIME_ERROR|EXPORT_LEGACY_SYMBOL|lib/html/dart2js/html_dart2js.dart|70|8|18|The symbol 'promiseToFuture' is defined in a legacy library, and can't be re-exported from a non-nullable by default library.
|
||||
ERROR|COMPILE_TIME_ERROR|EXPORT_LEGACY_SYMBOL|lib/html/html_common/html_common_dart2js.dart|19|8|14|The symbol 'promiseToFuture' is defined in a legacy library, and can't be re-exported from a non-nullable by default library.
|
||||
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1639|7|5|Superinterfaces don't have a valid override for '&': int.& (int* Function(int*)*), JSNumber.& (num Function(num)).
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// @dart = 2.5
|
||||
|
||||
// Patch file for dart:developer library.
|
||||
|
||||
import 'dart:_js_helper' show patch, ForceInline;
|
||||
|
@ -13,7 +11,7 @@ import 'dart:isolate';
|
|||
|
||||
@patch
|
||||
@pragma('dart2js:tryInline')
|
||||
bool debugger({bool when: true, String message}) {
|
||||
bool debugger({bool when = true, String? message}) {
|
||||
if (when) {
|
||||
JS('', 'debugger');
|
||||
}
|
||||
|
@ -21,26 +19,26 @@ bool debugger({bool when: true, String message}) {
|
|||
}
|
||||
|
||||
@patch
|
||||
Object inspect(Object object) {
|
||||
Object? inspect(Object? object) {
|
||||
return object;
|
||||
}
|
||||
|
||||
@patch
|
||||
void log(String message,
|
||||
{DateTime time,
|
||||
int sequenceNumber,
|
||||
int level: 0,
|
||||
String name: '',
|
||||
Zone zone,
|
||||
Object error,
|
||||
StackTrace stackTrace}) {
|
||||
{DateTime? time,
|
||||
int? sequenceNumber,
|
||||
int level = 0,
|
||||
String name = '',
|
||||
Zone? zone,
|
||||
Object? error,
|
||||
StackTrace? stackTrace}) {
|
||||
// TODO.
|
||||
}
|
||||
|
||||
final _extensions = new Map<String, ServiceExtensionHandler>();
|
||||
final _extensions = <String, ServiceExtensionHandler>{};
|
||||
|
||||
@patch
|
||||
ServiceExtensionHandler _lookupExtension(String method) {
|
||||
ServiceExtensionHandler? _lookupExtension(String method) {
|
||||
return _extensions[method];
|
||||
}
|
||||
|
||||
|
@ -110,7 +108,7 @@ void _webServerControl(SendPort sendPort, bool enable) {
|
|||
}
|
||||
|
||||
@patch
|
||||
String _getIsolateIDFromSendPort(SendPort sendPort) {
|
||||
String? _getIsolateIDFromSendPort(SendPort sendPort) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -124,7 +122,7 @@ class UserTag {
|
|||
}
|
||||
|
||||
class _FakeUserTag implements UserTag {
|
||||
static Map _instances = {};
|
||||
static final _instances = <String, _FakeUserTag>{};
|
||||
|
||||
_FakeUserTag.real(this.label);
|
||||
|
||||
|
@ -136,13 +134,10 @@ class _FakeUserTag implements UserTag {
|
|||
}
|
||||
// Throw an exception if we've reached the maximum number of user tags.
|
||||
if (_instances.length == UserTag.MAX_USER_TAGS) {
|
||||
throw new UnsupportedError(
|
||||
throw UnsupportedError(
|
||||
'UserTag instance limit (${UserTag.MAX_USER_TAGS}) reached.');
|
||||
}
|
||||
// Create a new instance and add it to the instance map.
|
||||
var instance = new _FakeUserTag.real(label);
|
||||
_instances[label] = instance;
|
||||
return instance;
|
||||
return _instances[label] = _FakeUserTag.real(label);
|
||||
}
|
||||
|
||||
final String label;
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
"patches": "../../sdk/lib/_internal/js_runtime/lib/core_patch.dart"
|
||||
},
|
||||
"developer": {
|
||||
"uri": "../../sdk/lib/developer/developer.dart",
|
||||
"patches": "../../sdk/lib/_internal/js_runtime/lib/developer_patch.dart"
|
||||
"uri": "developer/developer.dart",
|
||||
"patches": "_internal/js_runtime/lib/developer_patch.dart"
|
||||
},
|
||||
"html": {
|
||||
"uri": "html/dart2js/html_dart2js.dart"
|
||||
|
|
Loading…
Reference in a new issue