Last Comment Bug 671091 - Add DefinePropertiesAndBrand to consolidate branding with defining properties/methods
: Add DefinePropertiesAndBrand to consolidate branding with defining properties...
Status: RESOLVED FIXED
:
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-07-12 14:47 PDT by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2011-07-14 14:14 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (4.07 KB, patch)
2011-07-12 14:47 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
bhackett1024: review+
Details | Diff | Splinter Review

Description Jeff Walden [:Waldo] (remove +bmo to email) 2011-07-12 14:47:22 PDT
Created attachment 545490 [details] [diff] [review]
Patch
Comment 1 Brian Hackett (:bhackett) 2011-07-12 20:31:55 PDT
Comment on attachment 545490 [details] [diff] [review]
Patch

Review of attachment 545490 [details] [diff] [review]:
-----------------------------------------------------------------
Comment 2 Brian Hackett (:bhackett) 2011-07-12 20:36:23 PDT
Comment on attachment 545490 [details] [diff] [review]
Patch

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

::: js/src/jsobj.cpp
@@ +3834,5 @@
>              ctor->setProto(proto);
>      }
>  
> +    if (!DefinePropertiesAndBrand(cx, proto, ps, fs) ||
> +        (ctor != proto && !DefinePropertiesAndBrand(cx, ctor, static_ps, static_fs)))

Might want to assert that (ctor == proto) implies no static_ps or static_fs.
Comment 3 Jeff Walden [:Waldo] (remove +bmo to email) 2011-07-13 11:25:02 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/800657b3354b

The JS_InitClass code path is eventually going to be moved into jsapi.cpp, so making changes here is a pain to bubble through my mq.  Perhaps I'll add this after that move happens.
Comment 4 Dão Gottwald [:dao] 2011-07-13 12:58:08 PDT
(In reply to comment #3)
> http://hg.mozilla.org/integration/mozilla-inbound/rev/800657b3354b

That commit massage is kind of broken...
Comment 6 Jeff Walden [:Waldo] (remove +bmo to email) 2011-07-13 15:45:54 PDT
Gaaaah...

I had a pre-push hook that would prevent me from pushing things like that, in the distant past.  I disabled it when I couldn't figure out a way to make it allow pushes to try, but disallow pushes elsewhere.  :-(  I should probably complain to hg people about that and figure out some sort of way to make it do what I want for try and for non-try.
Comment 7 :Ehsan Akhgari 2011-07-14 14:14:22 PDT
(In reply to comment #6)
> Gaaaah...
> 
> I had a pre-push hook that would prevent me from pushing things like that, in
> the distant past.  I disabled it when I couldn't figure out a way to make it
> allow pushes to try, but disallow pushes elsewhere.  :-(  I should probably
> complain to hg people about that and figure out some sort of way to make it do
> what I want for try and for non-try.

Been there, done that!  ;-)

http://mercurial.selenic.com/bts/issue2859

It practically means that you can't write such a hook... :(

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