[dartdevc] Cleaning up required name arg stringification.

Change-Id: Ib10bd1a0d986a3ca4e37000a909be9a2fced5f45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139944
Auto-Submit: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
This commit is contained in:
Mark Zhou 2020-03-18 21:47:12 +00:00 committed by commit-bot@chromium.org
parent 75a720f2fb
commit 84a2f271a3

View file

@ -760,7 +760,8 @@ class FunctionType extends AbstractFunctionType {
var typeNameString = typeName(JS('', '#[#[#]]', named, names, i));
buffer += '$typeNameString ${JS('', '#[#]', names, i)}';
}
if (JS('!', 'Object.keys(#).length > 0', requiredNamed)) buffer += ', ';
if (JS('!', 'Object.keys(#).length > 0 && #.length > 0', requiredNamed,
names)) buffer += ', ';
names = getOwnPropertyNames(requiredNamed);
JS('', '#.sort()', names);
for (var i = 0; JS<bool>('!', '# < #.length', i, names); i++) {