1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00
serenity/Userland/Libraries/LibJS
Shannon Booth 30ab198b40 LibJS: Create const variables in ForIn/OfBodyEvaluation in strict mode
Our implementation of environment.CreateImmutableBinding(name, true)
in this AO was not correctly initializing const variables in strict
mode. This would mean that constant declarations in for loop bodies
would not throw if they were modified.

To fix this, add a new parameter to CreateVariable to set strict mode.
Also remove the vm.is_strict mode check here, as it doesn't look like
anywhere in the spec will change strict mode depending on whether the
script itself is running in script mode or not.

This fixes two of our test-js tests, no change to test262.
2023-09-21 16:19:05 +02:00
..
Bytecode LibJS: Create const variables in ForIn/OfBodyEvaluation in strict mode 2023-09-21 16:19:05 +02:00
Contrib/Test262 LibJS: Make Heap::allocate<T>() infallible 2023-08-13 15:38:42 +02:00
Heap LibJS: Avoid pointless HashTable copying during GC mark phase 2023-09-15 12:12:54 +02:00
Runtime LibJS: Remove alreadyDeclared check in FunctionDeclarationInstantiation 2023-09-19 16:58:25 +02:00
Tests LibJS: Create const variables in ForIn/OfBodyEvaluation in strict mode 2023-09-21 16:19:05 +02:00
AST.cpp LibJS: Add spec comments to ScopeNode::block_declaration_instantiation 2023-09-21 16:19:05 +02:00
AST.h LibJS: Mark classes and virtual functions final where possible 2023-08-13 18:05:09 +02:00
CMakeLists.txt LibJS: Remove the now-unused ThrowableStringBuilder 2023-09-09 13:03:25 -04:00
Console.cpp LibJS+LibWeb+WebContent: Stop using ThrowableStringBuilder 2023-09-09 13:03:25 -04:00
Console.h LibJS: Begin implementing console.dir 2023-06-22 06:46:27 +02:00
CyclicModule.cpp LibJS+LibWeb: Add missing visit calls in visit_edges implementations 2023-04-30 06:04:33 +02:00
CyclicModule.h LibJS: Mark classes and virtual functions final where possible 2023-08-13 18:05:09 +02:00
Forward.h LibJS: Rip out the AST interpreter :^) 2023-08-08 13:07:13 +02:00
Lexer.cpp AK: Make "foo"_string infallible 2023-08-07 16:03:27 +02:00
Lexer.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
MarkupGenerator.cpp LibJS: Use OrderedHashMap for the Shape property table 2023-09-17 21:00:11 +02:00
MarkupGenerator.h LibJS: Fix redundancy-detection when printing raw values 2023-06-15 08:09:16 +02:00
Module.cpp LibJS: Make Heap::allocate<T>() infallible 2023-08-13 15:38:42 +02:00
Module.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
Parser.cpp LibJS: Allow assignment expression in spreading property definition 2023-08-29 18:46:01 -04:00
Parser.h LibJS: Identify global variables during parsing 2023-07-12 16:03:16 +02:00
ParserError.cpp LibJS: Add to_string definitions to CodeGenerationError and ParserError 2023-02-17 09:14:23 -05:00
ParserError.h LibJS: Add to_string definitions to CodeGenerationError and ParserError 2023-02-17 09:14:23 -05:00
Position.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
Print.cpp LibJS: Make Value::to_string_without_side_effects() infallible 2023-08-09 17:09:16 +02:00
Print.h Everywhere: Remove the AK:: qualifier from Stream usages 2023-02-13 00:50:07 +00:00
SafeFunction.h LibJS: Add GC graph dumper 2023-08-17 18:27:02 +02:00
Script.cpp LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr 2022-12-15 06:56:37 -05:00
Script.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
SourceCode.cpp LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceCode.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceRange.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceTextModule.cpp LibJS: Rip out the AST interpreter :^) 2023-08-08 13:07:13 +02:00
SourceTextModule.h LibJS: Implement import.meta for bytecode 2023-07-14 06:06:04 +02:00
SyntaxHighlighter.cpp LibSyntax+Userland: Make LibSyntax not depend on LibGUI 2023-08-29 07:57:39 -04:00
SyntaxHighlighter.h LibSyntax: Teach each highlighter about it's comment syntax 2022-11-27 18:28:43 -07:00
SyntheticModule.cpp LibJS: Make PrimitiveString::create() infallible 2023-08-09 17:09:16 +02:00
SyntheticModule.h AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
Token.cpp LibJS: Avoid DeprecatedString allocation in Token::double_value() 2023-09-03 18:59:00 +02:00
Token.h LibJS: Remove DeprecatedString usage from Token 2023-01-26 20:25:25 +00:00