queryObjects method

Future<JsHandle> queryObjects(
  1. JsHandle prototypeHandle
)

The method iterates the JavaScript heap and finds all the objects with the given prototype.

Implementation

Future<JsHandle> queryObjects(JsHandle prototypeHandle) async {
  if (prototypeHandle.isDisposed) {
    throw Exception('Prototype JSHandle is disposed!');
  }
  if (prototypeHandle.remoteObject.objectId == null) {
    throw Exception(
        'Prototype JSHandle must not be referencing primitive value');
  }
  var response =
      await runtimeApi.queryObjects(prototypeHandle.remoteObject.objectId!);

  return _createHandle(response);
}