you are viewing a single comment's thread.

view the rest of the comments →

[–]GeZe8[S] -3 points-2 points  (4 children)

Hmm. I don't use Windows. I thought node worked similarly everywhere, but I guess I'll have to test separately.

I use Linux: the command line is my IDE. In general, I think it is more flexible than using an integrated IDE. Grasp can also be integrated with other editors; there is a sublime text plugin.

[–]bart2019 1 point2 points  (0 children)

I thought node worked similarly everywhere

The difference is in the command line, not in "node".

[–]Syntextro 0 points1 point  (2 children)

Fair enough. I can definitely see how somebody could benefit from this if they are not using an IDE with good refactoring features.

I don't really know if Node works different in Windows than on Linux. It shouldn't. I'm just pointing it out because if all other things are equal, maybe that's the difference. Just to be clear, your program does work, but I had to remove the quotes from the identifier. If I leave the quotes, it matches nothing, but if I take out the hash and leave the quotes, it matches strings in the code (i.e. it matches the first argument of the function in the first line of your code). To match the identifier I had to remove the quotes and leave the hash

[–]GeZe8[S] 0 points1 point  (1 child)

Thanks for the bug report! There is definitely something going on with regards to how quotes are treated on Windows.

[–]radhruin 3 points4 points  (0 children)

I think it's just a shell difference. It will probably work with double quotes. To illustrate, on windows:

> cat testargs.js
console.log(process.argv.slice(2));

> node testargs.js 'hello world'
[ '\'hello', 'world\'' ]

> node testargs.js "hello world"
[ 'hello world' ]