onilabs / stratifiedjs

Oni StratifiedJS (previously Apollo)
http://onilabs.com/stratifiedjs
Other
228 stars 22 forks source link

Harmonize apollo's & node's process.argv #7

Open afri opened 12 years ago

afri commented 12 years ago

From https://groups.google.com/d/msg/oni-apollo/3GVnfQJQqu4/JSQnfoDC9w4J :

I also noted a problem using 'process.argv':

When I call Apollo with 'apollo test.sjs ./spec' then 'process.argv' contains [test.sjs,./spec].

When I call nodejs with 'node test.js ./spec' then it contains [node,D:...full-path to\test.sjs,./spec].

timbertson commented 12 years ago

Is the issue that node leaves itself in argv[0] and apollo doesn't? Or that node resolves the full path to the script?

If it's the first, I think node has it wrong, but we may have to do the same to be compatible. It's very strange though - no other interpreter that I know of leaves itself in argv (python, ruby, perl, etc).