mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:57:44 +00:00
LibJS: Verify that objects are only initialized once
We already do this in a couple of other places, we wouldn't ever want to re-assign already initialized constructor and prototype objects.
This commit is contained in:
parent
63136615d2
commit
7762c1ac61
1 changed files with 2 additions and 0 deletions
|
@ -267,6 +267,8 @@ JS_ENUMERATE_TYPED_ARRAYS
|
|||
{ \
|
||||
auto& vm = this->vm(); \
|
||||
\
|
||||
VERIFY(!m_##snake_namespace##snake_name##_prototype); \
|
||||
VERIFY(!m_##snake_namespace##snake_name##_constructor); \
|
||||
if constexpr (IsTypedArrayConstructor<Namespace::ConstructorName>) { \
|
||||
m_##snake_namespace##snake_name##_prototype = heap().allocate<Namespace::PrototypeName>(m_realm, *typed_array_prototype()); \
|
||||
m_##snake_namespace##snake_name##_constructor = heap().allocate<Namespace::ConstructorName>(m_realm, m_realm, *typed_array_constructor()); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue