Closed
Bug 243362
Opened 21 years ago
Closed 21 years ago
Copy Qualified name needs to do some escaping
Categories
(Other Applications Graveyard :: Venkman JS Debugger, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: bugzilla-mozilla-20000923)
Details
Attachments
(1 file)
2.85 KB,
patch
|
rginda
:
review+
|
Details | Diff | Splinter Review |
consider:
a={"test-case":0}
copy qualified name results in:
this.a.test-case
Caught exception: “SyntaxError: syntax error”
Assignee | ||
Comment 1•21 years ago
|
||
Since the Copy qualified Name function litterally just sticks the expression
into the clipboard, I think we need the escaping around line 799/808 in here:
http://lxr.mozilla.org/mozilla/source/extensions/venkman/resources/content/venkman-views.js#787
I would suggest anything that contains non-alphanumerics, or doesn't start with
a letter, should be escaped into a ["..."] format (with \" escaping). Would this
be suitable?
spidermonkey actually has a way to do this stuff. iirc brendan poked things that
messed up near the decompiler recently.
Comment 3•21 years ago
|
||
Not escaping, quoting and indexing (a["test-case"], not a.test-case). But since
Venkman is doing its own "decompiling", it will have to handle the
non-identifier case -- there's nothing SpiderMonkey can do to help here, short
of exposing native helper functions, which doesn't seem like a good trade to me.
/be
Comment 4•21 years ago
|
||
I've been away from this for a while, but what about just changing:
cx.expression = cur.displayName + "." + cx.expression;
to
cx.expression = cur.displayName + "[" + cx.expression.quote() + "]";
?
Assignee | ||
Comment 5•21 years ago
|
||
This changes the way cx.expression is generated so that items are escaped as
needed. It matches numbers (for foo[42]), 'words' (for foo.bar) and everything
else is fully escaped (for foo[".!%"]).
I also added support for the two ECMA properties, __proto__ and __parent__.
Assignee | ||
Updated•21 years ago
|
Attachment #150573 -
Flags: review?(rginda)
Comment 6•21 years ago
|
||
Comment on attachment 150573 [details] [diff] [review]
Escape expressions used for Copy Qual Name
r=rginda
Attachment #150573 -
Flags: review?(rginda) → review+
Comment 7•21 years ago
|
||
__proto__ and __parent__ are SpiderMonkey extensions, not part of ECMA-262.
/be
Assignee | ||
Comment 8•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Product: Core → Other Applications
Updated•7 years ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•