Closed Bug 352050 Opened 18 years ago Closed 18 years ago

Javascript example for Windows need double quotes to work, not single quotes

Categories

(www.mozilla.org :: General, defect)

x86
Windows XP
defect
Not set
minor

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 352047

People

(Reporter: jlpoole56, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

The example, though working in Linux, does not work in Windows because of the single quotes:
G:\ws\rhino\examples>ver

Microsoft Windows XP [Version 5.1.2600]

G:\ws\rhino\examples>java RunScript "Math.cos(Math.PI)"
-1

G:\ws\rhino\examples>java RunScript 'function f(x){return x+1} f(7)'
functionf(x){returnx+1}f(7)

G:\ws\rhino\examples>java RunScript "function f(x){return x+1} f(7)"
8

G:\ws\rhino\examples>ver

Microsoft Windows XP [Version 5.1.2600]

G:\ws\rhino\examples>java -version
java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

G:\ws\rhino\examples>

Reproducible: Always

Steps to Reproduce:
1. Open DOS console in directory of RunScript.class
2. Set CLASSAPTH to rhino class tree and current dir, "e.g. set CLASSPATH=../build/classes;."
3. run: java RunScript 'function f(x){return x+1} f(7)'
4. run: java RunScript "function f(x){return x+1} f(7)"


Actual Results:  
single quotes:
G:\ws\rhino\examples>ver

Microsoft Windows XP [Version 5.1.2600]

G:\ws\rhino\examples>java RunScript "Math.cos(Math.PI)"
-1

G:\ws\rhino\examples>java RunScript 'function f(x){return x+1} f(7)'
functionf(x){returnx+1}f(7)

G:\ws\rhino\examples>single quotes:
G:\ws\rhino\examples>ver

Microsoft Windows XP [Version 5.1.2600]

G:\ws\rhino\examples>java RunScript "Math.cos(Math.PI)"
-1

G:\ws\rhino\examples>java RunScript 'function f(x){return x+1} f(7)'
functionf(x){returnx+1}f(7)

G:\ws\rhino\examples>java RunScript "function f(x){return x+1} f(7)"
8
8

Expected Results:  
"8" should be output for: java RunScript "function f(x){return x+1} f(7)"

This is a documentation bug, and perhaps an oversight of the author about differences in DOS consoles vs. Linux.

[Sorry for the incorrect component assignment, I tried to find something that would associate this bug with the rhino project, but the online documentation within this bug filing process did not provide me the necessary information.]

*** This bug has been marked as a duplicate of 352047 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Product: mozilla.org → Websites
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.