Closed Bug 548341 Opened 15 years ago Closed 15 years ago

API for privileged access to internals

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: dherman, Assigned: dherman)

Details

Attachments

(1 file, 1 obsolete file)

API's such as ephemeron tables (see bug #547941) need to hide access to internal information that's nonetheless necessary to expose for testing. Propose a simple drop-box API for any special privileged observations that should be conditionally compiled in only for the test harness. Simple patch with boilerplate forthcoming.
Attached patch boilerplate for Internals API (obsolete) — Splinter Review
Attachment #428754 - Flags: review?(brendan)
Comment on attachment 428754 [details] [diff] [review] boilerplate for Internals API Not sure this helps if we have to --enable-internals for shell builds. Is that on by default? Andreas should review. Please fix copied Netscape 1998 license comment boilerplate to use Mozilla Foundation and current year -- exact details matter, again Andreas knows (thanks to Reed, our anal-retentive license comment policy gourmet). /be
Attachment #428754 - Flags: review?(brendan) → review?(gal)
My thought was that it should only be enabled for running tests, but not for public users of the shell and certainly not in the browser. Tests can object-detect and disable themselves: if (Internals) { // run the test... } so at least that way we can avoid death when JS_HAS_INTERNALS is #ifdef'ed off. I'll fix the license ASAP and resubmit the patch.
corrected license, a couple trivial cleanups
Attachment #428754 - Attachment is obsolete: true
Attachment #428762 - Flags: review?(gal)
Attachment #428754 - Flags: review?(gal)
This isn't worth it. The shell already has lots of these kinds of extra observations implemented in the global object in js.cpp; we can just keep doing that. That's what we should do for bug #547941, too. Dave
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
(In reply to comment #3) > My thought was that it should only be enabled for running tests, but not for > public users of the shell and certainly not in the browser. Tests can > object-detect and disable themselves: > > if (Internals) { > // run the test... > } if (this.Internals), of course ;-). Yeah, I did not point out the shell testing hacks we've added over the years, since your approach here seemed better for embeddings other than the shell that might also want "internals". But we can keep hacking the shell. /be
Attachment #428762 - Flags: review?(gal)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: