summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Symbol.cpp
blob: c1f56036bc68ef43c4ea13562539a51cc3ee6b18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <LibJS/Heap/Heap.h>
#include <LibJS/Runtime/Symbol.h>
#include <LibJS/Runtime/VM.h>

namespace JS {

Symbol::Symbol(Optional<String> description, bool is_global)
    : m_description(move(description))
    , m_is_global(is_global)
{
}

Symbol::~Symbol()
{
}

Symbol* js_symbol(Heap& heap, Optional<String> description, bool is_global)
{
    return heap.allocate_without_global_object<Symbol>(move(description), is_global);
}

Symbol* js_symbol(VM& vm, Optional<String> description, bool is_global)
{
    return js_symbol(vm.heap(), move(description), is_global);
}

}