forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 984696 - Save more detailed source notes so that Debugger.Script.…
…prototype.getAllColumnOffsets can offer more for source mapped and/or pretty printed JS debugging. r=ejpbruel
- Loading branch information
Nick Fitzgerald
committed
Apr 22, 2014
1 parent
44089f8
commit 2fd81d4
Showing
7 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
js/src/jit-test/tests/debug/Script-getAllColumnOffsets-02.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// getColumnOffsets correctly places multiple variable declarations. | ||
|
||
var global = newGlobal(); | ||
Debugger(global).onDebuggerStatement = function (frame) { | ||
var script = frame.eval("f").return.script; | ||
script.getAllColumnOffsets().forEach(function (offset) { | ||
script.setBreakpoint(offset.offset, { | ||
hit: function (frame) { | ||
assertEq(offset.lineNumber, 1); | ||
global.log += offset.columnNumber + " "; | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
global.log = ''; | ||
global.eval("function f(n){var w0,x1=3,y2=4,z3=9} debugger;"); | ||
global.f(3); | ||
|
||
// Should have hit each variable declared. | ||
assertEq(global.log, "18 21 26 31 33 "); |
20 changes: 20 additions & 0 deletions
20
js/src/jit-test/tests/debug/Script-getAllColumnOffsets-03.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// getColumnOffsets correctly places comma separated expressions. | ||
|
||
var global = newGlobal(); | ||
Debugger(global).onDebuggerStatement = function (frame) { | ||
var script = frame.eval("f").return.script; | ||
script.getAllColumnOffsets().forEach(function (offset) { | ||
script.setBreakpoint(offset.offset, { | ||
hit: function (frame) { | ||
assertEq(offset.lineNumber, 1); | ||
global.log += offset.columnNumber + " "; | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
global.log = ''; | ||
global.eval("function f(n){print(n),print(n),print(n)} debugger;"); | ||
global.f(3); | ||
// Should hit each call that was separated by commas. | ||
assertEq(global.log, "14 23 32 40 "); |
20 changes: 20 additions & 0 deletions
20
js/src/jit-test/tests/debug/Script-getAllColumnOffsets-04.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// getColumnOffsets correctly places object properties. | ||
|
||
var global = newGlobal(); | ||
Debugger(global).onDebuggerStatement = function (frame) { | ||
var script = frame.eval("f").return.script; | ||
script.getAllColumnOffsets().forEach(function (offset) { | ||
script.setBreakpoint(offset.offset, { | ||
hit: function (frame) { | ||
assertEq(offset.lineNumber, 1); | ||
global.log += offset.columnNumber + " "; | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
global.log = ''; | ||
global.eval("function f(n){var o={a:1,b:2,c:3}} debugger;"); | ||
global.f(3); | ||
// Should hit each property in the object. | ||
assertEq(global.log, "18 21 25 29 19 "); |
20 changes: 20 additions & 0 deletions
20
js/src/jit-test/tests/debug/Script-getAllColumnOffsets-05.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// getColumnOffsets correctly places array properties. | ||
|
||
var global = newGlobal(); | ||
Debugger(global).onDebuggerStatement = function (frame) { | ||
var script = frame.eval("f").return.script; | ||
script.getAllColumnOffsets().forEach(function (offset) { | ||
script.setBreakpoint(offset.offset, { | ||
hit: function (frame) { | ||
assertEq(offset.lineNumber, 1); | ||
global.log += offset.columnNumber + " "; | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
global.log = ''; | ||
global.eval("function f(n){var a=[1,2,3]} debugger;"); | ||
global.f(3); | ||
// Should hit each item in the array. | ||
assertEq(global.log, "18 21 23 25 19 "); |