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

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

Issue 1617083002: Base JavaScript code position computation on JavaScript tracer. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 foundElement = element; 54 foundElement = element;
55 } 55 }
56 } 56 }
57 57
58 if (foundElement == null) { 58 if (foundElement == null) {
59 Expect.fail('There is no compiled element called $name'); 59 Expect.fail('There is no compiled element called $name');
60 } 60 }
61 61
62 js.Node ast = compiler.enqueuer.codegen.generatedCode[foundElement]; 62 js.Node ast = compiler.enqueuer.codegen.generatedCode[foundElement];
63 return js.prettyPrint(ast, compiler).getText(); 63 return js.prettyPrint(ast, compiler);
64 } 64 }
65 65
66 runTests(List<TestEntry> tests) { 66 runTests(List<TestEntry> tests) {
67 for (TestEntry test in tests) { 67 for (TestEntry test in tests) {
68 Map files = {TEST_MAIN_FILE: test.source}; 68 Map files = {TEST_MAIN_FILE: test.source};
69 asyncTest(() { 69 asyncTest(() {
70 CompilerImpl compiler = compilerFor( 70 CompilerImpl compiler = compilerFor(
71 memorySourceFiles: files, options: <String>['--use-cps-ir']); 71 memorySourceFiles: files, options: <String>['--use-cps-ir']);
72 ir.FunctionDefinition irNodeForMain; 72 ir.FunctionDefinition irNodeForMain;
73 73
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 print('Hello'); 143 print('Hello');
144 print('World'); 144 print('World');
145 } 145 }
146 """, const ['memory:test.dart:[2,3]', 146 """, const ['memory:test.dart:[2,3]',
147 'memory:test.dart:[3,3]']), 147 'memory:test.dart:[3,3]']),
148 ]; 148 ];
149 149
150 void main() { 150 void main() {
151 runTests(tests); 151 runTests(tests);
152 } 152 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/cps_ir/runner.dart ('k') | tests/compiler/dart2js/js_parser_statements_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698