webdev icon indicating copy to clipboard operation
webdev copied to clipboard

Local variables that are DOM elements are not included in the "topFrame" field when pausing on breakpoints

Open DanTup opened this issue 2 years ago • 1 comments

Here I have two local variables, a and i. a is a standard class and shows in the Locals section. i is a DOM element and does not (I don't know if that's the reason, but it's the only obvious difference):

image

Specifically, it's missing from the vars of the topFrame in the PauseBreakpoint event:

{
	"jsonrpc": "2.0",
	"method": "streamNotify",
	"params": {
		"streamId": "Debug",
		"event": {
			"type": "Event",
			"kind": "PauseBreakpoint",
			// ...
			"topFrame": {
				// ...
				"vars": [
					{
						"type": "BoundVariable",
						"name": "this",
						"value": // ...
					},
					{
						"type": "BoundVariable",
						"name": "context",
						"value": // ...
					},
					{
						"type": "BoundVariable",
						"name": "a",
						"value": // ...
					}
				],
				"kind": "Regular"
			}
		}
	}
}

DanTup avatar Aug 03 '23 15:08 DanTup

Tested again today (along with https://github.com/dart-lang/webdev/issues/2183) and the behaviour is the same - these items are missing from the topFrame.vars:

image

{
	"jsonrpc": "2.0",
	"method": "streamNotify",
	"params": {
		"streamId": "Debug",
		"event": {
			"type": "Event",
			"kind": "PauseInterrupted",
			"timestamp": 1727358455237,
			"isolate": {
				"type": "@Isolate",
				"id": "1",
				"number": "1",
				"name": "main()",
				"isSystemIsolate": false,
				"isolateGroupId": ""
			},
			"topFrame": {
				"type": "Frame",
				"index": 0,
				"code": {
					"type": "@Code",
					"id": "739",
					"name": "build",
					"kind": "Dart"
				},
				"location": {
					"type": "SourceLocation",
					"script": {
						"type": "@Script",
						"id": "4",
						"uri": "package:webdev_2183/main.dart"
					},
					"tokenPos": 1343,
					"line": 17,
					"column": 5
				},
				"vars": [
					{
						"type": "BoundVariable",
						"name": "this",
						"value": {
							"type": "@Instance",
							"id": "-8676362967872990568.1.5",
							"kind": "PlainInstance",
							"identityHashCode": 748956460,
							"class": {
								"type": "@Class",
								"id": "classes|package:webdev_2183/main.dart|MainApp",
								"name": "MainApp",
								"library": {
									"type": "@Library",
									"id": "package:webdev_2183/main.dart",
									"name": "package:webdev_2183/main.dart",
									"uri": "package:webdev_2183/main.dart"
								}
							},
							"length": 2
						},
						"declarationTokenPos": -1,
						"scopeStartTokenPos": -1,
						"scopeEndTokenPos": -1
					},
					{
						"type": "BoundVariable",
						"name": "context",
						"value": {
							"type": "@Instance",
							"id": "-8676362967872990568.1.504",
							"kind": "PlainInstance",
							"identityHashCode": 579777764,
							"class": {
								"type": "@Class",
								"id": "classes|package:flutter/src/widgets/framework.dart|StatelessElement",
								"name": "StatelessElement",
								"library": {
									"type": "@Library",
									"id": "package:flutter/src/widgets/framework.dart",
									"name": "package:flutter/src/widgets/framework.dart",
									"uri": "package:flutter/src/widgets/framework.dart"
								}
							},
							"length": 17
						},
						"declarationTokenPos": -1,
						"scopeStartTokenPos": -1,
						"scopeEndTokenPos": -1
					}
				],
				"kind": "Regular"
			}
		}
	}
}

DanTup avatar Sep 26 '24 14:09 DanTup