From 7c8c9b94bc5b24a587da8f2c4bac17117fe07490 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Tue, 17 Mar 2015 14:31:22 +0200 Subject: tools/props.html: use try/catch in a few more places --- tools/props.html | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tools/props.html') diff --git a/tools/props.html b/tools/props.html index 23d1f7da..ff09a8da 100644 --- a/tools/props.html +++ b/tools/props.html @@ -7,7 +7,9 @@ function addObject(obj) { if (obj == null) return; - Object.getOwnPropertyNames(obj).forEach(add); + try { + Object.getOwnPropertyNames(obj).forEach(add); + } catch(ex) {} if (obj.prototype) { Object.getOwnPropertyNames(obj.prototype).forEach(add); } @@ -26,13 +28,15 @@ addObject(window[thing]); }); - addObject(new Event("click")); - addObject(new Event("contextmenu")); - addObject(new Event("mouseup")); - addObject(new Event("mousedown")); - addObject(new Event("keydown")); - addObject(new Event("keypress")); - addObject(new Event("keyup")); + try { + addObject(new Event("click")); + addObject(new Event("contextmenu")); + addObject(new Event("mouseup")); + addObject(new Event("mousedown")); + addObject(new Event("keydown")); + addObject(new Event("keypress")); + addObject(new Event("keyup")); + } catch(ex) {} var ta = document.createElement("textarea"); ta.style.width = "100%"; -- cgit v1.2.3