1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-03 18:44:12 +01:00

Don't use the word eval for fear that it may break "use strict" mode later.

This commit is contained in:
Kris Maglione
2010-09-17 06:15:13 -04:00
parent b8331a1b55
commit 47083c5b66
6 changed files with 42 additions and 62 deletions

View File

@@ -296,6 +296,8 @@ const CompletionContext = Class("CompletionContext", {
for (let i in Iterator(this.keys)) {
let [k, v] = i;
if (typeof v == "string" && /^[.[]/.test(v))
// This is only allowed to be a simple accessor, and shouldn't
// reference any variables. Don't bother with eval context.
v = Function("i", "return i" + v);
if (typeof v == "function")
res.__defineGetter__(k, function () Class.replaceProperty(this, k, v(this.item)));