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

Side by Side Diff: pkg/dev_compiler/lib/src/compiler/compiler.dart

Issue 2578573003: Add dart:io stubs to ddc sdk, define dart.library.html (Closed)
Patch Set: Regen sum Created 4 years 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
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:collection' show HashSet, Queue; 5 import 'dart:collection' show HashSet, Queue;
6 import 'dart:convert' show BASE64, JSON, UTF8; 6 import 'dart:convert' show BASE64, JSON, UTF8;
7 import 'dart:io' show File; 7 import 'dart:io' show File;
8 import 'package:analyzer/dart/element/element.dart' show LibraryElement; 8 import 'package:analyzer/dart/element/element.dart' show LibraryElement;
9 import 'package:analyzer/analyzer.dart' 9 import 'package:analyzer/analyzer.dart'
10 show AnalysisError, CompilationUnit, ErrorSeverity; 10 show AnalysisError, CompilationUnit, ErrorSeverity;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 resourceProvider: resourceProvider); 90 resourceProvider: resourceProvider);
91 91
92 var context = createAnalysisContext(); 92 var context = createAnalysisContext();
93 context.sourceFactory = srcFactory; 93 context.sourceFactory = srcFactory;
94 context.typeProvider = sdkResolver.dartSdk.context.typeProvider; 94 context.typeProvider = sdkResolver.dartSdk.context.typeProvider;
95 context.resultProvider = 95 context.resultProvider =
96 new InputPackagesResultProvider(context, summaryData); 96 new InputPackagesResultProvider(context, summaryData);
97 options.declaredVariables.forEach(context.declaredVariables.define); 97 options.declaredVariables.forEach(context.declaredVariables.define);
98 context.declaredVariables.define('dart.isVM', 'false'); 98 context.declaredVariables.define('dart.isVM', 'false');
99 99
100 // TODO(vsm): Should this be hardcoded?
Brian Wilkerson 2016/12/14 20:28:41 If you mean "hardcoded here" then I'd say this is
101 context.declaredVariables.define('dart.library.html', 'true');
102 context.declaredVariables.define('dart.library.io', 'false');
103
100 return new ModuleCompiler.withContext(context, summaryData); 104 return new ModuleCompiler.withContext(context, summaryData);
101 } 105 }
102 106
103 bool _isFatalError(AnalysisError e, CompilerOptions options) { 107 bool _isFatalError(AnalysisError e, CompilerOptions options) {
104 if (errorSeverity(context, e) != ErrorSeverity.ERROR) return false; 108 if (errorSeverity(context, e) != ErrorSeverity.ERROR) return false;
105 109
106 // These errors are not fatal in the REPL compile mode as we 110 // These errors are not fatal in the REPL compile mode as we
107 // allow access to private members across library boundaries 111 // allow access to private members across library boundaries
108 // and those accesses will show up as undefined members unless 112 // and those accesses will show up as undefined members unless
109 // additional analyzer changes are made to support them. 113 // additional analyzer changes are made to support them.
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 // Fall back to a relative path. 558 // Fall back to a relative path.
555 return path.toUri(path.relative(path.fromUri(uri), from: dir)).toString(); 559 return path.toUri(path.relative(path.fromUri(uri), from: dir)).toString();
556 } 560 }
557 561
558 for (int i = 0; i < list.length; i++) { 562 for (int i = 0; i < list.length; i++) {
559 list[i] = transformUri(list[i]); 563 list[i] = transformUri(list[i]);
560 } 564 }
561 map['file'] = transformUri(map['file']); 565 map['file'] = transformUri(map['file']);
562 return map; 566 return map;
563 } 567 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698