Node-webkit plugin: Digging the code

For developers using the Construct 2 Javascript SDK

Post » Tue May 14, 2013 11:04 pm

@Ashley, got a quick question for ya.

Why are you using this:

var slash = "\\";
path = require("path");
if (process["platform"] !== "win32")
   slash = "/";


Wouldn't it be better/efficient/sexier/insert-adjective-of-choice to use path.sep instead?

Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,662

Post » Tue May 14, 2013 11:56 pm

\\ is used to Mac and Linux Path
B
111
S
30
G
28
Posts: 3,106
Reputation: 27,643

Post » Wed May 15, 2013 3:09 pm

Yeah, you're right, path.sep would have been more elegant... maybe I'll change that for the next build :P
Scirra Founder
B
373
S
218
G
84
Posts: 23,450
Reputation: 186,140


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest