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

Side by Side Diff: tests/compiler/dart2js/compiler_helper.dart

Issue 2997413002: Support --use-kernel in memory_compiler (Closed)
Patch Set: Created 3 years, 4 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 4
5 library compiler_helper; 5 library compiler_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 import 'package:compiler/compiler_new.dart'; 10 import 'package:compiler/compiler_new.dart';
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 CompilationResult result = await runCompiler( 126 CompilationResult result = await runCompiler(
127 memorySourceFiles: source, 127 memorySourceFiles: source,
128 options: options, 128 options: options,
129 outputProvider: outputCollector); 129 outputProvider: outputCollector);
130 Expect.isTrue(result.isSuccess); 130 Expect.isTrue(result.isSuccess);
131 Compiler compiler = result.compiler; 131 Compiler compiler = result.compiler;
132 LibraryElement mainApp = 132 LibraryElement mainApp =
133 compiler.frontendStrategy.elementEnvironment.mainLibrary; 133 compiler.frontendStrategy.elementEnvironment.mainLibrary;
134 Element element = mainApp.find(entry); 134 MemberElement element = mainApp.find(entry);
135 js.JavaScriptBackend backend = compiler.backend; 135 js.JavaScriptBackend backend = compiler.backend;
136 String generated = backend.getGeneratedCode(element); 136 String generated = backend.getGeneratedCode(element);
137 if (check != null) { 137 if (check != null) {
138 check(generated); 138 check(generated);
139 } 139 }
140 return returnAll ? outputCollector.getOutput('', OutputType.js) : generated; 140 return returnAll ? outputCollector.getOutput('', OutputType.js) : generated;
141 } 141 }
142 } 142 }
143 143
144 Future<String> compileAll(String code, 144 Future<String> compileAll(String code,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 } 301 }
302 } 302 }
303 } 303 }
304 304
305 return checker; 305 return checker;
306 } 306 }
307 307
308 RegExp _directivePattern = new RegExp( 308 RegExp _directivePattern = new RegExp(
309 // \1 \2 \3 309 // \1 \2 \3
310 r'''// *(present|absent): *(?:"([^"]*)"|'([^'']*)')''', multiLine: true); 310 r'''// *(present|absent): *(?:"([^"]*)"|'([^'']*)')''', multiLine: true);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698