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

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

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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
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:uri"; 8 import "dart:uri";
9 9
10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t" 10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t"
(...skipping 10 matching lines...) Expand all
21 import "parser_helper.dart"; 21 import "parser_helper.dart";
22 22
23 String compile(String code, {String entry: 'main', 23 String compile(String code, {String entry: 'main',
24 bool enableTypeAssertions: false, 24 bool enableTypeAssertions: false,
25 bool minify: false}) { 25 bool minify: false}) {
26 MockCompiler compiler = 26 MockCompiler compiler =
27 new MockCompiler(enableTypeAssertions: enableTypeAssertions, 27 new MockCompiler(enableTypeAssertions: enableTypeAssertions,
28 enableMinification: minify); 28 enableMinification: minify);
29 compiler.parseScript(code); 29 compiler.parseScript(code);
30 lego.Element element = compiler.mainApp.find(buildSourceString(entry)); 30 lego.Element element = compiler.mainApp.find(buildSourceString(entry));
31 if (element === null) return null; 31 if (element == null) return null;
32 compiler.backend.enqueueHelpers(compiler.enqueuer.resolution); 32 compiler.backend.enqueueHelpers(compiler.enqueuer.resolution);
33 compiler.processQueue(compiler.enqueuer.resolution, element); 33 compiler.processQueue(compiler.enqueuer.resolution, element);
34 var context = new js.JavaScriptItemCompilationContext(); 34 var context = new js.JavaScriptItemCompilationContext();
35 leg.WorkItem work = new leg.WorkItem(element, null, context); 35 leg.WorkItem work = new leg.WorkItem(element, null, context);
36 work.run(compiler, compiler.enqueuer.codegen); 36 work.run(compiler, compiler.enqueuer.codegen);
37 return compiler.enqueuer.codegen.lookupCode(element); 37 return compiler.enqueuer.codegen.lookupCode(element);
38 } 38 }
39 39
40 MockCompiler compilerFor(String code, Uri uri) { 40 MockCompiler compilerFor(String code, Uri uri) {
41 MockCompiler compiler = new MockCompiler(); 41 MockCompiler compiler = new MockCompiler();
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); 117 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
118 final spaceRe = new RegExp('\\s+'); 118 final spaceRe = new RegExp('\\s+');
119 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); 119 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)');
120 if (shouldMatch) { 120 if (shouldMatch) {
121 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); 121 Expect.isTrue(new RegExp(regexp).hasMatch(generated));
122 } else { 122 } else {
123 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); 123 Expect.isFalse(new RegExp(regexp).hasMatch(generated));
124 } 124 }
125 } 125 }
126 126
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/begin_end_token_test.dart ('k') | tests/compiler/dart2js/compiler_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698