Closed Bug 399775 Opened 18 years ago Closed 7 years ago

Global load() doesn't subsitute environment variables

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INACTIVE

People

(Reporter: joshuaallen, Unassigned)

Details

Attachments

(4 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7 Build Identifier: 1.6R7 org.mozilla.javascript.tools.shell.Global#load doesn't substitute environment variables for path names. So for example Reproducible: Always Steps to Reproduce: 1. Create a javascript file 2. Add a first line load("$JSDIR/core-util.js") 3. Run javascript Actual Results: Doesn't exapand $JSDIR Expected Results: Expands $JSDIR I have a patch ready, I'll submit it once this bugs been submitted.
Note that the patch to bug https://bugzilla.mozilla.org/show_bug.cgi?id=368323 should also be applied because this solution uses runProcess.
Attachment #284848 - Flags: review?
French translation to addition to Message.properties
Unit tests for org.mozilla.javascript.tools.shell.Global#expandVars (JUnit 4) Environments this was tested on: CentOS release 4.5 (Final) Microsoft Windows XP [Version 5.1.2600] To be sure, it should be tested on the Mac too. Last part of fix.
((I know it's an old bug, but it's not RESOLVED)) I don't see a reason for load to expand env variables. This is JavaScript, not shell scripting, if you can't use env vars the issue is a function for getting env vars is needed inside the shell so that you can grab the value of an env var and + it onto a path. load() is supposed to take a legal path to a file, NOT expected to follow shell substitution rules which rather than being helpful could result in gotchas where paths are substituted where they shouldn't be. Recommend WONTFIX. You can already access env variables through LiveConnect.
Attachment #284848 - Flags: review?

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

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

Attachment

General

Creator:
Created:
Updated:
Size: