Closed Bug 572991 Opened 14 years ago Closed 14 years ago

TM: replace JSXMLArray locals with autoclasses

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

For the bug 519949 we need to root explicitly the elements stored in JSXMLArray instances declared as local variables. Replacing that usage with an autoclass seems the simplest thing to do. gal: would you work on this?
I have a very full plate atm, but this is blocking my work, so I will have to do it if nobody else steps forward.
Assignee: general → igor
Attached patch v1 (obsolete) (deleted) — Splinter Review
There were already an auto class to root a namespace array, AutoNamespaceArray. That class extends from an intermediate helper AutoNamespaces. I suppose that was done this way to get access to static JSXMLArray functions from jsxml.cpp. To avoid this complexity I turned few relevant functions into JSXMLArray methods which removed the need to have AutoNamespaces. Then the patch consistently uses AutoNamespaceArray when currently the code declares JSXMLArray* locals.
Attachment #452260 - Flags: review?
Attached patch v1 (obsolete) (deleted) — Splinter Review
Now comes a right patch
Attachment #452260 - Attachment is obsolete: true
Attachment #452261 - Flags: review?
Attachment #452260 - Flags: review?
Attachment #452261 - Flags: review? → review?(gal)
Comment on attachment 452261 [details] [diff] [review] v1 >+ *tvr.addr() = OBJECT_TO_JSVAL(ns); I think there is tvr.setObject(). Thanks a lot for doing this.
Attachment #452261 - Flags: review?(gal) → review+
Attached patch v2 (deleted) — Splinter Review
Here is the patch with the nit addressed. For some reason I cannot push it ass I get: pushing to ssh://hg.mozilla.org/tracemonkey searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 4 changes to 4 files remote: error: pretxnchangegroup.z_linearhistory hook raised an exception: column rev is not unique remote: transaction abort! remote: rollback completed remote: ** unknown exception encountered, details follow remote: ** report bug details to http://mercurial.selenic.com/bts/ remote: ** or mercurial@selenic.com remote: ** Python 2.4.3 (#1, Jun 11 2009, 14:09:58) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] remote: ** Mercurial Distributed SCM (version 1.5.4) remote: ** Extensions loaded: hgwebjson, pushlog-feed, buglink remote: Traceback (most recent call last): remote: File "/usr/bin/hg", line 27, in ? remote: mercurial.dispatch.run() remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 16, in run remote: sys.exit(dispatch(sys.argv[1:])) remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 30, in dispatch remote: return _runcatch(u, args) remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 50, in _runcatch remote: return _dispatch(ui, args) remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 471, in _dispatch remote: return runcommand(lui, repo, cmd, fullargs, ui, options, d) remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 341, in runcommand remote: ret = _runcommand(ui, options, cmd, d) remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 522, in _runcommand remote: return checkargs() remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 476, in checkargs remote: return cmdfunc() remote: File "/usr/lib/python2.4/site-packages/mercurial/dispatch.py", line 470, in <lambda> remote: d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) remote: File "/usr/lib/python2.4/site-packages/mercurial/util.py", line 401, in check remote: return func(*args, **kwargs) remote: File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line 2904, in serve remote: s.serve_forever() remote: File "/usr/lib/python2.4/site-packages/mercurial/sshserver.py", line 45, in serve_forever remote: while self.serve_one(): remote: File "/usr/lib/python2.4/site-packages/mercurial/sshserver.py", line 57, in serve_one remote: impl() remote: File "/usr/lib/python2.4/site-packages/mercurial/sshserver.py", line 208, in do_unbundle remote: r = self.repo.addchangegroup(fp, 'serve', self.client_url()) remote: File "/usr/lib/python2.4/site-packages/mercurial/localrepo.py", line 2120, in addchangegroup remote: url=url, pending=p) remote: File "/usr/lib/python2.4/site-packages/mercurial/localrepo.py", line 152, in hook remote: return hook.hook(self.ui, self, name, throw, **args) remote: File "/usr/lib/python2.4/site-packages/mercurial/hook.py", line 139, in hook remote: r = _pythonhook(ui, repo, name, hname, hookfn, args, throw) or r remote: File "/usr/lib/python2.4/site-packages/mercurial/hook.py", line 68, in _pythonhook remote: r = obj(ui=ui, repo=repo, hooktype=name, **args) remote: File "/usr/lib/python2.4/site-packages/mozhghooks/pushlog.py", line 56, in log remote: (pushid, ctx.rev(), hex(ctx.node()))) remote: pysqlite2.dbapi2.IntegrityError: column rev is not unique abort: unexpected response: empty string
Attachment #452261 - Attachment is obsolete: true
Attachment #452480 - Flags: review+
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: