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
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

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
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests