Closed Bug 572991 Opened 12 years ago Closed 12 years ago

TM: replace JSXMLArray locals with autoclasses


(Core :: JavaScript Engine, enhancement)

Not set





(Reporter: igor, Assigned: igor)



(Whiteboard: fixed-in-tracemonkey)


(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) — 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) — 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]

>+        *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 v2Splinter Review
Here is the  patch with the nit addressed. For some reason I cannot push it ass I get:

pushing to ssh://
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
remote: ** or
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:   File "/usr/lib/python2.4/site-packages/mercurial/", line 16, in run
remote:     sys.exit(dispatch(sys.argv[1:]))
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 30, in dispatch
remote:     return _runcatch(u, args)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 50, in _runcatch
remote:     return _dispatch(ui, args)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 471, in _dispatch
remote:     return runcommand(lui, repo, cmd, fullargs, ui, options, d)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 341, in runcommand
remote:     ret = _runcommand(ui, options, cmd, d)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 522, in _runcommand
remote:     return checkargs()
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 476, in checkargs
remote:     return cmdfunc()
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 470, in <lambda>
remote:     d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 401, in check
remote:     return func(*args, **kwargs)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 2904, in serve
remote:     s.serve_forever()
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 45, in serve_forever
remote:     while self.serve_one():
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 57, in serve_one
remote:     impl()
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 208, in do_unbundle
remote:     r = self.repo.addchangegroup(fp, 'serve', self.client_url())
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 2120, in addchangegroup
remote:     url=url, pending=p)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", line 152, in hook
remote:     return hook.hook(self.ui, self, name, throw, **args)
remote:   File "/usr/lib/python2.4/site-packages/mercurial/", 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/", line 68, in _pythonhook
remote:     r = obj(ui=ui, repo=repo, hooktype=name, **args)
remote:   File "/usr/lib/python2.4/site-packages/mozhghooks/", 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
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.