Closed Bug 1641961 Opened 4 years ago Closed 4 years ago

jstest harness: shell-option() works in jstests.list but not in |reftest| lines, for wonderful reason

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: jorendorff, Assigned: mgaudet)

References

Details

Attachments

(1 file)

To reproduce, make a file under js/src/tests/non262 that contains

// |reftest| shell-option(--enable-weak-refs)

reportCompare(0, 0, 'ok');

The super helpful error message is

Error: can't open : No such file or directory

This is because the command line being sent to the JS engine starts with $OBJDIR/dist/bin/js ''; note the empty argument.

This in turn is because -- in a |reftest| line is treated as the start of a comment, so what the option-parser sees is

// |reftest| shell-option(

This change from Andre seems to fix it:

https://hg.mozilla.org/try/diff/54da1cfd316816d86dd975348b6f2dcb9b077284/js/src/tests/lib/manifest.py

Having said that, I am not entirely sure what's going on here yet -- mostly because I'm slow at reading a regexp of that size and complexity!

The modified expression adds a negative look-behind before --, so that the comment part is no longer matched for (--.

Assignee: nobody → mgaudet
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P2
See Also: → 1643741
Pushed by mgaudet@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9a99486af033
Don't parse shell option as comment in shell directive line r=anba,jorendorff
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: