Closed Bug 419615 Opened 16 years ago Closed 16 years ago

use JSVERSION_LATEST in xpcshell

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9

People

(Reporter: shaver, Assigned: crowderbt)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 384370 comment 91 shows the woes inflicted by xpcshell not tracking the latest version of JS: can't write the same code in unit tests as in the code itself, without ugly and future-hostile version() calls.

Patching and making check, will attach here presently.
Flags: blocking1.9+
Version: unspecified → Trunk
Attached patch patch - v1 (obsolete) — Splinter Review
Something like this? I'll run make check on it in a bit.
Attachment #305748 - Flags: review?(shaver)
Assignee: nobody → crowder
Comment on attachment 305748 [details] [diff] [review]
patch - v1

Going to take a slightly different approach, patch in a second.
Attachment #305748 - Attachment is obsolete: true
Attachment #305748 - Flags: review?(shaver)
This matches what we do in the js-shell init.

From xpcshell:
js> let x = 5
js> x
5
Attachment #305834 - Flags: review?(shaver)
Status: NEW → ASSIGNED
Comment on attachment 305834 [details] [diff] [review]
use a context callback to set error-reporter and jsversion default

r=shaver if this make-checks clean, thanks!
Attachment #305834 - Flags: review?(shaver) → review+
I suppose a followup bug could be filed to remove these lines:

http://mxr.mozilla.org/seamonkey/search?string=version(1&find=test_
Actually, I was pretty sure I was using let in other places without version..

http://mxr.mozilla.org/seamonkey/search?string=let&find=test_pluralForm_makeGetter.js

I think somewhere along the way the tests are being run with -v 170 ?
Sayrer added "... $xpcshell -v 180 ... " to tools/test-harness/xpcshell-simple/test_all.sh for bug 387522.

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/tools/test-harness/xpcshell-simple/test_all.sh&rev=1.13&mark=114#114

Would we need to remove that line and automatically use the latest version with the patch here?
Yeah, if a particular test wishes to remain on the latest version, then those version settings will need to be removed.  -v will override the setting I'm doing, as will version() in a script.
Comment on attachment 305834 [details] [diff] [review]
use a context callback to set error-reporter and jsversion default

I think that while this is not part of the browser-build, if it failed it would burn tboxes, so asking for approval.
Attachment #305834 - Flags: approval1.9?
Comment on attachment 305834 [details] [diff] [review]
use a context callback to set error-reporter and jsversion default

Yep, thanks -- a=shaver.
Attachment #305834 - Flags: approval1.9? → approval1.9+
Landed for rc1... I also removed the |-v 180|.

Checking in js/src/xpconnect/shell/xpcshell.cpp;
/cvsroot/mozilla/js/src/xpconnect/shell/xpcshell.cpp,v  <--  xpcshell.cpp
new revision: 1.109; previous revision: 1.108
done
Checking in tools/test-harness/xpcshell-simple/test_all.sh;
/cvsroot/mozilla/tools/test-harness/xpcshell-simple/test_all.sh,v  <--  test_all.sh
new revision: 1.14; previous revision: 1.13
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: