diff options
Diffstat (limited to 'public/vendor/codemirror/addon/hint')
-rw-r--r-- | public/vendor/codemirror/addon/hint/javascript-hint.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/public/vendor/codemirror/addon/hint/javascript-hint.js b/public/vendor/codemirror/addon/hint/javascript-hint.js index 7bcbf4a0..d7088c19 100644 --- a/public/vendor/codemirror/addon/hint/javascript-hint.js +++ b/public/vendor/codemirror/addon/hint/javascript-hint.js @@ -97,6 +97,15 @@ var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); + function forAllProps(obj, callback) { + if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) { + for (var name in obj) callback(name) + } else { + for (var o = obj; o; o = Object.getPrototypeOf(o)) + Object.getOwnPropertyNames(o).forEach(callback) + } + } + function getCompletions(token, context, keywords, options) { var found = [], start = token.string, global = options && options.globalScope || window; function maybeAdd(str) { @@ -106,7 +115,7 @@ if (typeof obj == "string") forEach(stringProps, maybeAdd); else if (obj instanceof Array) forEach(arrayProps, maybeAdd); else if (obj instanceof Function) forEach(funcProps, maybeAdd); - for (var name in obj) maybeAdd(name); + forAllProps(obj, maybeAdd) } if (context && context.length) { |