diff --git a/src/Frame.cc b/src/Frame.cc index 44fb4697f7..87ba277427 100644 --- a/src/Frame.cc +++ b/src/Frame.cc @@ -120,6 +120,17 @@ Frame* Frame::Clone() const return other; } +Frame* Frame::LightClone() const + { + Frame* other = new Frame(0, function, func_args); + + other->call = call; + other->assoc = assoc; + other->trigger = trigger; + + return other; + } + static bool val_is_func(const ValPtr& v, ScriptFunc* func) { if ( v->GetType()->Tag() != TYPE_FUNC ) diff --git a/src/Frame.h b/src/Frame.h index d403b2ddad..77a5e89a30 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -157,6 +157,14 @@ public: */ Frame* Clone() const; + /** + * Creates a copy of the frame that doesn't include its values, + * just its trigger context. + * + * @return a partial copy of this frame. + */ + Frame* LightClone() const; + /** * Serializes the frame in support of copy semantics for lambdas: *