From 7a033af705c7370dfac0f7a67b773daad0dc8bb3 Mon Sep 17 00:00:00 2001 From: Cotton Hou Date: Mon, 12 Dec 2011 15:57:50 +0800 Subject: [PATCH] Use if rather than try --- lib/less/browser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/less/browser.js b/lib/less/browser.js index b38a3d59..9e4afb7f 100644 --- a/lib/less/browser.js +++ b/lib/less/browser.js @@ -104,10 +104,10 @@ function loadStyles() { var css = tree.toCSS(); var style = styles[i]; style.type = 'text/css'; - try { - style.innerHTML = css; - } catch (_) { + if (style.styleSheet) { style.styleSheet.cssText = css; + } else { + style.innerHTML = css; } }); }