File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,16 @@ export class PathTransformer implements IDebugTransformer {
57
57
else if ( this . inferedDeviceRoot ) {
58
58
utils . Logger . log ( `Paths.setBP: No target url cached for client path: ${ url } . Using inffered device root to set breakpoint` ) ;
59
59
60
- let inferedUrl = url . replace ( this . _webRoot , this . inferedDeviceRoot ) . replace ( / \\ / g, "/" ) ;
60
+ let inferedUrl = null ;
61
+ if ( this . _platform == "android" ) {
62
+ inferedUrl = url . replace ( this . _webRoot , this . inferedDeviceRoot ) . replace ( / \\ / g, "/" ) ;
63
+ }
64
+ else if ( this . _platform === "ios" ) {
65
+ inferedUrl = url . replace ( this . _webRoot , "" ) . replace ( / \\ / g, "/" ) ;
66
+ }
67
+ else {
68
+ throw new Error ( "Not supported platform" ) ;
69
+ }
61
70
62
71
//change device path if {N} core module or {N} module
63
72
if ( inferedUrl . indexOf ( "/node_modules/tns-core-modules/" ) != - 1 )
@@ -103,7 +112,7 @@ export class PathTransformer implements IDebugTransformer {
103
112
104
113
public scriptParsed ( event : DebugProtocol . Event ) : void {
105
114
const webkitUrl : string = event . body . scriptUrl ;
106
- if ( ! this . inferedDeviceRoot )
115
+ if ( ! this . inferedDeviceRoot && this . _platform === "android" )
107
116
{
108
117
this . inferedDeviceRoot = utils . inferDeviceRoot ( this . _webRoot , this . _platform , webkitUrl ) ;
109
118
utils . Logger . log ( "\n\n\n ***Inferred device root: " + this . inferedDeviceRoot + "\n\n\n" ) ;
You can’t perform that action at this time.
0 commit comments