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

Unified Diff: sdk/lib/_internal/compiler/js_lib/native_helper.dart

Issue 957973006: dart2js: don't emit unneeded native info. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
Index: sdk/lib/_internal/compiler/js_lib/native_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/native_helper.dart b/sdk/lib/_internal/compiler/js_lib/native_helper.dart
index bec5bbae9b95df632c4e2979cfb295b7c18b199c..0f02d3c59c1ca6b9c52936e2100043975a38a9dd 100644
--- a/sdk/lib/_internal/compiler/js_lib/native_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/native_helper.dart
@@ -130,6 +130,7 @@ var interceptorsForUncacheableTags;
lookupInterceptor(String tag) {
+ if (JS('bool', '!#', interceptorsByTag)) return JS('', 'null');
floitsch 2015/02/26 18:12:12 I'm not sure I like this. If there are native clas
floitsch 2015/02/26 18:12:12 I don't understand the `return JS('', 'null')` par
zarah 2015/02/27 09:03:48 As mentioned in my previous comment, I just think
return propertyGet(interceptorsByTag, tag);
}
@@ -302,6 +303,7 @@ void initNativeDispatchContinue() {
// tags `TAG`, if `window.TAG` is a (constructor) function, set the dispatch
// property if the function's prototype to a dispatch record.
var map = interceptorsByTag;
+ if (JS('bool', '!map')) return;
floitsch 2015/02/26 18:12:12 ditto. also won't work in minified mode.
zarah 2015/02/27 09:03:48 Acknowledged.
var tags = JS('JSMutableArray', 'Object.getOwnPropertyNames(#)', map);
if (JS('bool', 'typeof window != "undefined"')) {

Powered by Google App Engine
This is Rietveld 408576698