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

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

Issue 938413002: Work around Safari for-in bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
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: dart/sdk/lib/_internal/compiler/js_lib/js_names.dart
diff --git a/dart/sdk/lib/_internal/compiler/js_lib/js_names.dart b/dart/sdk/lib/_internal/compiler/js_lib/js_names.dart
index 95f7e4902e5acf094b9a1902d3c7ce0f25d03d68..73272690e1f630b1ba65aa8b0bb360e79027e593 100644
--- a/dart/sdk/lib/_internal/compiler/js_lib/js_names.dart
+++ b/dart/sdk/lib/_internal/compiler/js_lib/js_names.dart
@@ -80,14 +80,7 @@ Map<String, String> computeReflectiveNames(Map<String, String> map) {
@NoInline()
List extractKeys(victim) {
- var result = JS('', '''
-(function(victim, hasOwnProperty) {
- var result = [];
- for (var key in victim) {
- if (hasOwnProperty.call(victim, key)) result.push(key);
- }
- return result;
-})(#, Object.prototype.hasOwnProperty)''', victim);
+ var result = JS('', 'Object.keys(#)', victim);
return new JSArray.markFixed(result);
}

Powered by Google App Engine
This is Rietveld 408576698