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

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

Issue 1235563003: Add interfaces for a new compiler API. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 5 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) 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 library mock_compiler; 5 library mock_compiler;
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 10
11 import 'package:compiler/compiler.dart' as api; 11 import 'package:compiler/compiler.dart' as api;
12 import 'package:compiler/src/constants/expressions.dart'; 12 import 'package:compiler/src/constants/expressions.dart';
13 import 'package:compiler/src/elements/elements.dart'; 13 import 'package:compiler/src/elements/elements.dart';
14 import 'package:compiler/src/js_backend/js_backend.dart' 14 import 'package:compiler/src/js_backend/js_backend.dart'
15 show JavaScriptBackend; 15 show JavaScriptBackend;
16 import 'package:compiler/src/resolution/resolution.dart'; 16 import 'package:compiler/src/resolution/resolution.dart';
17 import 'package:compiler/src/io/source_file.dart'; 17 import 'package:compiler/src/io/source_file.dart';
18 import 'package:compiler/src/tree/tree.dart'; 18 import 'package:compiler/src/tree/tree.dart';
19 import 'package:compiler/src/old_to_new_api.dart';
19 import 'package:compiler/src/util/util.dart'; 20 import 'package:compiler/src/util/util.dart';
20 import 'parser_helper.dart'; 21 import 'parser_helper.dart';
21 22
22 import 'package:compiler/src/elements/modelx.dart' 23 import 'package:compiler/src/elements/modelx.dart'
23 show ElementX, 24 show ElementX,
24 LibraryElementX, 25 LibraryElementX,
25 ErroneousElementX, 26 ErroneousElementX,
26 FunctionElementX; 27 FunctionElementX;
27 28
28 import 'package:compiler/src/dart2jslib.dart' 29 import 'package:compiler/src/dart2jslib.dart'
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 enableMinification: enableMinification, 87 enableMinification: enableMinification,
87 enableConcreteTypeInference: enableConcreteTypeInference, 88 enableConcreteTypeInference: enableConcreteTypeInference,
88 maxConcreteTypeSize: maxConcreteTypeSize, 89 maxConcreteTypeSize: maxConcreteTypeSize,
89 disableTypeInferenceFlag: disableTypeInference, 90 disableTypeInferenceFlag: disableTypeInference,
90 analyzeAllFlag: analyzeAll, 91 analyzeAllFlag: analyzeAll,
91 analyzeOnly: analyzeOnly, 92 analyzeOnly: analyzeOnly,
92 emitJavaScript: emitJavaScript, 93 emitJavaScript: emitJavaScript,
93 preserveComments: preserveComments, 94 preserveComments: preserveComments,
94 trustTypeAnnotations: trustTypeAnnotations, 95 trustTypeAnnotations: trustTypeAnnotations,
95 showPackageWarnings: true, 96 showPackageWarnings: true,
96 outputProvider: outputProvider) { 97 outputProvider: new LegacyCompilerOutput(outputProvider)) {
97 this.disableInlining = disableInlining; 98 this.disableInlining = disableInlining;
98 99
99 deferredLoadTask = new MockDeferredLoadTask(this); 100 deferredLoadTask = new MockDeferredLoadTask(this);
100 101
101 clearMessages(); 102 clearMessages();
102 103
103 registerSource(Compiler.DART_CORE, 104 registerSource(Compiler.DART_CORE,
104 buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource)); 105 buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource));
105 registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE); 106 registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE);
106 107
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 MockElement(Element enclosingElement) 401 MockElement(Element enclosingElement)
401 : super('', ElementKind.FUNCTION, Modifiers.EMPTY, 402 : super('', ElementKind.FUNCTION, Modifiers.EMPTY,
402 enclosingElement); 403 enclosingElement);
403 404
404 get node => null; 405 get node => null;
405 406
406 parseNode(_) => null; 407 parseNode(_) => null;
407 408
408 bool get hasNode => false; 409 bool get hasNode => false;
409 } 410 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/missing_file_test.dart ('k') | tests/compiler/dart2js/output_collector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698