Last Comment Bug 352047 - Javascript example for Windows need double quotes to work, not single quotes
: Javascript example for Windows need double quotes to work, not single quotes
Status: RESOLVED FIXED
u=mozdev p=0 c=Platform
:
Product: Developer Documentation
Classification: Other
Component: Mozilla Platform (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Eric Shepherd [:sheppy]
:
Mentors:
https://developer.mozilla.org/en-US/d...
: 352050 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-10 10:37 PDT by John Poole
Modified: 2015-10-03 06:17 PDT (History)
3 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description John Poole 2006-09-10 10:37:47 PDT
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.]
Comment 1 Nick Thomas [:nthomas] 2006-09-10 10:41:34 PDT
*** Bug 352050 has been marked as a duplicate of this bug. ***
Comment 2 David Boswell 2008-08-28 14:19:48 PDT
The www.mozilla.org site should no longer host documentation.  If there is still a need for this it should be added to MDC.  Moving to Mozilla Developer Center product for discussion.
Comment 3 Norris Boyd 2008-08-29 11:28:55 PDT
I've been slowly moving documents over to MDC, but haven't moved this one yet.
Comment 4 John Karahalis [:openjck] 2012-12-04 07:53:18 PST
Automatically closing all bugs that have not been updated in a while. Please reopen if this is still important to you and has not yet been corrected.
Comment 5 John Karahalis [:openjck] 2012-12-04 08:07:05 PST
Reopening for review by Sheppy.
Comment 6 Eric Shepherd [:sheppy] 2013-04-28 10:33:53 PDT
I've done some fixes for this. Can someone check it out and see if this is done or if it needs more work?

https://developer.mozilla.org/en-US/docs/Rhino/Embedding_tutorial

Note You need to log in before you can comment on or make changes to this bug.