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:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user