| 149 | } |
| 150 | |
| 151 | function evaluateMember(node: jsep.MemberExpression, context: object) { |
| 152 | const object = evaluate(node.object, context); |
| 153 | let key: string; |
| 154 | if (node.computed) { |
| 155 | key = evaluate(node.property, context); |
| 156 | } else { |
| 157 | key = (node.property as jsep.Identifier).name; |
| 158 | } |
| 159 | if (/^__proto__|prototype|constructor$/.test(key)) { |
| 160 | throw Error(`Access to member "${key}" disallowed.`); |
| 161 | } |
| 162 | return [object, object[key]]; |
| 163 | } |
| 164 | |
| 165 | async function evaluateMemberAsync(node: jsep.MemberExpression, context: object) { |
| 166 | const object = await evalAsync(node.object, context); |