summaryrefslogtreecommitdiffstats
path: root/WebContent/VAADIN/vaadinBootstrap.js
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-11-29 12:40:14 +0200
committerLeif Åstrand <leif@vaadin.com>2011-11-29 12:40:14 +0200
commit1184bbd59c0e87e8788aed4bc198eb9b7f9468ef (patch)
treedea6db9497b89b9bcc02cb2ce9414deb7a08530a /WebContent/VAADIN/vaadinBootstrap.js
parent6063d00f5ae6f0cb5c5eaf0c3ce2998c5aa88a2b (diff)
downloadvaadin-framework-1184bbd59c0e87e8788aed4bc198eb9b7f9468ef.tar.gz
vaadin-framework-1184bbd59c0e87e8788aed4bc198eb9b7f9468ef.zip
Improved bootstrap logging
Diffstat (limited to 'WebContent/VAADIN/vaadinBootstrap.js')
-rw-r--r--WebContent/VAADIN/vaadinBootstrap.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js
index 61783c448e..b61c10dcf7 100644
--- a/WebContent/VAADIN/vaadinBootstrap.js
+++ b/WebContent/VAADIN/vaadinBootstrap.js
@@ -5,11 +5,19 @@
var widgetsets = {};
- var log = function() {
- if (console && console.log) {
- console.log(arguments);
- }
- }
+ var log;
+ if (typeof console === "undefined") {
+ //If no console.log present, just use a no-op
+ log = function() {};
+ } else if (typeof console.log === "function") {
+ //If it's a function, use it with apply
+ log = function() {
+ console.log.apply(console, arguments);
+ };
+ } else {
+ //In IE, its a native function for which apply is not defined, but it works without a proper 'this' reference
+ log = console.log;
+ }
var loadTheme = function(url) {
if(!themesLoaded[url]) {