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

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

Issue 208043003: Rename [call$...] properties to [$...] in compiled code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: found another use of call Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js/closure_codegen_test.dart ('k') | 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) 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 // Test constant folding. 4 // Test constant folding.
5 5
6 library compiler_helper; 6 library compiler_helper;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 js.JavaScriptBackend backend = compiler.backend; 82 js.JavaScriptBackend backend = compiler.backend;
83 return backend.assembleCode(element); 83 return backend.assembleCode(element);
84 } 84 }
85 85
86 // TODO(herhut): Disallow warnings and errors during compilation by default. 86 // TODO(herhut): Disallow warnings and errors during compilation by default.
87 MockCompiler compilerFor(String code, Uri uri, 87 MockCompiler compilerFor(String code, Uri uri,
88 {bool analyzeAll: false, 88 {bool analyzeAll: false,
89 bool analyzeOnly: false, 89 bool analyzeOnly: false,
90 String coreSource: DEFAULT_CORELIB, 90 String coreSource: DEFAULT_CORELIB,
91 bool disableInlining: true, 91 bool disableInlining: true,
92 bool minify: false,
92 int expectedErrors, 93 int expectedErrors,
93 int expectedWarnings}) { 94 int expectedWarnings}) {
94 MockCompiler compiler = new MockCompiler( 95 MockCompiler compiler = new MockCompiler(
95 analyzeAll: analyzeAll, 96 analyzeAll: analyzeAll,
96 analyzeOnly: analyzeOnly, 97 analyzeOnly: analyzeOnly,
97 coreSource: coreSource, 98 coreSource: coreSource,
98 disableInlining: disableInlining, 99 disableInlining: disableInlining,
100 enableMinification: minify,
99 expectedErrors: expectedErrors, 101 expectedErrors: expectedErrors,
100 expectedWarnings: expectedWarnings); 102 expectedWarnings: expectedWarnings);
101 compiler.sourceFiles[uri.toString()] = 103 compiler.sourceFiles[uri.toString()] =
102 new StringSourceFile(uri.toString(), code); 104 new StringSourceFile(uri.toString(), code);
103 return compiler; 105 return compiler;
104 } 106 }
105 107
106 Future<String> compileAll(String code, 108 Future<String> compileAll(String code,
107 {String coreSource: DEFAULT_CORELIB, 109 {String coreSource: DEFAULT_CORELIB,
108 bool disableInlining: true, 110 bool disableInlining: true,
111 bool minify: false,
109 int expectedErrors, 112 int expectedErrors,
110 int expectedWarnings}) { 113 int expectedWarnings}) {
111 Uri uri = new Uri(scheme: 'source'); 114 Uri uri = new Uri(scheme: 'source');
112 MockCompiler compiler = compilerFor( 115 MockCompiler compiler = compilerFor(
113 code, uri, coreSource: coreSource, disableInlining: disableInlining, 116 code, uri, coreSource: coreSource, disableInlining: disableInlining,
114 expectedErrors: expectedErrors, expectedWarnings: expectedWarnings); 117 minify: minify, expectedErrors: expectedErrors,
118 expectedWarnings: expectedWarnings);
115 return compiler.runCompiler(uri).then((_) { 119 return compiler.runCompiler(uri).then((_) {
116 Expect.isFalse(compiler.compilationFailed, 120 Expect.isFalse(compiler.compilationFailed,
117 'Unexpected compilation error'); 121 'Unexpected compilation error');
118 return compiler.assembledCode; 122 return compiler.assembledCode;
119 }); 123 });
120 } 124 }
121 125
122 Future compileAndCheck(String code, 126 Future compileAndCheck(String code,
123 String name, 127 String name,
124 check(MockCompiler compiler, lego.Element element), 128 check(MockCompiler compiler, lego.Element element),
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 final xRe = new RegExp('\\bx\\b'); 232 final xRe = new RegExp('\\bx\\b');
229 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); 233 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
230 final spaceRe = new RegExp('\\s+'); 234 final spaceRe = new RegExp('\\s+');
231 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); 235 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)');
232 if (shouldMatch) { 236 if (shouldMatch) {
233 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); 237 Expect.isTrue(new RegExp(regexp).hasMatch(generated));
234 } else { 238 } else {
235 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); 239 Expect.isFalse(new RegExp(regexp).hasMatch(generated));
236 } 240 }
237 } 241 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/closure_codegen_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698