ladybird/Userland/Libraries/LibJS/Tests
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
..
builtins LibJS: Unescape incorrectly escaped code units in regex patterns 2023-09-16 15:21:09 +02:00
classes
functions LibJS: Get initial_value from local variables if id represents a local 2023-09-18 17:57:56 +02:00
iterators
loops LibJS: Create const variables in ForIn/OfBodyEvaluation in strict mode 2023-09-21 16:19:05 +02:00
modules
operators
syntax
add-values-to-primitive.js
arguments-callee.js
arguments-object.js
automatic-semicolon-insertion.js
break-continue-syntax-errors.js
comments-basic.js
computed-property-sideeffects.js
computed-property-throws.js
const-declaration-missing-initializer.js
const-reassignment.js
custom-@@hasInstance.js
custom-@@toPrimitive.js
custom-@@toStringTag.js
debugger-statement.js
duplicated-variable-declarations.js
empty-statements.js
eval-aliasing.js
eval-basic.js
exception-in-catch-block.js
exception-ReferenceError.js
exponentiation-basic.js
gc-deeply-nested-object-graph.js
global-var-let-const.js
if-statement-function-declaration.js
indexed-access-prototype-indirection.js
indexed-access-string-object.js
inline-cache-edge-cases.js
invalid-lhs-in-assignment.js
labels.js
let-scoping.js
new-expression.js
non-writable-assignment.js
numeric-literals-basic.js
object-basic.js
object-expression-__proto__.js
object-expression-computed-property.js
object-expression-numeric-property.js
object-getter-setter-shorthand.js
object-method-shorthand.js
object-spread.js LibJS: Avoid ToPropertyKey for spreading in PutByValue(WithThis) 2023-08-29 21:38:54 -04:00
ordinary-to-primitive.js
parseInt.js
parser-declaration-in-single-statement-context.js
parser-line-terminators.js
parser-unary-associativity.js
permanently-screwed-by-eval.js
program-non-strict.js
program-strict-mode.js
return.js
runtime-error-call-stack-size.js
statement-with-many-labels.js
strict-mode-blocks.js
strict-mode-errors.js
string-basic.js
string-concatenation.js
string-escapes.js
string-spread.js
switch-basic.js
switch-break.js
switch-default-before-case.js
tagged-template-literals.js
template-literals.js
test-common-tests.js
test-common.js
this-value-strict.js
this-value.js
throw-basic.js
to-number-basic.js
to-number-exception.js
try-catch-finally-nested.js
try-catch-finally-return.js
try-catch-finally.js
try-finally-break.js
try-finally-continue.js
try-return-finally.js
unicode-identifier-escape.js
update-expression-on-member-expression.js
update-expressions-basic.js
use-strict-directive.js
using-declaration.js
using-for-loops.js
var-multiple-declarator.js
var-scoping.js
variable-undefined.js
with-basic.js