• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ArkScript-lang / Ark / 13900111474

17 Mar 2025 01:01PM UTC coverage: 78.852%. First build
13900111474

Pull #518

github

web-flow
Merge ff1228e53 into d1be6b9f4
Pull Request #518: Feat/better scopes

84 of 121 new or added lines in 9 files covered. (69.42%)

5865 of 7438 relevant lines covered (78.85%)

81043.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.48
/src/arkreactor/VM/Value/ClosureScope.cpp
1
#include <Ark/VM/Value/ClosureScope.hpp>
2

3
#include <Ark/VM/ScopeView.hpp>
4

5
namespace Ark::internal
6
{
NEW
7
    void ClosureScope::push_back(const uint16_t id, Value&& val)
×
NEW
8
    {
×
NEW
9
        m_data.emplace_back(id, std::move(val));
×
NEW
10
    }
×
11

12
    void ClosureScope::push_back(const uint16_t id, const Value& val)
457✔
13
    {
457✔
14
        m_data.emplace_back(id, val);
457✔
15
    }
457✔
16

17
    Value* ClosureScope::operator[](const uint16_t id_to_look_for)
1,546✔
18
    {
1,546✔
19
        for (auto& [id, value] : m_data)
13,875✔
20
        {
21
            if (id == id_to_look_for)
12,329✔
22
                return &value;
1,544✔
23
        }
12,329✔
24
        return nullptr;
2✔
25
    }
1,546✔
26

27
    void ClosureScope::mergeRefInto(ScopeView& other)
1,978✔
28
    {
1,978✔
29
        for (auto& [id, value] : m_data)
36,186✔
30
        {
31
            if (value.valueType() == ValueType::Reference)
17,104✔
NEW
32
                other.push_back(id, value);
×
33
            else
34
                other.push_back(id, Value(&value));
17,104✔
35
        }
17,104✔
36
    }
1,978✔
37

38
    bool operator==(const ClosureScope& A, const ClosureScope& B) noexcept
9✔
39
    {
9✔
40
        return A.m_data == B.m_data;
9✔
41
    }
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc