mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
LibJS: Don't set a prototype property on async functions
This is now as defined in the spec. However since we execute async functions in bytecode by transforming it to a generator function it must have a prototype for the GeneratorObject. We check whether it is an async function and in that case use the hardcoded generator object prototype. This also ensures that user code cannot override this property thus preventing exposing internal implementation details.
This commit is contained in:
parent
de46a2cff1
commit
5d0f666f22
3 changed files with 13 additions and 2 deletions
|
@ -75,6 +75,8 @@ public:
|
|||
// Equivalent to absence of [[Construct]]
|
||||
virtual bool has_constructor() const override { return m_kind == FunctionKind::Regular && !m_is_arrow_function; }
|
||||
|
||||
FunctionKind kind() const { return m_kind; }
|
||||
|
||||
protected:
|
||||
virtual bool is_strict_mode() const final { return m_strict; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue