ladybird/Tests/LibJS/Bytecode/expected/for-in-object-property-iterator-next.txt
Andreas Kling bf530ad2af LibJS: Fix destructured primitive string const loops
Mark binding-pattern identifiers with their declaration kind so local
destructuring assignments use the normal TDZ and const assignment path.
This makes local const destructuring match the environment-backed path.

Also teach GetById to expose primitive string virtual index properties
before boxing, matching StringGetOwnProperty and GetByValue. Together
these fix the SpiderMonkey for-in/of const declaration coverage and the
lexical destructuring TDZ test.
2026-05-22 01:56:57 +02:00

52 lines
1.6 KiB
Text

$2c4e495c for-in-object-property-iterator-next.js:8:1
Registers: 8
Blocks: 1
Constants:
[0] = Undefined
[1] = Int32(2)
[2] = String("two")
[3] = String("foo")
[4] = Int32(7)
[5] = String("seven")
block0:
[ 0] GetGlobal dst:reg6, `collect`
[ 10] NewObject dst:reg7
[ 20] ToPrimitiveWithStringHint dst:Int32(2), value:Int32(2)
[ 30] PutByValue base:reg7, property:Int32(2), src:String("two"), kind:Own
[ 48] PutById base:reg7, `foo`, src:String("foo"), kind:Own
[ 68] ToPrimitiveWithStringHint dst:Int32(7), value:Int32(7)
[ 78] PutByValue base:reg7, property:Int32(7), src:String("seven"), kind:Own
[ 90] Call dst:reg5, callee:reg6, this_value:Undefined, collect, arguments:[reg7]
[ b8] End value:reg5
collect$a1c4c33b for-in-object-property-iterator-next.js:2:18
Registers: 12
Blocks: 6
Locals: key~0, keys~1
block0:
[ 0] NewArray dst:keys~1
[ 10] JumpNullish condition:arg0, true_target:block3, false_target:block4
block1:
[ 20] Return value:keys~1
block2:
[ 28] ObjectPropertyIteratorNext dst_value:reg6, dst_done:reg7, iterator_object:reg5
[ 38] JumpIf condition:reg7, true_target:block1, false_target:block5
block3:
[ 48] Return value:keys~1
block4:
[ 50] GetObjectPropertyIterator dst_iterator:reg5, object:arg0
[ 60] Jump target:block2
block5:
[ 68] Mov dst:key~0, src:reg6
[ 78] GetById dst:reg9, base:keys~1, `push` (keys.push)
[ 90] Mov2 dst1:reg10, src1:keys~1, dst2:reg11, src2:key~0
[ a8] Call dst:reg8, callee:reg9, this_value:reg10, keys.push, arguments:[reg11]
[ d0] Jump target:block2