Closed Bug 700375 Opened 13 years ago Closed 6 years ago

Context.compileFunction() allows code with multiple function definitions

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: marshall.scorcio, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2 Steps to reproduce: Running Rhino 1.7R3 with Java 1.6.0_26 on OS X 10.7 Called Context.compileFunction() with code that contains two function definitions. Something like: "function x() { return 'x'; } function y() { return 'y'; }" Actual results: No exception was thrown and the returned Function object was x(). y() seems to have been silently ignored. I've attached some test Java code that demonstrates this happening. Expected results: In Rhino 1.6R7 an IllegalArgumentException was thrown. It seems like something similar should happen. A method with the name "compileFunction" should only allow the source code for a single function. Silently ignoring the rest of the source code is not very helpful.

Closing. Bug management is now done here:
https://github.com/mozilla/rhino

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: