-// Copyright (c) 2008-2013 Kris Maglione <maglione.k at Gmail>
+// Copyright (c) 2008-2014 Kris Maglione <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
lazyInit: true,
- newContext: function () this.modules.newContext(this.modules.userContext, true, "Dactyl JS Temp Context"),
+ newContext: function () this.modules.newContext(this.modules.userContext, false,
+ "Dactyl JS Temp Context"),
completers: Class.Memoize(() => Object.create(JavaScript.completers)),
if (obj == null)
return;
- let seen = isinstance(obj, ["Sandbox"]) ? Set(JavaScript.magicalNames) : {};
+ let seen = RealSet(isinstance(obj, ["Sandbox"]) ? JavaScript.magicalNames : []);
let globals = values(toplevel && this.window === obj ? this.globalNames : []);
if (toplevel && isObject(obj) && "wrappedJSObject" in obj)
- if (!Set.add(seen, "wrappedJSObject"))
+ if (!seen.add("wrappedJSObject"))
yield "wrappedJSObject";
- for (let key in iter(globals, properties(obj, !toplevel, true)))
- if (!Set.add(seen, key))
+ for (let key in iter(globals, properties(obj, !toplevel)))
+ if (!seen.add(key))
yield key;
// Properties aren't visible in an XPCNativeWrapper until
// they're accessed.
- for (let key in properties(this.getKey(obj, "wrappedJSObject"), !toplevel, true))
+ for (let key in properties(this.getKey(obj, "wrappedJSObject"),
+ !toplevel))
try {
- if (key in obj && !Set.has(seen, key))
+ if (key in obj && !seen.has(key))
yield key;
}
catch (e) {}
_complete: function (objects, key, compl, string, last) {
const self = this;
- if (!getOwnPropertyNames && !services.debugger.isOn && !this.context.message)
- this.context.message = /*L*/"For better completion data, please enable the JavaScript debugger (:set jsdebugger)";
-
let base = this.context.fork("js", this._top.offset);
base.forceAnchored = true;
base.filter = last == null ? key : string;
else {
base.quote = [last, text => util.escapeString(text, ""), last];
if (prefix)
- base.filters.push(item => item.item.indexOf(prefix) === 0);
+ base.filters.push(item => item.item.startsWith(prefix));
}
if (!compl) {
}
this.context.getCache("evalled", Object);
- this.context.getCache("evalContext", this.closure.newContext);
+ this.context.getCache("evalContext", this.bound.newContext);
// Okay, have parse stack. Figure out what we're completing.
"ROCSSPrimitiveValue", "RangeError", "ReferenceError", "RegExp",
"StopIteration", "String", "SyntaxError", "TypeError", "URIError",
"Uint16Array", "Uint32Array", "Uint8Array", "XML", "XMLHttpProgressEvent",
- "XMLList", "XMLSerializer", "XPCNativeWrapper", "XPCSafeJSWrapper",
+ "XMLList", "XMLSerializer", "XPCNativeWrapper",
"XULControllers", "constructor", "decodeURI", "decodeURIComponent",
"encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN",
"isXMLName", "parseFloat", "parseInt", "undefined", "unescape", "uneval"
completion: function (dactyl, modules, window) {
const { completion } = modules;
update(modules.completion, {
- get javascript() modules.javascript.closure.complete,
+ get javascript() modules.javascript.bound.complete,
javascriptCompleter: JavaScript // Backwards compatibility
});
},
leave: function leave(params) {
leave.superapply(this, arguments);
- if (!params.push)
+ if (!params.push) {
modes.delay(function () { modes.pop(); });
+ Cu.nukeSandbox(this.context);
+ }
},
updatePrompt: function updatePrompt() {