The default bug view has changed. See this FAQ.

argv past script argument should not be interpreted as options

RESOLVED FIXED in mozilla9

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: cdleary, Assigned: cdleary)

Tracking

unspecified
mozilla9
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Expected behavior:

<<EOF
print(uneval(arguments))
EOF

$ ./js foo.js -q
["-q"]
Created attachment 553267 [details] [diff] [review]
Script arg terminates options.

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
Last Resolved: 6 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.