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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 235573006: Validate native tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | sdk/lib/_internal/compiler/implementation/native_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
index ad0e1ff37565b51b04264b0174d0bdae59aaa1d8..6866b254348c46b31d8d3432935bfee756289371 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
@@ -74,25 +74,6 @@ class NativeEmitter {
return backend.namer.isolateAccess(element);
}
- // The tags string contains comma-separated 'words' which are either dispatch
- // tags (having JavaScript identifier syntax) and directives that begin with
- // `!`.
- List<String> nativeTagsOfClassRaw(ClassElement cls) {
- String quotedName = cls.nativeTagInfo;
- return quotedName.substring(1, quotedName.length - 1).split(',');
- }
-
- List<String> nativeTagsOfClass(ClassElement cls) {
- return nativeTagsOfClassRaw(cls).where((s) => !s.startsWith('!')).toList();
- }
-
- bool nativeHasTagsMarker(ClassElement cls, String marker) {
- return nativeTagsOfClassRaw(cls).contains(marker);
- }
-
- bool nativeForcedNonLeaf(ClassElement cls) =>
- nativeHasTagsMarker(cls, '!nonleaf');
-
/**
* Writes the class definitions for the interceptors to [mainBuffer].
* Writes code to associate dispatch tags with interceptors to [nativeBuffer].
@@ -185,7 +166,8 @@ class NativeEmitter {
} else if (extensionPoints.containsKey(classElement)) {
needed = true;
}
- if (classElement.isNative() && nativeForcedNonLeaf(classElement)) {
+ if (classElement.isNative() &&
+ native.nativeTagsForcedNonLeaf(classElement)) {
needed = true;
nonleafClasses.add(classElement);
}
@@ -206,7 +188,7 @@ class NativeEmitter {
for (ClassElement classElement in classes) {
if (!classElement.isNative()) continue;
- List<String> nativeTags = nativeTagsOfClass(classElement);
+ List<String> nativeTags = native.nativeTagsOfClass(classElement);
if (nonleafClasses.contains(classElement) ||
extensionPoints.containsKey(classElement)) {
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/native_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698