Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1181)

Unified Diff: pkg/compiler/lib/src/js_emitter/native_emitter.dart

Issue 1859343004: dartfmt pkg/compiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | pkg/compiler/lib/src/js_emitter/native_generator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/native_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index dab8fe010b2bc0e672380ca0bb10f7a763dac109..6377d271ff576dc317546927815c94791c4db8d3 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -5,7 +5,6 @@
part of dart2js.js_emitter;
class NativeEmitter {
-
// TODO(floitsch): the native-emitter should not know about ClassBuilders.
final Map<Element, full_js_emitter.ClassBuilder> cachedBuilders;
@@ -71,7 +70,8 @@ class NativeEmitter {
* [classesModifiedByEmitRTISupport] contains the list of classes that must
* exist, because runtime-type support adds information to the class.
*/
- Set<Class> prepareNativeClasses(List<Class> classes,
+ Set<Class> prepareNativeClasses(
+ List<Class> classes,
Set<ClassElement> interceptorClassesNeededByConstants,
Set<ClassElement> classesModifiedByEmitRTISupport) {
assert(classes.every((Class cls) => cls != null));
@@ -137,9 +137,9 @@ class NativeEmitter {
needed = true;
}
if (backend.isJsInterop(classElement)) {
- needed = true; // TODO(jacobr): we don't need all interop classes.
+ needed = true; // TODO(jacobr): we don't need all interop classes.
} else if (cls.isNative &&
- backend.nativeData.hasNativeTagsForcedNonLeaf(classElement)) {
+ backend.nativeData.hasNativeTagsForcedNonLeaf(classElement)) {
needed = true;
nonLeafClasses.add(cls);
}
@@ -162,8 +162,7 @@ class NativeEmitter {
List<String> nativeTags =
backend.nativeData.getNativeTagsOfClass(cls.element);
- if (nonLeafClasses.contains(cls) ||
- extensionPoints.containsKey(cls)) {
+ if (nonLeafClasses.contains(cls) || extensionPoints.containsKey(cls)) {
nonleafTags
.putIfAbsent(cls, () => new Set<String>())
.addAll(nativeTags);
@@ -237,9 +236,7 @@ class NativeEmitter {
if (cls.isNative) continue;
Class nativeAncestor = nativeAncestorOf(cls);
if (nativeAncestor != null) {
- map
- .putIfAbsent(nativeAncestor, () => <Class>[])
- .add(cls);
+ map.putIfAbsent(nativeAncestor, () => <Class>[]).add(cls);
}
}
return map;
@@ -252,18 +249,15 @@ class NativeEmitter {
field.needsCheckedSetter;
}
- return
- cls.methods.isEmpty &&
+ return cls.methods.isEmpty &&
cls.isChecks.isEmpty &&
cls.callStubs.isEmpty &&
!cls.superclass.isMixinApplication &&
!cls.fields.any(needsAccessor);
}
- void potentiallyConvertDartClosuresToJs(
- List<jsAst.Statement> statements,
- FunctionElement member,
- List<jsAst.Parameter> stubParameters) {
+ void potentiallyConvertDartClosuresToJs(List<jsAst.Statement> statements,
+ FunctionElement member, List<jsAst.Parameter> stubParameters) {
FunctionSignature parameters = member.functionSignature;
Element converter = helpers.closureConverter;
jsAst.Expression closureConverter =
@@ -280,9 +274,8 @@ class NativeEmitter {
// typedef(s).
FunctionType functionType = type;
int arity = functionType.computeArity();
- statements.add(
- js.statement('# = #(#, $arity)',
- [name, closureConverter, name]));
+ statements.add(js
+ .statement('# = #(#, $arity)', [name, closureConverter, name]));
break;
}
}
@@ -320,13 +313,13 @@ class NativeEmitter {
if (isInterceptedMethod) {
receiver = argumentsBuffer[0];
- arguments = argumentsBuffer.sublist(1,
- indexOfLastOptionalArgumentInParameters + 1);
+ arguments = argumentsBuffer.sublist(
+ 1, indexOfLastOptionalArgumentInParameters + 1);
} else {
// Native methods that are not intercepted must be static.
assert(invariant(member, member.isStatic));
- arguments = argumentsBuffer.sublist(0,
- indexOfLastOptionalArgumentInParameters + 1);
+ arguments = argumentsBuffer.sublist(
+ 0, indexOfLastOptionalArgumentInParameters + 1);
if (backend.isJsInterop(member)) {
// fixedBackendPath is allowed to have the form foo.bar.baz for
// interop. This template is uncached to avoid possibly running out of
@@ -334,14 +327,15 @@ class NativeEmitter {
// caching these templates causing an issue is very low as each class
// and library that uses typed JavaScript interop will create only 1
// unique template.
- receiver = js.uncachedExpressionTemplate(
- backend.namer.fixedBackendPath(member)).instantiate([]);
+ receiver = js
+ .uncachedExpressionTemplate(backend.namer.fixedBackendPath(member))
+ .instantiate([]);
} else {
receiver = js('this');
}
}
- statements.add(
- js.statement('return #.#(#)', [receiver, target, arguments]));
+ statements
+ .add(js.statement('return #.#(#)', [receiver, target, arguments]));
return statements;
}
@@ -366,4 +360,4 @@ class NativeEmitter {
if (backend.isNativeOrExtendsNative(cls)) return true;
return isSupertypeOfNativeClass(element);
}
-}
+}
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/model.dart ('k') | pkg/compiler/lib/src/js_emitter/native_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698