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

Unified Diff: tool/input_sdk/private/ddc_runtime/classes.dart

Issue 1944293003: Fix accessing private members on extension classes. (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 | « test/codegen/lib/html/private_extension_member_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/tool/input_sdk/private/ddc_runtime/classes.dart b/tool/input_sdk/private/ddc_runtime/classes.dart
index 56920e109f8d93a0dc9f23f5df363ff23d63c392..86923f83c33d6384d3c5f6a74cab5ebf5588b12b 100644
--- a/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -343,6 +343,9 @@ defineExtensionMembers(type, methodNames) => JS('', '''(() => {
})()''');
canonicalMember(obj, name) => JS('', '''(() => {
+ // Private names are symbols and are already canonical.
+ if (typeof name === 'symbol') return name;
+
if ($obj != null && $obj[$_extensionType]) return $dartx[$name];
// Check for certain names that we can't use in JS
if ($name == 'constructor' || $name == 'prototype') {
« no previous file with comments | « test/codegen/lib/html/private_extension_member_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698