From 173ad310a87a67b47d836e17ffe24ce2989ee016 Mon Sep 17 00:00:00 2001 From: Rutvik Tak Date: Sat, 31 Aug 2024 11:35:18 +0530 Subject: [PATCH] dart formatting updates --- web_generator/lib/src/translator.dart | 19 +++++++++++-------- web_generator/lib/src/webidl_api.dart | 6 ++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/web_generator/lib/src/translator.dart b/web_generator/lib/src/translator.dart index 2f640e8c..6aadb564 100644 --- a/web_generator/lib/src/translator.dart +++ b/web_generator/lib/src/translator.dart @@ -1223,9 +1223,12 @@ class Translator { final jsObject = _typeReference(_RawType('JSObject', false)); const representationFieldName = '_'; - final legacyNameSpace = extendedAttributes.firstWhereOrNull( - (extendedAttribute)=> extendedAttribute.name == 'LegacyNamespace', - )?.rhs.value; + final legacyNameSpace = extendedAttributes + .firstWhereOrNull( + (extendedAttribute) => extendedAttribute.name == 'LegacyNamespace', + ) + ?.rhs + .value; final instanceProperties = []; final staticProperties = []; for (final property in _properties(properties, mdnInterface)) { @@ -1234,12 +1237,12 @@ class Translator { return code.ExtensionType((b) => b ..docs.addAll(docs) ..annotations.addAll( - _jsOverride( - legacyNameSpace != null - ? '$legacyNameSpace.$jsName' + _jsOverride( + legacyNameSpace != null + ? '$legacyNameSpace.$jsName' : (isObjectLiteral || jsName == dartClassName ? '' : jsName), - ), - ) + ), + ) ..name = dartClassName ..primaryConstructorName = '_' ..representationDeclaration = code.RepresentationDeclaration((b) => b diff --git a/web_generator/lib/src/webidl_api.dart b/web_generator/lib/src/webidl_api.dart index d2876e83..1101fbcc 100644 --- a/web_generator/lib/src/webidl_api.dart +++ b/web_generator/lib/src/webidl_api.dart @@ -68,15 +68,13 @@ extension type Member._(JSObject _) implements JSObject { extension type ExtendedAttribute._(JSObject _) implements JSObject { external String get name; external RHS get rhs; - } extension type RHS._(JSObject _) implements JSObject { - external String get type; - external String get value; + external String get type; + external String get value; } - extension type Argument._(JSObject _) implements JSObject { external String get type; @JS('default')