Last Comment Bug 678998 - Make js_IsFunctionQName infallible, so that determining the nature of a property lookup is clearer
: Make js_IsFunctionQName infallible, so that determining the nature of a prope...
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla8
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-15 08:41 PDT by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-08-16 03:59 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
1 - Make the localName slot store an atom (9.11 KB, patch)
2011-08-15 08:44 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
luke: review+
Details | Diff | Splinter Review
2 - Rename js_IsFunctionQName and make it infallible (4.51 KB, patch)
2011-08-15 08:45 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
luke: review+
Details | Diff | Splinter Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-08-15 08:41:54 PDT
Property storage splitting will be clearer if a property lookup can be determined to be non-elemental (that is, obj[2]) and non-property (that is, obj["prop"]) without potential for failure.  It's fairly easy to do this -- just make sure that QName objects store an atom, not merely a string, in their localName slots.
Comment 1 Jeff Walden [:Waldo] (remove +bmo to email) 2011-08-15 08:44:22 PDT
Created attachment 553184 [details] [diff] [review]
1 - Make the localName slot store an atom
Comment 2 Jeff Walden [:Waldo] (remove +bmo to email) 2011-08-15 08:45:18 PDT
Created attachment 553185 [details] [diff] [review]
2 - Rename js_IsFunctionQName and make it infallible
Comment 3 Luke Wagner [:luke] 2011-08-15 11:50:14 PDT
Comment on attachment 553184 [details] [diff] [review]
1 - Make the localName slot store an atom

Review of attachment 553184 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsxml.cpp
@@ +2815,2 @@
>  static JSBool
>  IsFunctionQName(JSContext *cx, JSObject *qn, jsid *funidp)

You can unfallible-ize this function now, if you so choose.
Comment 4 Luke Wagner [:luke] 2011-08-15 11:51:45 PDT
Comment on attachment 553184 [details] [diff] [review]
1 - Make the localName slot store an atom

Review of attachment 553184 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsxml.cpp
@@ +2815,2 @@
>  static JSBool
>  IsFunctionQName(JSContext *cx, JSObject *qn, jsid *funidp)

Err, so you have :)
Comment 5 Jeff Walden [:Waldo] (remove +bmo to email) 2011-08-15 12:44:41 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/c6a3b64dcac0
http://hg.mozilla.org/integration/mozilla-inbound/rev/c36563ee6447

I should probably get in the habit of beginning patch sequences like this with an overview/prognosticating comment.  I did the same thing to Blake in the typed-array-initialization bug -- he made a comment on an earlier patch, I had it resolved in a later one.  :-)
Comment 6 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-08-16 03:59:53 PDT
http://hg.mozilla.org/mozilla-central/rev/c6a3b64dcac0
http://hg.mozilla.org/mozilla-central/rev/c36563ee6447

Note You need to log in before you can comment on or make changes to this bug.