mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-17 07:13:33 +01:00
Work around more Tracemonkey brokenness.
This commit is contained in:
@@ -476,13 +476,14 @@ const Events = Module("events", {
|
|||||||
if (/^key/.test(event.type)) {
|
if (/^key/.test(event.type)) {
|
||||||
let charCode = event.type == "keyup" ? 0 : event.charCode; // Why? --Kris
|
let charCode = event.type == "keyup" ? 0 : event.charCode; // Why? --Kris
|
||||||
if (charCode == 0) {
|
if (charCode == 0) {
|
||||||
if (event.keyCode in this._code_key)
|
if (event.keyCode in this._code_key) {
|
||||||
key = this._code_key[event.keyCode];
|
key = this._code_key[event.keyCode];
|
||||||
|
|
||||||
if (event.shiftKey && (key.length > 1 || event.ctrlKey || event.altKey || event.metaKey) || event.dactylShift)
|
if (event.shiftKey && (key.length > 1 || event.ctrlKey || event.altKey || event.metaKey) || event.dactylShift)
|
||||||
modifier += "S-";
|
modifier += "S-";
|
||||||
if (!modifier && /^[a-z0-9]$/i.test(key))
|
if (!modifier && /^[a-z0-9]$/i.test(key))
|
||||||
return key;
|
return key;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// [Ctrl-Bug] special handling of mysterious <C-[>, <C-\\>, <C-]>, <C-^>, <C-_> bugs (OS/X)
|
// [Ctrl-Bug] special handling of mysterious <C-[>, <C-\\>, <C-]>, <C-^>, <C-_> bugs (OS/X)
|
||||||
// (i.e., cntrl codes 27--31)
|
// (i.e., cntrl codes 27--31)
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ const JavaScript = Module("javascript", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
iter: function iter(obj, toplevel) {
|
iter: function iter(obj, toplevel) {
|
||||||
"use strict";
|
|
||||||
|
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -60,6 +58,8 @@ const JavaScript = Module("javascript", {
|
|||||||
// Things we can dereference
|
// Things we can dereference
|
||||||
if (!obj || ["object", "string", "function"].indexOf(typeof obj) === -1)
|
if (!obj || ["object", "string", "function"].indexOf(typeof obj) === -1)
|
||||||
return [];
|
return [];
|
||||||
|
if (isinstance(obj, ["Sandbox"]) && !toplevel) // Temporary hack.
|
||||||
|
return [];
|
||||||
if (jsmodules.isPrototypeOf(obj) && !toplevel)
|
if (jsmodules.isPrototypeOf(obj) && !toplevel)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
@@ -79,8 +79,14 @@ const JavaScript = Module("javascript", {
|
|||||||
return cache[key];
|
return cache[key];
|
||||||
|
|
||||||
context[JavaScript.EVAL_TMP] = tmp;
|
context[JavaScript.EVAL_TMP] = tmp;
|
||||||
|
context[JavaScript.EVAL_EXPORT] = function export(obj) cache[key] = obj;
|
||||||
try {
|
try {
|
||||||
return cache[key] = dactyl.userEval(arg, context, "[Command Line Completion]", 1);
|
if (tmp != null) // Temporary hack until bug 609949 is fixed.
|
||||||
|
dactyl.userEval(JavaScript.EVAL_EXPORT + "(" + arg + ")", context, "[Command Line Completion]", 1);
|
||||||
|
else
|
||||||
|
cache[key] = dactyl.userEval(arg, context, "[Command Line Completion]", 1);
|
||||||
|
|
||||||
|
return cache[key];
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
this.context.message = "Error: " + e;
|
this.context.message = "Error: " + e;
|
||||||
@@ -585,6 +591,7 @@ const JavaScript = Module("javascript", {
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
EVAL_TMP: "__dactyl_eval_tmp",
|
EVAL_TMP: "__dactyl_eval_tmp",
|
||||||
|
EVAL_EXPORT: "__dactyl_eval_export",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of argument completion functions for named methods. The
|
* A map of argument completion functions for named methods. The
|
||||||
|
|||||||
@@ -217,8 +217,7 @@ function debuggerProperties(obj) {
|
|||||||
* @returns {Generator}
|
* @returns {Generator}
|
||||||
*/
|
*/
|
||||||
function prototype(obj)
|
function prototype(obj)
|
||||||
// Temporary hack:
|
/* Temporary hack: */ typeof obj === "xml" || obj.__proto__ !== obj.__proto__ ? null :
|
||||||
typeof obj === "xml" || obj.__proto__ !== obj.__proto__ ? null :
|
|
||||||
obj.__proto__ || Object.getPrototypeOf(obj) ||
|
obj.__proto__ || Object.getPrototypeOf(obj) ||
|
||||||
XPCNativeWrapper.unwrap(obj).__proto__ ||
|
XPCNativeWrapper.unwrap(obj).__proto__ ||
|
||||||
Object.getPrototypeOf(XPCNativeWrapper.unwrap(obj));
|
Object.getPrototypeOf(XPCNativeWrapper.unwrap(obj));
|
||||||
|
|||||||
Reference in New Issue
Block a user