| 202 | } |
| 203 | |
| 204 | static bool ArrayAll(const Function::Ptr& function) |
| 205 | { |
| 206 | ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); |
| 207 | Array::Ptr self = static_cast<Array::Ptr>(vframe->Self); |
| 208 | REQUIRE_NOT_NULL(self); |
| 209 | REQUIRE_NOT_NULL(function); |
| 210 | |
| 211 | if (vframe->Sandboxed && !function->IsSideEffectFree()) |
| 212 | BOOST_THROW_EXCEPTION(ScriptError("Filter function must be side-effect free.")); |
| 213 | |
| 214 | ObjectLock olock(self); |
| 215 | for (const Value& item : self) { |
| 216 | if (!function->Invoke({ item })) |
| 217 | return false; |
| 218 | } |
| 219 | |
| 220 | return true; |
| 221 | } |
| 222 | static Array::Ptr ArrayUnique() |
| 223 | { |
| 224 | ScriptFrame *vframe = ScriptFrame::GetCurrentFrame(); |
nothing calls this directly
no test coverage detected