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

Side by Side Diff: tests/utils/dummy_compiler_test.dart

Issue 12974002: Convert a == to a builtin identity check if the receiver type can only hit Object==. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « sdk/lib/_internal/compiler/implementation/universe/universe.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 4
5 // Smoke test of the dart2js compiler API. 5 // Smoke test of the dart2js compiler API.
6 library dummy_compiler; 6 library dummy_compiler;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:uri'; 9 import 'dart:uri';
10 10
11 import '../../sdk/lib/_internal/compiler/compiler.dart'; 11 import '../../sdk/lib/_internal/compiler/compiler.dart';
12 12
13 Future<String> provider(Uri uri) { 13 Future<String> provider(Uri uri) {
14 Completer<String> completer = new Completer<String>(); 14 Completer<String> completer = new Completer<String>();
15 String source; 15 String source;
16 if (uri.scheme == "main") { 16 if (uri.scheme == "main") {
17 source = "main() {}"; 17 source = "main() {}";
18 } else if (uri.scheme == "lib") { 18 } else if (uri.scheme == "lib") {
19 if (uri.path.endsWith("/core.dart")) { 19 if (uri.path.endsWith("/core.dart")) {
20 source = """library core; 20 source = """library core;
21 class Object {} 21 class Object {
22 operator==(other) {}
23 }
22 class Type {} 24 class Type {}
23 class bool {} 25 class bool {}
24 class num {} 26 class num {}
25 class int {} 27 class int {}
26 class double{} 28 class double{}
27 class String{} 29 class String{}
28 class Function{} 30 class Function{}
29 class List {} 31 class List {}
30 class Map {} 32 class Map {}
31 class Closure {} 33 class Closure {}
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 new Uri.fromComponents(scheme: 'package', path: '/'), 92 new Uri.fromComponents(scheme: 'package', path: '/'),
91 provider, handler); 93 provider, handler);
92 result.then((String code) { 94 result.then((String code) {
93 if (code == null) { 95 if (code == null) {
94 throw 'Compilation failed'; 96 throw 'Compilation failed';
95 } 97 }
96 }, onError: (AsyncError e) { 98 }, onError: (AsyncError e) {
97 throw 'Compilation failed'; 99 throw 'Compilation failed';
98 }); 100 });
99 } 101 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/universe/universe.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698