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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/source_loader.dart

Issue 2869393003: Allow overriding core types in dart:_interceptors. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | 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) 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 library fasta.source_loader; 5 library fasta.source_loader;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:typed_data' show Uint8List; 9 import 'dart:typed_data' show Uint8List;
10 10
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 for (ClassBuilder cls in allClasses) { 384 for (ClassBuilder cls in allClasses) {
385 if (cls.library.loader != this) continue; 385 if (cls.library.loader != this) continue;
386 Set<ClassBuilder> directSupertypes = new Set<ClassBuilder>(); 386 Set<ClassBuilder> directSupertypes = new Set<ClassBuilder>();
387 target.addDirectSupertype(cls, directSupertypes); 387 target.addDirectSupertype(cls, directSupertypes);
388 for (ClassBuilder supertype in directSupertypes) { 388 for (ClassBuilder supertype in directSupertypes) {
389 if (supertype is EnumBuilder) { 389 if (supertype is EnumBuilder) {
390 cls.addCompileTimeError( 390 cls.addCompileTimeError(
391 cls.charOffset, 391 cls.charOffset,
392 "'${supertype.name}' is an enum and can't be extended or " 392 "'${supertype.name}' is an enum and can't be extended or "
393 "implemented."); 393 "implemented.");
394 } else if (cls.library != coreLibrary && 394 } else if (!cls.library.uri.isScheme('dart') &&
395 blackListedClasses.contains(supertype)) { 395 blackListedClasses.contains(supertype)) {
396 // TODO(sigmund): we may want to use a stricter check here. Today
397 // these classes are extended in dart:core (for VM) and
398 // dart:_interceptors (for dart2js).
Siggi Cherem (dart-lang) 2017/05/10 18:14:22 not sure that it is worth saying in the TODO: I do
scheglov 2017/05/10 18:27:47 FWIW, in analyzer we use similar check - we allow
396 cls.addCompileTimeError( 399 cls.addCompileTimeError(
397 cls.charOffset, 400 cls.charOffset,
398 "'${supertype.name}' is restricted and can't be extended or " 401 "'${supertype.name}' is restricted and can't be extended or "
399 "implemented."); 402 "implemented.");
400 } 403 }
401 } 404 }
402 TypeBuilder mixedInType = cls.mixedInType; 405 TypeBuilder mixedInType = cls.mixedInType;
403 if (mixedInType != null) { 406 if (mixedInType != null) {
404 bool isClassBuilder = false; 407 bool isClassBuilder = false;
405 if (mixedInType is NamedTypeBuilder) { 408 if (mixedInType is NamedTypeBuilder) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 /// Performs the second phase of top level initializer inference, which is to 478 /// Performs the second phase of top level initializer inference, which is to
476 /// visit fields and top level variables in topologically-sorted order and 479 /// visit fields and top level variables in topologically-sorted order and
477 /// assign their types. 480 /// assign their types.
478 void performInitializerInference() { 481 void performInitializerInference() {
479 typeInferenceEngine.finishTopLevel(); 482 typeInferenceEngine.finishTopLevel();
480 ticker.logMs("Performed initializer inference"); 483 ticker.logMs("Performed initializer inference");
481 } 484 }
482 485
483 List<Uri> getDependencies() => sourceBytes.keys.toList(); 486 List<Uri> getDependencies() => sourceBytes.keys.toList();
484 } 487 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698