Open Bug 794328 Opened 13 years ago Updated 9 months ago

Beef up shell help()

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: sfink, Assigned: sfink)

References

(Blocks 1 open bug)

Details

(Whiteboard: [js:p3])

Attachments

(1 file)

Given my extremely weak familiarity with Javascript, I'm getting extremely jealous of the python shell's ability to show useful help. For example, I'd really like help([]) to give me a list of the things that Arrays know how to do.
This is one incomplete, general approach to it. It just dumps out all of properties of what you pass it. It'll display the .usage and .help on anything it finds (horribly formatted). Vague later ideas include having the shell load in a ~/.jsrc or something, which could have a bunch of Array.prototype.join.usage = "obj.join(str)"; Array.prototype.join.help = "smushes together array elements, see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/join" or something. I'd also like it to support .help properties on other objects. I know the JS shell is only meant for testing, but it's my primary way of interacting with Javascript.
Whiteboard: [js:p3]
Severity: normal → S3
Blocks: sm-shell
Severity: S3 → N/A
Type: defect → enhancement
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: