@@ -971,6 +971,7 @@ func (e *compiledDotExpr) emitRef() {
func (e *compiledDotExpr) emitSetter(valueExpr compiledExpr, putOnStack bool) {
e.left.emitGetter(true)
valueExpr.emitGetter(true)
+ e.addSrcMap()
if e.c.scope.strict {
if putOnStack {
e.c.emit(setPropStrict(e.name))
@@ -4610,6 +4610,17 @@ func TestSrcLocations(t *testing.T) {
["test.js", "", 49, 4]
]);
}
+
+ try {
+ let n;
+ n.field = {
+ "key1": "test",
+ "key2": {},
+ }
+ } catch(e) {
+ assertStack(e, [["test.js", "", 58, 5]
+ ]);
`
testScriptWithTestLibX(SCRIPT, _undefined, t)