Is there a way to set a conditional breakpoint based on a value in a Javascript Closure in a browser?

一世执手 提交于 2020-01-06 12:26:24

问题


Is there a way to set a conditional breakpoint based on a value in a Javascript Closure in a browser? There's an html element node in the closure whose 'name' property value changes for every AngularJS $formatters action execution. I would like a breakpoint to get hit only for a certain element.

The code snippet is in AngularJS attribute directive. The breakpoint is on the originalValue line.

This screen capture shows the Closure in the Call Stack in Chrome Dev Tools. There's a property 'name' (not shown) which has the element's name. I am looking for a breakpoint expression like this (Obviously not correct) : Closure (link).element.0.name == 'customerName'

来源:https://stackoverflow.com/questions/50731565/is-there-a-way-to-set-a-conditional-breakpoint-based-on-a-value-in-a-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!