Programming today can still feel like a black box, even with all the new developer tools for debugging code. I think this is because we don't have the ability to truly customize the debugging experience for our application. What if we could have a user-land JavaScript debugger that you could shape to your needs?
It turns out that you can build a real stepping debugger by abusing
yield
from ES6 generators. By instrumenting every expression with
yield
, we gain control of the stack and execution while allowing the
native JavaScript VM to still execute everything else. This special
code is run inside our own VM in user-land, and allows you to pause
and step through code.
An example of the instrumented code is here, and you can step through the code here. If we flesh this out, I think it could be a powerful tool.
I work for Mozilla and help developers write web apps. In my heart I'm an idealist but I've learned to mix practicality with idealism when approaching software problems. I have a heavy functional programming background with Scheme, and used to write DirectX games in high-school in C++. In fact, I wrote a text-based RPG on my TI-82 calculator during math class in 7th grade. It didn't take off like I thought it would.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。