From 4e5ccffbb4d82d09ff9038ff35f3426859e1a644 Mon Sep 17 00:00:00 2001 From: "ricow@google.com" Date: Fri, 5 Oct 2012 06:47:12 +0000 Subject: [PATCH] Fix opening of print dialog on IE when testing dart2js Review URL: https://codereview.chromium.org//11033044 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13273 260f80e4-7a28-3924-810f-c04153c831b5 --- lib/compiler/implementation/lib/js_helper.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart index bec987b3625..b018e2e803d 100644 --- a/lib/compiler/implementation/lib/js_helper.dart +++ b/lib/compiler/implementation/lib/js_helper.dart @@ -378,8 +378,11 @@ class Primitives { } // Inside browser. - if (JS('bool', r'typeof console == "object"')) { - JS('void', r'console.log(#)', string); + if (JS('bool', r'typeof window == "object"')) { + // On IE, the console is only defined if dev tools is open. + if (JS('bool', r'typeof console == "object"')) { + JS('void', r'console.log(#)', string); + } return; }