Closed Bug 918462 Opened 7 years ago Closed 7 years ago

Replace JS_IsConstructing() body with CallReceiver

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file, 2 obsolete files)

I think I missed this in bug 890076.
Depends on: 890076
I *think* these are the same. Glad we have review.
Attachment #807366 - Flags: review?(jwalden+bmo)
Comment on attachment 807366 [details] [diff] [review]
Replace JS_IsConstructing() body with CallReceiver

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

Let's just remove JS_IsConstructing at this point.
Attachment #807366 - Flags: review?(jwalden+bmo)
Works for me.
Attachment #807401 - Flags: review?(jwalden+bmo)
Attachment #807366 - Attachment is obsolete: true
Comment on attachment 807401 [details] [diff] [review]
Replace JS_IsConstructing() body with CallReceiver

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

Please update the relevant bits of https://developer.mozilla.org/en-US/docs/SpiderMonkey/31 and https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_IsConstructing for this change.

::: js/src/jsapi-tests/testNewObject.cpp
@@ +21,2 @@
>  
>      JS::RootedObject obj(cx, JS_NewObjectForConstructor(cx, js::Jsvalify(&JSObject::class_), vp));

This can/should use JS_NewObject(cx, js::Jsvalify(&JSObject::class_), NULL, NULL) to get rid of the vp usage.

@@ +32,1 @@
>          JS_ReportError(cx, "test failed, argc == %d", argc);

Use args.length() here as well.

@@ +47,5 @@
>          return false;
>  
> +    args.rval().setObject(*obj);
> +
> +    // trash the argv, perversely

"You are not expected to understand this."?

@@ +50,5 @@
> +
> +    // trash the argv, perversely
> +    args[0].set(JSVAL_VOID);
> +    args[1].set(JSVAL_VOID);
> +    args[2].set(JSVAL_VOID);

Use setUndefined() for these.
Attachment #807401 - Flags: review?(jwalden+bmo) → review+
Keywords: checkin-needed
Uploading the final version because I don't want to wait for the tree to reopen.
Attachment #807401 - Attachment is obsolete: true
Comment on attachment 807515 [details] [diff] [review]
Replace JS_IsConstructing() body with CallReceiver,

Carry over the r+.
Attachment #807515 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/ad8143279d00
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.