If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

evaluateString doesn't parse strings as expected

RESOLVED WORKSFORME

Status

Rhino
Core
--
major
RESOLVED WORKSFORME
7 years ago
7 years ago

People

(Reporter: Alexander Weber, Unassigned)

Tracking

Details

(Reporter)

Description

7 years ago
User-Agent:       Opera/9.80 (X11; Linux x86_64; U; en) Presto/2.2.15 Version/10.10
Build Identifier: Rhino 1.7R2 2009-03-22

The method "evaluateString" doesn't evaluate string escapes correctly, "\n" should become line feed, "\t" should become tab, "\r" should become carriage return and "\\" should become "\"

Reproducible: Always

Steps to Reproduce:
Context context = Context.enter();
ScriptableObject scope = context.initStandardObjects();
System.out.println( context.evaluateString(scope, "'test \\\\ \\n \\r \\t welt!';", "<cmd>", 1, null) );
Actual Results:  
"test \\ 
	welt!"

Expected Results:  
"test \\ \n \r \t welt!"

Used the downloaded release JAR file from the rhino homepage.
(Reporter)

Comment 1

7 years ago
sorry, little misstake, "Actual Results" are what I would expect and "Expected Results" are what is returned.

Comment 2

7 years ago
With both Rhino 1.7R2 and a recent CVS snapshot I get the following output, which is exactly what I'd expect:

test \ 
 	 welt!

Closing as worksforme.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 3

7 years ago
Thank you for the fast response! I finally found the reason after using the CVS snapshot. It was the "yuicompressor-2.4.2.jar" I'am using together with Rhino, after removing that thing everything works out well.
You need to log in before you can comment on or make changes to this bug.