Guest User

Untitled

a guest
Apr 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js
  2. index 6deee45..b711d83 100644
  3. --- a/devtools/server/actors/thread.js
  4. +++ b/devtools/server/actors/thread.js
  5. @@ -425,10 +425,11 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
  6. const result = function(completion) {
  7. // onPop is called with 'this' set to the current frame.
  8. const generatedLocation = thread.sources.getFrameLocation(this);
  9. - const { originalSourceActor } = thread.unsafeSynchronize(
  10. + const originalLocation = thread.unsafeSynchronize(
  11. thread.sources.getOriginalLocation(generatedLocation)
  12. );
  13. -
  14. +
  15. + const { originalSourceActor } = originalLocation;
  16. const url = originalSourceActor.url;
  17.  
  18. if (thread.sources.isBlackBoxed(url)) {
  19. @@ -438,21 +439,14 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
  20. // Note that we're popping this frame; we need to watch for
  21. // subsequent step events on its caller.
  22. this.reportedPop = true;
  23. -
  24. - return pauseAndRespond(this, packet => {
  25. - packet.why.frameFinished = {};
  26. - if (!completion) {
  27. - packet.why.frameFinished.terminated = true;
  28. - } else if (completion.hasOwnProperty("return")) {
  29. - packet.why.frameFinished.return = createValueGripHook(completion.return);
  30. - } else if (completion.hasOwnProperty("yield")) {
  31. - packet.why.frameFinished.return = createValueGripHook(completion.yield);
  32. - } else {
  33. - packet.why.frameFinished.throw = createValueGripHook(completion.throw);
  34. - }
  35. - return packet;
  36. - });
  37. - };
  38. + const parentFrame = thread._getNextStepFrame(this);
  39. + if (parentFrame && parentFrame.script) {
  40. + const generatedLocation = thread.sources.getFrameLocation(parentFrame);
  41. + const { onStep } = thread._makeSteppingHooks(originalLocation, "next", parentFrame);
  42. + parentFrame.onStep = onStep
  43. + return undefined;
  44. + }
  45. + }
  46.  
  47. // When stepping out, we don't want to stop at a breakpoint that
  48. // happened to be set exactly at the spot where we stepped out.
  49. @@ -560,7 +554,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
  50. /**
  51. * Define the JS hook functions for stepping.
  52. */
  53. - _makeSteppingHooks: function(startLocation, steppingType) {
  54. + _makeSteppingHooks: function(startLocation, steppingType, startFrame) {
  55. // Bind these methods and state because some of the hooks are called
  56. // with 'this' set to the current frame. Rather than repeating the
  57. // binding in each _makeOnX method, just do it once here and pass it
  58. @@ -573,7 +567,7 @@ const ThreadActor = ActorClassWithSpec(threadSpec, {
  59. ),
  60. createValueGrip: v => createValueGrip(v, this._pausePool, this.objectGrip),
  61. thread: this,
  62. - startFrame: this.youngestFrame,
  63. + startFrame: startFrame || this.youngestFrame,
  64. startLocation: startLocation,
  65. steppingType: steppingType
  66. };
Add Comment
Please, Sign In to add comment