1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

JSSpecCompiler: Restrict usage of NodeSubtreePointer

This class stores a non-owning raw pointer to a member of `Node`, so
extra care is needed to ensure that referenced `Node`s will be alive
by the time `NodeSubtreePointer` is used. Since we only need to use this
class while traversing AST in `RecursiveASTVisitor`, access to class
methods can be restricted using `Badge<RecursiveASTVisitor>`.
This commit is contained in:
Dan Klishch 2023-09-02 14:33:35 -04:00 committed by Andrew Kaster
parent f789d26e37
commit 1c4cd34320
3 changed files with 8 additions and 4 deletions

View file

@ -37,6 +37,9 @@ class Variable;
class FunctionPointer;
using FunctionPointerRef = NonnullRefPtr<FunctionPointer>;
// Compiler/GenericASTPass.h
class RecursiveASTVisitor;
// Parser/SpecParser.h
class AlgorithmStep;
class AlgorithmStepList;