Bug 1797724 - Part 3: Avoid unnecessary rooting in intrinsic_CreateAsyncFromSyncIterator. r=mgaudet

Part 8 will actually remove the entire method.

Depends on D160476

Differential Revision: https://phabricator.services.mozilla.com/D160477
This commit is contained in:
André Bargull committed 2022-10-31 09:38:41 +00:00
1 parent 658220785c
commit 116423346d
1 file changed
+4 -5
+4 -5
View File
@@ -849,13 +849,12 @@ bool js::intrinsic_CreateAsyncFromSyncIterator(JSContext* cx, unsigned argc,
Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 2);
MOZ_ASSERT(args.get(0).isObject());
MOZ_ASSERT(args[0].isObject());
RootedObject iter(cx, &args.get(0).toObject());
RootedValue nextMethod(cx, args.get(1));
RootedObject iter(cx, &args[0].toObject());
HandleValue nextMethod = args[1];
RootedObject syncIter(cx,
js::CreateAsyncFromSyncIterator(cx, iter, nextMethod));
JSObject* syncIter = js::CreateAsyncFromSyncIterator(cx, iter, nextMethod);
if (!syncIter) {
return false;
}