mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibJS: Add Cell::interpreter() convenience helper
This allows you to go from any Cell* to the Interpreter.
This commit is contained in:
parent
fbefb19e10
commit
9b4358e150
Notes:
sideshowbarker
2024-07-19 08:17:53 +09:00
Author: https://github.com/awesomekling
Commit: 9b4358e150
3 changed files with 9 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <AK/LogStream.h>
|
||||
#include <LibJS/Cell.h>
|
||||
#include <LibJS/Heap.h>
|
||||
#include <LibJS/HeapBlock.h>
|
||||
#include <LibJS/Object.h>
|
||||
#include <LibJS/PrimitiveString.h>
|
||||
|
@ -44,6 +45,11 @@ Heap& Cell::heap()
|
|||
return HeapBlock::from_cell(this)->heap();
|
||||
}
|
||||
|
||||
Interpreter& Cell::interpreter()
|
||||
{
|
||||
return heap().interpreter();
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, const Cell* cell)
|
||||
{
|
||||
if (!cell)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue