1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-05 01:55:46 +01:00

Work around more Tracemonkey brokenness.

This commit is contained in:
Kris Maglione
2010-11-05 15:03:50 -04:00
parent 97589ce40b
commit 22610a10a9
3 changed files with 17 additions and 10 deletions

View File

@@ -476,13 +476,14 @@ const Events = Module("events", {
if (/^key/.test(event.type)) {
let charCode = event.type == "keyup" ? 0 : event.charCode; // Why? --Kris
if (charCode == 0) {
if (event.keyCode in this._code_key)
if (event.keyCode in this._code_key) {
key = this._code_key[event.keyCode];
if (event.shiftKey && (key.length > 1 || event.ctrlKey || event.altKey || event.metaKey) || event.dactylShift)
modifier += "S-";
if (!modifier && /^[a-z0-9]$/i.test(key))
return key;
if (event.shiftKey && (key.length > 1 || event.ctrlKey || event.altKey || event.metaKey) || event.dactylShift)
modifier += "S-";
if (!modifier && /^[a-z0-9]$/i.test(key))
return key;
}
}
// [Ctrl-Bug] special handling of mysterious <C-[>, <C-\\>, <C-]>, <C-^>, <C-_> bugs (OS/X)
// (i.e., cntrl codes 27--31)

View File

@@ -35,8 +35,6 @@ const JavaScript = Module("javascript", {
},
iter: function iter(obj, toplevel) {
"use strict";
if (obj == null)
return;
@@ -60,6 +58,8 @@ const JavaScript = Module("javascript", {
// Things we can dereference
if (!obj || ["object", "string", "function"].indexOf(typeof obj) === -1)
return [];
if (isinstance(obj, ["Sandbox"]) && !toplevel) // Temporary hack.
return [];
if (jsmodules.isPrototypeOf(obj) && !toplevel)
return [];
@@ -79,8 +79,14 @@ const JavaScript = Module("javascript", {
return cache[key];
context[JavaScript.EVAL_TMP] = tmp;
context[JavaScript.EVAL_EXPORT] = function export(obj) cache[key] = obj;
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) {
this.context.message = "Error: " + e;
@@ -585,6 +591,7 @@ const JavaScript = Module("javascript", {
}
}, {
EVAL_TMP: "__dactyl_eval_tmp",
EVAL_EXPORT: "__dactyl_eval_export",
/**
* A map of argument completion functions for named methods. The

View File

@@ -217,8 +217,7 @@ function debuggerProperties(obj) {
* @returns {Generator}
*/
function prototype(obj)
// Temporary hack:
typeof obj === "xml" || obj.__proto__ !== obj.__proto__ ? null :
/* Temporary hack: */ typeof obj === "xml" || obj.__proto__ !== obj.__proto__ ? null :
obj.__proto__ || Object.getPrototypeOf(obj) ||
XPCNativeWrapper.unwrap(obj).__proto__ ||
Object.getPrototypeOf(XPCNativeWrapper.unwrap(obj));