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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/source/source_loader.dart
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 47a43b20de120c2f89392d5ff086435ef173d914..84106bf90d73914808926fe0836c653bbd131b6a 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -391,8 +391,11 @@ class SourceLoader<L> extends Loader<L> {
cls.charOffset,
"'${supertype.name}' is an enum and can't be extended or "
"implemented.");
- } else if (cls.library != coreLibrary &&
+ } else if (!cls.library.uri.isScheme('dart') &&
blackListedClasses.contains(supertype)) {
+ // TODO(sigmund): we may want to use a stricter check here. Today
+ // these classes are extended in dart:core (for VM) and
+ // 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
cls.addCompileTimeError(
cls.charOffset,
"'${supertype.name}' is restricted and can't be extended or "
« 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