Closed Bug 807410 Opened 8 years ago Closed 8 years ago
Pass some things to the ns
JSContext constructor instead of using setters
SetGCOnDestruction and SetGlobalObject are only used right after we constructed the object. Making those constructor arguments makes that clearer.
Attachment #677075 - Flags: review?(jst)
Comment on attachment 677075 [details] [diff] [review] Part a: Global object - In class nsJSRuntime: - virtual already_AddRefed<nsIScriptContext> CreateContext(); + virtual already_AddRefed<nsIScriptContext> CreateContext(nsIScriptGlobalObject* aGlobalObject = nullptr); Why a default value? I'd much rather see callers of this being explicit.
Because only nsGlobalWindow passed one, but sure.
Comment on attachment 677075 [details] [diff] [review] Part a: Global object r=jst, but please remove the default argument and make the few callers of CreateContext() be explicit about what they want to pass in.
Attachment #677075 - Flags: review?(jst) → review+
Comment on attachment 677077 [details] [diff] [review] Part b: GC on destruction r=jst. Thanks for the patches!
Attachment #677077 - Flags: review?(jst) → review+
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.