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

Side by Side Diff: pkg/kernel/lib/transformations/sanitize_for_vm.dart

Issue 2638303002: Do not emit InvalidStatement in sanitize_for_vm pass (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.transformations.fixvm; 4 library kernel.transformations.fixvm;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 7
8 /// Ensures that classes all have either a constructor or a procedure. 8 /// Ensures that classes all have either a constructor or a procedure.
9 /// 9 ///
10 /// VM-specific constraints that don't fit in anywhere else can be put here. 10 /// VM-specific constraints that don't fit in anywhere else can be put here.
11 class SanitizeForVM { 11 class SanitizeForVM {
12 void transform(Program program) { 12 void transform(Program program) {
13 for (var library in program.libraries) { 13 for (var library in program.libraries) {
14 for (var class_ in library.classes) { 14 for (var class_ in library.classes) {
15 if (class_.constructors.isEmpty && class_.procedures.isEmpty) { 15 if (class_.constructors.isEmpty && class_.procedures.isEmpty) {
16 class_.addMember(new Constructor( 16 class_.addMember(new Constructor(
17 new FunctionNode(new InvalidStatement()), 17 new FunctionNode(new EmptyStatement()),
18 name: new Name(''))); 18 name: new Name('')));
19 } 19 }
20 } 20 }
21 } 21 }
22 } 22 }
23 } 23 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698