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

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

Issue 1314973003: Add support for analyzing individual URIs. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 5 years, 3 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 // Test that the CPS IR code generator generates source information. 5 // Test that the CPS IR code generator generates source information.
6 6
7 library source_information_tests; 7 library source_information_tests;
8 8
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 js.Node ast = compiler.enqueuer.codegen.generatedCode[foundElement]; 61 js.Node ast = compiler.enqueuer.codegen.generatedCode[foundElement];
62 return js.prettyPrint(ast, compiler).getText(); 62 return js.prettyPrint(ast, compiler).getText();
63 } 63 }
64 64
65 runTests(List<TestEntry> tests) { 65 runTests(List<TestEntry> tests) {
66 for (TestEntry test in tests) { 66 for (TestEntry test in tests) {
67 Map files = {TEST_MAIN_FILE: test.source}; 67 Map files = {TEST_MAIN_FILE: test.source};
68 asyncTest(() { 68 asyncTest(() {
69 Compiler compiler = compilerFor(files, options: <String>['--use-cps-ir']); 69 Compiler compiler = compilerFor(
70 memorySourceFiles: files, options: <String>['--use-cps-ir']);
70 ir.FunctionDefinition irNodeForMain; 71 ir.FunctionDefinition irNodeForMain;
71 72
72 void cacheIrNodeForMain(Element function, ir.FunctionDefinition irNode) { 73 void cacheIrNodeForMain(Element function, ir.FunctionDefinition irNode) {
73 if (function == compiler.mainFunction) { 74 if (function == compiler.mainFunction) {
74 assert(irNodeForMain == null); 75 assert(irNodeForMain == null);
75 irNodeForMain = irNode; 76 irNodeForMain = irNode;
76 } 77 }
77 } 78 }
78 79
79 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE'); 80 Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 print('Hello'); 140 print('Hello');
140 print('World'); 141 print('World');
141 } 142 }
142 """, const ['memory:test.dart:[2,3]', 143 """, const ['memory:test.dart:[2,3]',
143 'memory:test.dart:[3,3]']), 144 'memory:test.dart:[3,3]']),
144 ]; 145 ];
145 146
146 void main() { 147 void main() {
147 runTests(tests); 148 runTests(tests);
148 } 149 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/incremental/compile_all.dart ('k') | tests/compiler/dart2js/memory_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698