mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 18:55:07 +00:00

This patch adds a special EnvironmentCoordinate::global_marker value that signifies that a binding lookup ended up searching the global environment. It doesn't matter if we find it there or not, the global marker is always returned. This allows us to bypass other environments on subsequent access, going directly to the global environment.
21 lines
333 B
C++
21 lines
333 B
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <LibJS/Forward.h>
|
|
|
|
namespace JS {
|
|
|
|
struct EnvironmentCoordinate {
|
|
size_t hops { 0 };
|
|
size_t index { 0 };
|
|
|
|
static constexpr size_t global_marker = 0xffffffff;
|
|
};
|
|
|
|
}
|