chakra-core / chakra-core/ChakraCore

eval() function will cause "arguments" property missing in JsDiagGetStackProperties result

Open
#4,733 3 comments 0 reactions 0 assignees View on GitHub
Bug Severity: 3
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

repro steps:
1.run script from https://github.com/JohnMasen/ChakraCore.NET/blob/master/source/RunScript/Scripts/Debugging/app.js
make sure line 14 [`eval("let cc=10;");`] is uncommented.
2.set breakpoint at line 9 (it actually effects on whole root stack)
3.call JsDiagGetStackProperties when breakpoint hit
expected result:
`{"thisObject":{"name":"this","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":2},"arguments":{"name":"arguments","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":3},"locals":[{"name":"a","type":"string","value":"abc","propertyAttributes":1,"handle":4},{"name":"b","type":"string","value":"abc","propertyAttributes":1,"handle":5},{"name":"c","type":"string","value":"abcabc","propertyAttributes":1,"handle":6},{"name":"f","type":"string","value":"abcabcabcabc","propertyAttributes":1,"handle":7},{"name":"o","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":8},{"name":"o2","type":"string","value":"[Uninitialized block variable]","propertyAttributes":13,"handle":9},{"name":"ff","type":"string","value":"[Uninitialized block variable]","propertyAttributes":13,"handle":10},{"name":"ff2","type":"string","value":"[Uninitialized block variable]","propertyAttributes":13,"handle":11}],"scopes":[],"globals":{"handle":12}}`

Actual result
`{"thisObject":{"name":"this","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":2},"locals":[{"name":"arguments","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":3},{"name":"a","type":"string","value":"abc","propertyAttributes":1,"handle":4},{"name":"b","type":"string","value":"abc","propertyAttributes":1,"handle":5},{"name":"c","type":"string","value":"abcabc","propertyAttributes":1,"handle":6},{"name":"f","type":"string","value":"abcabcabcabc","propertyAttributes":1,"handle":7},{"name":"o","type":"object","className":"Object","display":"{...}","propertyAttributes":3,"handle":8},{"name":"o2","type":"string","value":"[Uninitialized block variable]","propertyAttributes":13,"handle":9},{"name":"ff","type":"string","value":"[Uninitialized block variable]","propertyAttributes":13,"handle":10},{"name":"ff2","type":"string","value":"[Uninitialized block variable]","propertyAttributes":13,"handle":11}],"scopes":[{"index":0,"handle":12},{"index":1,"handle":13}],"globals":{"handle":14}}`

### Screenshot for result compare: (arguments becomes part of local variables after eval() function uncommented)

## With Eval() function
![image](https://user-images.githubusercontent.com/7631912/36595054-b46b46e8-18db-11e8-98b8-ce93f678ca8c.png)
![image](https://user-images.githubusercontent.com/7631912/36595253-6492c276-18dc-11e8-8a93-923522e676db.png)

## Without Eval() function
![image](https://user-images.githubusercontent.com/7631912/36595097-e138c998-18db-11e8-856a-e8ad121db194.png)
![image](https://user-images.githubusercontent.com/7631912/36595327-b8845124-18dc-11e8-9c7b-7833b85bf955.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.