Resolve dynamic identifier assignment targets before evaluating the right hand side, then store through that saved environment record. This matches the ECMA-262 ordering for simple assignment and var initializers when a with binding is deleted or direct eval creates a nearer var. Add runtime coverage for with and direct-eval cases and refresh bytecode expectations for dynamic assignments that now snapshot the binding before storing.
40 lines
1 KiB
Text
40 lines
1 KiB
Text
$49b95e06 eval-same-function.js:10:1
|
|
Registers: 7
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Undefined
|
|
|
|
block0:
|
|
[ 0] GetGlobal dst:reg6, `foo`
|
|
[ 10] Call dst:reg5, callee:reg6, this_value:Undefined, foo
|
|
[ 30] End value:reg5
|
|
|
|
|
|
foo$3e35f384 eval-same-function.js:6:9
|
|
Registers: 8
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = String("var x = 1")
|
|
[1] = Undefined
|
|
[2] = Int32(42)
|
|
|
|
block0:
|
|
[ 0] CreateArguments is_immutable:false
|
|
[ 10] DynamicGetCalleeAndThisFromEnvironment callee:reg6, this_value:reg7, `eval`
|
|
[ 28] CallDirectEval dst:reg5, callee:reg6, this_value:reg7, eval, arguments:[String("var x = 1")]
|
|
[ 50] DynamicGetBinding dst:reg6, `Number`
|
|
[ 60] CallConstruct dst:reg5, callee:reg6, Number, arguments:[Int32(42)]
|
|
[ 80] Return value:reg5
|
|
|
|
|
|
eval$e1340763 line 1, column 1
|
|
Registers: 6
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Int32(1)
|
|
[1] = Undefined
|
|
|
|
block0:
|
|
[ 0] ResolveBinding dst:reg5, `x`
|
|
[ 10] SetResolvedBinding environment:reg5, `x`, src:Int32(1)
|
|
[ 20] End value:Undefined
|