Closed Bug 679138 Opened 8 years ago Closed 8 years ago

argv past script argument should not be interpreted as options

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: cdleary, Assigned: cdleary)

Details

Attachments

(1 file)

Expected behavior:

<<EOF
print(uneval(arguments))
EOF

$ ./js foo.js -q
["-q"]
This also gives us the ability to make a |--| option for people passing |-f| if we cared.
Attachment #553267 - Flags: review?(dvander)
Comment on attachment 553267 [details] [diff] [review]
Script arg terminates options.

Review of attachment 553267 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/shell/jsoptparse.h
@@ +78,5 @@
>  
>      virtual ~Option() = 0;
>  
> +    void setTerminatesOptions(bool enabled) { terminatesOptions = enabled; }
> +    bool getTerminatesOptions() const { return terminatesOptions; }

I think this reads better as just "terminatesOptions()" but get is fine too
Attachment #553267 - Flags: review?(dvander) → review+
Whiteboard: [inbound]
http://hg.mozilla.org/integration/mozilla-inbound/rev/ee787d92a2e1

http://hg.mozilla.org/mozilla-central/rev/ee787d92a2e1
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.