1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00
serenity/Userland/Libraries/LibJS
Luke Wilde 34f902fb52 LibJS: Add missing steps and spec comments to PerformEval
While adding spec comments to PerformEval, I noticed we were missing
multiple steps.

Namely, these were:
- Checking if the host will allow us to compile the string
  (allowing LibWeb to perform CSP for eval)
- The parser's initial state depending on the environment around us
  on direct eval:
   - Allowing new.target via eval in functions
   - Allowing super calls and super properties via eval in classes
   - Disallowing the use of the arguments object in class field
     initializers at eval's parse time
- Setting ScriptOrModule of eval's execution context

The spec allows us to apply the additional parsing steps in any order.
The method I have gone with is passing in a struct to the parser's
constructor, which overrides the parser's initial state to (dis)allow
the things stated above from the get-go.
2022-04-11 21:23:36 +01:00
..
Bytecode LibJS: Actually generate a lexical env for SwitchStatement in BC 2022-04-05 11:46:48 +02:00
Contrib/Test262 LibJS: Move DetachArrayBuffer implementation to the ArrayBuffer object 2022-04-08 11:15:16 +01:00
Heap LibJS: Make Handle<Value>::is_null() also consider the contained value 2022-04-05 11:46:48 +02:00
Runtime LibJS: Add missing steps and spec comments to PerformEval 2022-04-11 21:23:36 +01:00
Tests LibJS: Do not throw a TypeError when sorting a detached TypedArray 2022-04-08 11:15:16 +01:00
AST.cpp LibJS: Add missing steps and spec comments to PerformEval 2022-04-11 21:23:36 +01:00
AST.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CMakeLists.txt LibJS: Import C++ sources from libjs-test262 :^) 2022-03-29 21:01:08 +01:00
Console.cpp LibJS: Remove a bunch of gratuitous JS namespace qualifiers 2022-04-03 15:19:33 +01:00
Console.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CyclicModule.cpp LibJS: Use new NativeFunction::create() in most places 2022-02-20 23:21:40 +00:00
CyclicModule.h LibJS: Implement the import assertions proposal 2022-01-30 17:40:20 +00:00
Forward.h LibJS: Describe various kinds of "Duration Records" 2022-03-10 23:20:39 +01:00
Interpreter.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Interpreter.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Lexer.cpp LibJS: Always inline Lexer::current_code_point() 2022-02-13 14:44:36 +01:00
Lexer.h LibJS: Detect invalid unicode and stop lexing at that point 2021-12-29 16:57:23 +01:00
MarkupGenerator.cpp LibJS: Remove a bunch of gratuitous JS namespace qualifiers 2022-04-03 15:19:33 +01:00
MarkupGenerator.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Module.cpp Libraries: Use default constructors/destructors in LibJS 2022-03-16 16:19:40 +00:00
Module.h Libraries: Use default constructors/destructors in LibJS 2022-03-16 16:19:40 +00:00
Parser.cpp LibJS: Add missing steps and spec comments to PerformEval 2022-04-11 21:23:36 +01:00
Parser.h LibJS: Add missing steps and spec comments to PerformEval 2022-04-11 21:23:36 +01:00
Script.cpp Libraries: Use default constructors/destructors in LibJS 2022-03-16 16:19:40 +00:00
Script.h Libraries: Use default constructors/destructors in LibJS 2022-03-16 16:19:40 +00:00
SourceRange.h LibJS: Add missing headers 2021-10-06 23:52:40 +01:00
SourceTextModule.cpp LibJS: Use TRY(push_execution_context()) in places where we can recover 2022-03-18 01:12:12 +01:00
SourceTextModule.h LibJS: Implement the import assertions proposal 2022-01-30 17:40:20 +00:00
SyntaxHighlighter.cpp LibJS: Remove a bunch of gratuitous JS namespace qualifiers 2022-04-03 15:19:33 +01:00
SyntaxHighlighter.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
SyntheticModule.cpp LibJS: Fix two bogus spec links 2022-04-11 19:44:33 +01:00
SyntheticModule.h LibJS: Add support for JSON modules 2022-01-30 17:40:20 +00:00
Token.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Token.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00