From 6e1a0b08c7cb67ff66176f7962a863d0598f0580 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 27 Jan 2021 18:41:10 +0000 Subject: [PATCH] Update to null safe package:html Change-Id: I667efbe0f895628130bc695e96a7f95a991c2e9d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181040 Commit-Queue: Nate Bosch Reviewed-by: Jake Macdonald --- .dart_tool/package_config.json | 2 +- DEPS | 2 +- pkg/analysis_server/tool/spec/to_html.dart | 2 +- pkg/analyzer_plugin/tool/spec/to_html.dart | 2 +- pkg/analyzer_utilities/lib/html.dart | 4 ++-- pkg/analyzer_utilities/lib/tools.dart | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 3daa83f4757..c6e4271a0fe 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -296,7 +296,7 @@ "name": "html", "rootUri": "../third_party/pkg/html", "packageUri": "lib/", - "languageVersion": "2.8" + "languageVersion": "2.12" }, { "name": "http", diff --git a/DEPS b/DEPS index 5761840d77f..8ddc6b3ebe8 100644 --- a/DEPS +++ b/DEPS @@ -106,7 +106,7 @@ vars = { "fixnum_rev": "16d3890c6dc82ca629659da1934e412292508bba", "file_rev": "0e09370f581ab6388d46fda4cdab66638c0171a1", "glob_rev": "7c0ef8d4fa086f6b185c4dd724b700e7d7ad8f79", - "html_rev": "7f31979303f916f2aabb9e2091950798abdd9ca1", + "html_rev": "00cd3c22dac0e68e6ed9e7e4945101aedb1b3109", "http_io_rev": "2fa188caf7937e313026557713f7feffedd4978b", "http_multi_server_rev" : "e8c8be7f15b4fb50757ff5bf29766721fbe24fe4", "http_parser_rev": "5dd4d16693242049dfb43b5efa429fedbf932e98", diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart index db50d44cd8a..7246acdf0a8 100644 --- a/pkg/analysis_server/tool/spec/to_html.dart +++ b/pkg/analysis_server/tool/spec/to_html.dart @@ -169,7 +169,7 @@ mixin HtmlMixin { void dl(void Function() callback) => element('dl', {}, callback); void dt(String cls, void Function() callback) => element('dt', {'class': cls}, callback); - void element(String name, Map attributes, + void element(String name, Map attributes, [void Function() callback]); void gray(void Function() callback) => element('span', {'style': 'color:#999999'}, callback); diff --git a/pkg/analyzer_plugin/tool/spec/to_html.dart b/pkg/analyzer_plugin/tool/spec/to_html.dart index 923e34bde27..8c9ea3327d2 100644 --- a/pkg/analyzer_plugin/tool/spec/to_html.dart +++ b/pkg/analyzer_plugin/tool/spec/to_html.dart @@ -169,7 +169,7 @@ abstract class HtmlMixin { void dl(void Function() callback) => element('dl', {}, callback); void dt(String cls, void Function() callback) => element('dt', {'class': cls}, callback); - void element(String name, Map attributes, + void element(String name, Map attributes, [void Function() callback]); void gray(void Function() callback) => element('span', {'style': 'color:#999999'}, callback); diff --git a/pkg/analyzer_utilities/lib/html.dart b/pkg/analyzer_utilities/lib/html.dart index 859740f27b1..06d19807d79 100644 --- a/pkg/analyzer_utilities/lib/html.dart +++ b/pkg/analyzer_utilities/lib/html.dart @@ -51,7 +51,7 @@ bool isWhitespaceNode(dom.Node node) { /// Create an HTML element with the given name, attributes, and child nodes. dom.Element makeElement( - String name, Map attributes, List children) { + String name, Map attributes, List children) { var result = dom.Element.tag(name); result.attributes.addAll(attributes); for (var child in children) { @@ -94,7 +94,7 @@ mixin HtmlGenerator { /// Execute [callback], wrapping its output in an element with the given /// [name] and [attributes]. - void element(String name, Map attributes, + void element(String name, Map attributes, [void Function()? callback]) { add(makeElement(name, attributes, collectHtml(callback))); } diff --git a/pkg/analyzer_utilities/lib/tools.dart b/pkg/analyzer_utilities/lib/tools.dart index 3ea8a6b0b1b..12210c84371 100644 --- a/pkg/analyzer_utilities/lib/tools.dart +++ b/pkg/analyzer_utilities/lib/tools.dart @@ -482,7 +482,7 @@ abstract class HtmlCodeGenerator { /// Execute [callback], wrapping its output in an element with the given /// [name] and [attributes]. - void element(String name, Map attributes, + void element(String name, Map attributes, [void Function()? callback]) { add(makeElement(name, attributes, collectHtml(callback))); }