| 119 | } |
| 120 | |
| 121 | Value CommandsTable::CustomVariablesAccessor(const Value& row) |
| 122 | { |
| 123 | Command::Ptr command = static_cast<Command::Ptr>(row); |
| 124 | |
| 125 | if (!command) |
| 126 | return Empty; |
| 127 | |
| 128 | Dictionary::Ptr vars = command->GetVars(); |
| 129 | |
| 130 | ArrayData result; |
| 131 | |
| 132 | if (vars) { |
| 133 | ObjectLock xlock(vars); |
| 134 | for (const auto& kv : vars) { |
| 135 | result.push_back(new Array({ |
| 136 | kv.first, |
| 137 | kv.second |
| 138 | })); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | return new Array(std::move(result)); |
| 143 | } |