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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 2079373002: Verify status of statically failing tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 4 years, 6 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 | « karma.conf.js ('k') | pubspec.lock » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index b04accc3c6d593fedc0d3257bed286404e5e4159..16eb673a577737552ba40cb5145aeea6f8bf81dd 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -783,8 +783,8 @@ class CodeGenerator extends GeneralizingAstVisitor
///
/// This ensures instances created by the unnamed constructor are functions.
/// Named constructors are handled elsewhere, see [_defineNamedConstructors].
- JS.Expression _emitCallableClass(JS.ClassExpression classExpr,
- ConstructorElement unnamedCtor) {
+ JS.Expression _emitCallableClass(
+ JS.ClassExpression classExpr, ConstructorElement unnamedCtor) {
var ctor = new JS.NamedFunction(
classExpr.name, _emitCallableClassConstructor(unnamedCtor));
@@ -792,9 +792,7 @@ class CodeGenerator extends GeneralizingAstVisitor
return js.call('dart.callableClass(#, #)', [ctor, classExpr]);
}
- JS.Fun _emitCallableClassConstructor(
- ConstructorElement ctor) {
-
+ JS.Fun _emitCallableClassConstructor(ConstructorElement ctor) {
return js.call(
r'''function (...args) {
const self = this;
@@ -1022,16 +1020,12 @@ class CodeGenerator extends GeneralizingAstVisitor
}
}
- void _defineClass(
- ClassElement classElem,
- JS.Expression className,
- JS.ClassExpression classExpr,
- bool isCallable,
- List<JS.Statement> body) {
+ void _defineClass(ClassElement classElem, JS.Expression className,
+ JS.ClassExpression classExpr, bool isCallable, List<JS.Statement> body) {
JS.Expression callableClass;
if (isCallable && classElem.unnamedConstructor != null) {
- callableClass = _emitCallableClass(
- classExpr, classElem.unnamedConstructor);
+ callableClass =
+ _emitCallableClass(classExpr, classElem.unnamedConstructor);
}
if (classElem.typeParameters.isNotEmpty) {
@@ -1458,11 +1452,8 @@ class CodeGenerator extends GeneralizingAstVisitor
}
}
- void _defineNamedConstructors(
- List<ConstructorDeclaration> ctors,
- List<JS.Statement> body,
- JS.Expression className,
- bool isCallable) {
+ void _defineNamedConstructors(List<ConstructorDeclaration> ctors,
+ List<JS.Statement> body, JS.Expression className, bool isCallable) {
var code = isCallable
? 'dart.defineNamedConstructorCallable(#, #, #);'
: 'dart.defineNamedConstructor(#, #)';
« no previous file with comments | « karma.conf.js ('k') | pubspec.lock » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698