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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/js_names.dart

Issue 11590018: Avoid known native field names when minifying method names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
Index: sdk/lib/_internal/compiler/implementation/ssa/js_names.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/js_names.dart b/sdk/lib/_internal/compiler/implementation/ssa/js_names.dart
index 4a4ae60ffd7d59bfacf76af3c0cf975bc0cdf943..0e88e10436ef05da17882abc06dadf24e306a76b 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/js_names.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/js_names.dart
@@ -155,7 +155,9 @@ class JsNames {
static const reservedPropertySymbols =
const <String>["__PROTO__", "prototype", "constructor"];
+
ahe 2012/12/17 16:23:25 Remove extra line.
static Set<String> _reserved;
+ static Set<String> _reservedNativeProperties;
static Set<String> get reserved {
if (_reserved == null) {
@@ -167,6 +169,16 @@ class JsNames {
return _reserved;
}
+ static Set<String> get reservedNativeProperties {
+ // TODO(sra): We need a complete list from the DOM.
ahe 2012/12/17 16:23:25 Add two spaces of indentation.
+ if (_reservedNativeProperties == null) {
+ const names = const <String>["x", "y", "z"];
ngeoffray 2012/12/18 12:34:03 What are those names in the DOM? Is this CL fixing
+ _reservedNativeProperties = new Set<String>();
ngeoffray 2012/12/18 12:34:03 You can use new Set<String>.from(names).
+ _reservedNativeProperties.addAll(names);
+ }
+ return _reservedNativeProperties;
+ }
+
// TODO(ngeoffray): only the namer should call this method.
// Eventually move it there.
/*

Powered by Google App Engine
This is Rietveld 408576698