Skip to content

Instantly share code, notes, and snippets.

@caisui
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caisui/efddb6a16cb2ede5284e to your computer and use it in GitHub Desktop.
Save caisui/efddb6a16cb2ede5284e to your computer and use it in GitHub Desktop.
diff --git a/common/content/completion.js b/common/content/completion.js
index fbbfdef..8ab68e7 100644
--- a/common/content/completion.js
+++ b/common/content/completion.js
@@ -208,7 +208,13 @@ const CompletionContext = Class("CompletionContext", {
__proto__: item
}));
});
- return { start: minStart, items: util.Array.flatten(items), longestSubstring: this.longestAllSubstring
+ return { start: minStart, items: util.Array.flatten(items),
+ get longestSubstring() {
+ var value = self.longestAllSubstring;
+ Object.defineProperty(this, "longestSubstring", { value: value});
+ return value;
+ }
+ };
}
catch (e) {
liberator.echoerr(e);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment