From 662fb5d7a5207027b710c7a53927841e04bdcd18 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 7 Oct 2008 02:13:45 +0000 Subject: [PATCH] Skip inaccessable elements in javascript completion --- content/completion.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/content/completion.js b/content/completion.js index 1752fc50..402b082f 100644 --- a/content/completion.js +++ b/content/completion.js @@ -318,16 +318,21 @@ liberator.Completion = function () //{{{ { if (typeof obj == "string") obj = window.eval("with (liberator) {" + obj + "}"); + if (typeof obj != "object") + continue; for (let k in obj) { - let v, type = "inaccessable" + let v, type; try { v = obj[k]; type = typeof v; } - catch(e) {} + catch(e) + { + continue; + } if (["string", "number", "boolean", "function"].indexOf(type) > -1) type += ": " + String(v).replace("\n", "\\n", "g");