1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 00:08:46 +00:00

Fix html methods without returns

Several method bodies did not return a value conditionally or at all.

Change-Id: I01ca87e2e0501597bacb49bcddd10668b59026b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135626
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Srujan Gaddam 2020-02-19 20:43:34 +00:00 committed by commit-bot@chromium.org
parent 21b78a1f85
commit 59370f29c5
9 changed files with 16 additions and 11 deletions

View File

@ -15,6 +15,10 @@ used (see Issue [39627][]).
[39627]: https://github.com/dart-lang/sdk/issues/39627
* **Breaking Change**: `Node.insertAllBefore` erroneously had a return type of
`Node`, even though it was not returning anything. This has been corrected to
`void`.
#### `dart:io`
* Class `HttpParser` will no longer throw an exception when a HTTP response

View File

@ -1,9 +1,6 @@
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_runtime/lib/js_helper.dart|2688|17|17|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_runtime/lib/js_helper.dart|3632|5|11|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_runtime/lib/js_helper.dart|3660|5|6|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/html/dart2js/html_dart2js.dart|23331|8|15|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/html/dart2js/html_dart2js.dart|2978|13|11|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/html/dart2js/html_dart2js.dart|41436|8|15|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1637|7|5|Superinterfaces don't have a valid override for '&': int.& (int Function(int)), JSNumber.& (num Function(num)).
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1637|7|5|Superinterfaces don't have a valid override for '<<': int.<< (int Function(int)), JSNumber.<< (num Function(num)).
ERROR|COMPILE_TIME_ERROR|INCONSISTENT_INHERITANCE|lib/_internal/js_runtime/lib/interceptors.dart|1637|7|5|Superinterfaces don't have a valid override for '>>': int.>> (int Function(int)), JSNumber.>> (num Function(num)).
@ -18,5 +15,5 @@ WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/_http/http.dart|1476|39|5|The left
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/_http/http.dart|8384|60|5|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/_http/http.dart|9311|54|5|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/developer/developer.dart|315|25|23|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/html/dart2js/html_dart2js.dart|4075|25|2|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/html/dart2js/html_dart2js.dart|4076|25|2|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/io/io.dart|9167|16|1|The left operand can't be null, so the right operand is never executed.

View File

@ -15,13 +15,10 @@ ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_dev_runtime
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_dev_runtime/private/foreign_helper.dart|221|8|37|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_dev_runtime/private/foreign_helper.dart|224|8|11|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/_internal/js_dev_runtime/private/foreign_helper.dart|228|6|11|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/html/dart2js/html_dart2js.dart|23331|8|15|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/html/dart2js/html_dart2js.dart|2978|13|11|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
ERROR|COMPILE_TIME_ERROR|BODY_MAY_COMPLETE_NORMALLY|lib/html/dart2js/html_dart2js.dart|41436|8|15|The body might complete normally, which would cause 'null' to be returned, but the return type is a potentially non-nullable type.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/_http/http.dart|1476|39|5|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/_http/http.dart|8384|60|5|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/_http/http.dart|9311|54|5|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/collection/collection.dart|1076|46|13|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/developer/developer.dart|332|25|23|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/html/dart2js/html_dart2js.dart|4075|25|2|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/html/dart2js/html_dart2js.dart|4076|25|2|The left operand can't be null, so the right operand is never executed.
WARNING|STATIC_WARNING|DEAD_NULL_COALESCE|lib/io/io.dart|9167|16|1|The left operand can't be null, so the right operand is never executed.

View File

@ -2687,6 +2687,7 @@ class CanvasRenderingContext2D extends Interceptor
} else if (JS('bool', '!!#.webkitLineDash', this)) {
return JS('List<num>', '#.webkitLineDash', this);
}
return [];
}
@SupportedBrowser(SupportedBrowser.CHROME)
@ -22116,7 +22117,7 @@ class Node extends EventTarget {
*
* * [insertBefore]
*/
Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
void insertAllBefore(Iterable<Node> newNodes, Node refChild) {
if (newNodes is _ChildNodeListLazy) {
_ChildNodeListLazy otherList = newNodes;
if (identical(otherList._this, this)) {
@ -39349,6 +39350,7 @@ class _ThrowsNodeValidator implements NodeValidator {
throw new ArgumentError(
'${Element._safeTagName(element)}[$attributeName="$value"]');
}
return true;
}
}

View File

@ -2983,6 +2983,7 @@ class CanvasRenderingContext2D extends Interceptor
} else if (JS('bool', '!!#.webkitLineDash', this)) {
return JS('List<num>', '#.webkitLineDash', this);
}
return [];
}
@SupportedBrowser(SupportedBrowser.CHROME)
@ -23328,7 +23329,7 @@ class Node extends EventTarget {
*
* * [insertBefore]
*/
Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
void insertAllBefore(Iterable<Node> newNodes, Node refChild) {
if (newNodes is _ChildNodeListLazy) {
_ChildNodeListLazy otherList = newNodes;
if (identical(otherList._this, this)) {
@ -41438,6 +41439,7 @@ class _ThrowsNodeValidator implements NodeValidator {
throw new ArgumentError(
'${Element._safeTagName(element)}[$attributeName="$value"]');
}
return true;
}
}

View File

@ -147,6 +147,7 @@ class _ThrowsNodeValidator implements NodeValidator {
throw new ArgumentError(
'${Element._safeTagName(element)}[$attributeName="$value"]');
}
return true;
}
}

View File

@ -147,6 +147,7 @@ class _ThrowsNodeValidator implements NodeValidator {
throw new ArgumentError(
'${Element._safeTagName(element)}[$attributeName="$value"]');
}
return true;
}
}

View File

@ -250,6 +250,7 @@ $!MEMBERS
} else if (JS('bool', '!!#.webkitLineDash', this)) {
return JS('List<num>', '#.webkitLineDash', this);
}
return [];
}
@SupportedBrowser(SupportedBrowser.CHROME)

View File

@ -226,7 +226,7 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
*
* * [insertBefore]
*/
Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
void insertAllBefore(Iterable<Node> newNodes, Node refChild) {
if (newNodes is _ChildNodeListLazy) {
_ChildNodeListLazy otherList = newNodes;
if (identical(otherList._this, this)) {