Skip to content

Commit 52c4809

Browse files
Yuyupoyichoi
authored andcommitted
Change path to use path.join (#40)
IoT.js-Debug-DCO-1.0-Signed-off-by: Daniella Barsony [email protected]
1 parent e9c1060 commit 52c4809

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/IotjsDebugger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ class IotjsDebugSession extends DebugSession {
431431
// General helper functions
432432

433433
private handleSource(data: JerryMessageScriptParsed): void {
434-
const path = `${this._args.localRoot}/${this.pathToBasename(data.name)}`;
434+
const path = Path.join(`${this._args.localRoot}`, `${this.pathToBasename(data.name)}`);
435435
const src = this._protocolhandler.getSource(data.id);
436436

437437
const write = c => Fs.writeSync(Fs.openSync(path, 'w'), c);

src/extension.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ const processCustomEvent = async (e: vscode.DebugSessionCustomEvent): Promise<an
8383
switch (e.event) {
8484
case 'waitForSource': {
8585
if (vscode.debug.activeDebugSession) {
86-
const path = await getProgramName().then(path => path);
87-
const source = getProgramSource(path);
86+
const pathName = await getProgramName().then(path => path);
87+
const source = getProgramSource(pathName);
8888

8989
vscode.debug.activeDebugSession.customRequest('sendSource', {
9090
program: {
91-
name: path.split('/').pop(),
91+
name: pathName.split(path.delimiter).pop(),
9292
source
9393
}
9494
});

0 commit comments

Comments
 (0)