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

Side by Side Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 2862433002: Fix for issue 28196 - constant interceptors for mixin applications (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 | tests/html/custom/mirrors_2_test.dart » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 js_backend.namer; 5 library js_backend.namer;
6 6
7 import 'dart:collection' show HashMap; 7 import 'dart:collection' show HashMap;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName; 9 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName;
10 10
(...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 if (name == null) { 1885 if (name == null) {
1886 // e.g. DartType 'dynamic' has no element. 1886 // e.g. DartType 'dynamic' has no element.
1887 name = rtiEncoder.getTypeRepresentationForTypeConstant(type); 1887 name = rtiEncoder.getTypeRepresentationForTypeConstant(type);
1888 } 1888 }
1889 addIdentifier(name); 1889 addIdentifier(name);
1890 add(getHashTag(constant, 3)); 1890 add(getHashTag(constant, 3));
1891 } 1891 }
1892 1892
1893 @override 1893 @override
1894 void visitInterceptor(InterceptorConstantValue constant, [_]) { 1894 void visitInterceptor(InterceptorConstantValue constant, [_]) {
1895 addRoot(constant.cls.name); 1895 // The class name for mixin applications contain '+' signs (issue 28196).
1896 addRoot(constant.cls.name.replaceAll('+', '_'));
1896 add('methods'); 1897 add('methods');
1897 } 1898 }
1898 1899
1899 @override 1900 @override
1900 void visitSynthetic(SyntheticConstantValue constant, [_]) { 1901 void visitSynthetic(SyntheticConstantValue constant, [_]) {
1901 switch (constant.valueKind) { 1902 switch (constant.valueKind) {
1902 case SyntheticConstantKind.DUMMY_INTERCEPTOR: 1903 case SyntheticConstantKind.DUMMY_INTERCEPTOR:
1903 add('dummy_receiver'); 1904 add('dummy_receiver');
1904 break; 1905 break;
1905 case SyntheticConstantKind.TYPEVARIABLE_REFERENCE: 1906 case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 void addSuggestion(String original, String suggestion) { 2184 void addSuggestion(String original, String suggestion) {
2184 assert(!_suggestedNames.containsKey(original)); 2185 assert(!_suggestedNames.containsKey(original));
2185 _suggestedNames[original] = suggestion; 2186 _suggestedNames[original] = suggestion;
2186 } 2187 }
2187 2188
2188 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); 2189 bool hasSuggestion(String original) => _suggestedNames.containsKey(original);
2189 bool isSuggestion(String candidate) { 2190 bool isSuggestion(String candidate) {
2190 return _suggestedNames.containsValue(candidate); 2191 return _suggestedNames.containsValue(candidate);
2191 } 2192 }
2192 } 2193 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/custom/mirrors_2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698