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,652

Post » Tue May 14, 2013 11:56 pm

\\ is used to Mac and Linux Path
B
105
S
29
G
28
Posts: 3,102
Reputation: 27,380

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
366
S
217
G
82
Posts: 23,251
Reputation: 183,531


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests