@@ -2,6 +2,7 @@ import { bindActionCreators } from "redux";
22import * as timings from "./timings" ;
33import { prefs , features } from "./prefs" ;
44import { isDevelopment } from "devtools-config" ;
5+ import { formatPausePoints } from "./pause/pausePoints" ;
56
67function findSource ( dbg , url ) {
78 const sources = dbg . selectors . getSources ( ) ;
@@ -15,9 +16,15 @@ function findSource(dbg, url) {
1516}
1617
1718function sendPacket ( dbg , packet , callback ) {
18- dbg . connection . tabConnection . debuggerClient
19- . request ( packet )
20- . then ( callback || console . log ) ;
19+ dbg . client . sendPacket ( packet , callback || console . log ) ;
20+ }
21+
22+ function sendPacketToThread ( dbg , packet , callback ) {
23+ sendPacket (
24+ dbg ,
25+ { to : dbg . connection . tabConnection . threadClient . actor , ...packet } ,
26+ callback
27+ ) ;
2128}
2229
2330function evaluate ( dbg , expression , callback ) {
@@ -37,6 +44,12 @@ function getCM() {
3744 return cm && cm . CodeMirror ;
3845}
3946
47+ function _formatPausePoints ( dbg , url ) {
48+ const source = dbg . helpers . findSource ( url ) ;
49+ const pausePoints = dbg . selectors . getPausePoints ( source ) ;
50+ console . log ( formatPausePoints ( source . text , pausePoints ) ) ;
51+ }
52+
4053export function setupHelper ( obj ) {
4154 const selectors = bindSelectors ( obj ) ;
4255 const actions = bindActionCreators ( obj . actions , obj . store . dispatch ) ;
@@ -51,7 +64,11 @@ export function setupHelper(obj) {
5164 helpers : {
5265 findSource : url => findSource ( dbg , url ) ,
5366 evaluate : ( expression , cbk ) => evaluate ( dbg , expression , cbk ) ,
67+ sendPacketToThread : ( packet , cbk ) => sendPacketToThread ( dbg , packet , cbk ) ,
5468 sendPacket : ( packet , cbk ) => sendPacket ( dbg , packet , cbk )
69+ } ,
70+ formatters : {
71+ pausePoints : url => _formatPausePoints ( dbg , url )
5572 }
5673 } ;
5774
0 commit comments