Closed
Bug 169000
Opened 22 years ago
Closed 21 years ago
Write a wrapper library to access XPConnect native wrapped objects from within chrome JS
Categories
(SeaMonkey :: UI Design, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: caillon, Assigned: caillon)
References
Details
Attachments
(1 file, 2 obsolete files)
5.43 KB,
patch
|
jag+mozilla
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
I've fussed over this making it better and better. I think we're ready for prime time. Patch to follow.
Assignee | ||
Comment 1•22 years ago
|
||
Comment 2•22 years ago
|
||
Looks good. Get input from some other folks, perhaps blake, I'm sure Phoenix can (and should) use this.
Assignee | ||
Comment 3•22 years ago
|
||
I had rginda have a look at this from a JS standpoint. This fixes his issues: - Checks the exception for the one we want to eat, throws all others. - return null instead of undefined; undefined can be assigned to, null can't. - small optimization in getNativePropertyProxyFor() - remove unnecessary consts in _getNativesForProp()
Attachment #99392 -
Attachment is obsolete: true
Comment 4•22 years ago
|
||
Comment on attachment 99450 [details] [diff] [review] nativeDOM.js v.1.1 sr=jag
Attachment #99450 -
Flags: superreview+
Comment 5•22 years ago
|
||
Talking with jag on IRC, we came to the conclusion that an XPCOMProxy object would be a better idea. Clients would say something like... var proxy = new XPCOMProxy (obj); // create getter/setter pairs for these property names. proxy.fetch ("foo", "bar", ...); // for..in over this object, creating properties for each key found. property.fetch (Components.interfaces.nsIFoo);
Assignee | ||
Comment 6•22 years ago
|
||
Comment on attachment 99450 [details] [diff] [review] nativeDOM.js v.1.1 I have this working, but waiting on changes in bug 169321 to land first, since this relies on that.
Attachment #99450 -
Flags: needs-work+
Assignee | ||
Comment 7•22 years ago
|
||
Oh, there is a workaround for that bug that brendan mentioned. I'll attach a patch anyway either later tonight or tomorrow morning that implements rginda's suggestion. I'd prefer to do this though with the fix in bug 169321.
Comment 8•22 years ago
|
||
I'm missing the motivation here -- can someone give a pep-talk? /be
Assignee | ||
Comment 9•22 years ago
|
||
Responded to Brendan via private e-mail.
Assignee | ||
Comment 10•22 years ago
|
||
Implements the syntax proposal from rginda and jag.
Attachment #99450 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Attachment #107789 -
Flags: superreview?(jst)
Attachment #107789 -
Flags: review?(jaggernaut)
Comment 11•22 years ago
|
||
Comment on attachment 107789 [details] [diff] [review] Updated patch sr=jst
Attachment #107789 -
Flags: superreview?(jst) → superreview+
Comment 12•21 years ago
|
||
+ var ary = aName.match(/([^(]*)(\(\))?$/); + var name = ary[1]; + + // If we are passed a string like "foo()", ary[2] will be of type string, + // and contain "()". If passed "foo", then it will be of type undefined. + if (typeof ary[2] === "string") + this._doImportMethod(name); + else + this._doImportProperty(name); IMHO this is very ugly. if (name.slice(-2) == "()") this._doImportMethod(name.slice(0, -2)); else this._doImportProperty(name);
Comment 13•21 years ago
|
||
Comment on attachment 107789 [details] [diff] [review] Updated patch Fix Neil's nit and r=jag
Attachment #107789 -
Flags: review?(jaggernaut) → review+
Comment 14•21 years ago
|
||
Unless of course the regexp is faster than two slices.
Comment 15•21 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•