ladybird/Tests/LibJS/Bytecode/expected/class-literal-fields.txt
Andreas Kling 4046f65ae7 LibJS: Treat class definition parts as strict
Record the generator's strictness for each emitted bytecode
instruction, instead of applying the executable's final strictness to
every instruction during assembly. This lets class heritage and
computed element names run with strict assignment semantics inside
sloppy scripts.

Also create the class self-binding as a strict immutable binding,
matching ClassDefinitionEvaluation, and cover strict class heritage and
computed names in the runtime tests.
2026-05-22 01:56:57 +02:00

76 lines
2.2 KiB
Text

$77ae058b class-literal-fields.js:12:1
Registers: 15
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] GetGlobal dst:reg6, `test`
[ 10] Call dst:reg5, callee:reg6, this_value:Undefined, test
[ 30] DynamicInitializeLexicalBinding `a`, src:reg5
[ 40] GetGlobal dst:reg6, `console`
[ 50] GetById dst:reg7, base:reg6, `log` (console.log)
[ 68] GetGlobal dst:reg8, `a`
[ 78] GetById dst:reg9, base:reg8, `x` (a.x)
[ 90] GetGlobal dst:reg8, `a`
[ a0] GetById dst:reg10, base:reg8, `y` (a.y)
[ b8] GetGlobal dst:reg8, `a`
[ c8] GetById dst:reg11, base:reg8, `z` (a.z)
[ e0] GetGlobal dst:reg8, `a`
[ f0] GetById dst:reg12, base:reg8, `w` (a.w)
[ 108] GetGlobal dst:reg8, `a`
[ 118] GetById dst:reg13, base:reg8, `s` (a.s)
[ 130] GetGlobal dst:reg8, `a`
[ 140] GetById dst:reg14, base:reg8, `computed` (a.computed)
[ 158] Call dst:reg5, callee:reg7, this_value:reg6, console.log, arguments:[reg9, reg10, reg11, reg12, reg13, reg14]
[ 190] End value:reg5
test$fa7458d4 class-literal-fields.js:2:5
Registers: 7
Blocks: 1
Locals: A~0
Constants:
[0] = String("x")
[1] = String("y")
[2] = String("z")
[3] = String("w")
[4] = String("s")
[5] = String("computed")
[6] = Undefined
block0:
[ 0] GetLexicalEnvironment dst:reg4
[ 8] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:0, is_catch_environment:false
[ 20] CreateVariable `A`, is_immutable:true, is_global:false, is_strict:true
[ 30] SetLexicalEnvironment environment:reg4
[ 38] NewClass dst:reg6, class_environment:reg5, class_blueprint_index:0, element_keys:[element_keys:String("x"), element_keys:String("y"), element_keys:String("z"), element_keys:String("w"), element_keys:String("s"), element_keys:String("computed")]
[ 70] Mov dst:A~0, src:reg6
[ 80] ThrowIfTDZ src:A~0
[ 88] CallConstruct dst:reg6, callee:A~0, A
[ a0] Return value:reg6
A$ef0589ec
Registers: 5
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] End value:Undefined
field$d016a301 class-literal-fields.js:8:22
Registers: 5
Blocks: 1
Constants:
[0] = Int32(1)
[1] = Int32(2)
[2] = Int32(3)
block0:
[ 0] Return value:Int32(3)
42 -1 true null "hi" 3