frida 17.8.1 → 17.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -749,6 +749,21 @@ export const LogLevel = binding.LogLevel;
749
749
  get isCancelled() {
750
750
  return this._isCancelled();
751
751
  }
752
+ static withTimeout(ms) {
753
+ const c = new Cancellable();
754
+ setTimeout(() => c.cancel(), ms).unref();
755
+ return c;
756
+ }
757
+ combine(other) {
758
+ const c = new Cancellable();
759
+ this.cancelled.connect(() => c.cancel());
760
+ other.cancelled.connect(() => c.cancel());
761
+ if (this.isCancelled)
762
+ c.cancel();
763
+ if (other.isCancelled)
764
+ c.cancel();
765
+ return c;
766
+ }
752
767
  }
753
768
  binding.Cancellable = Cancellable;
754
769
  binding.IOStream.prototype[inspect.custom] = function (depth, options) {
@@ -550,6 +550,8 @@ export class BaseObject {
550
550
 
551
551
  export class Cancellable extends _Cancellable {
552
552
  readonly isCancelled: boolean;
553
+ static withTimeout(ms: number): Cancellable;
554
+ combine(other: Cancellable): Cancellable;
553
555
  }
554
556
 
555
557
  export class _Cancellable extends BaseObject {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frida",
3
- "version": "17.8.1",
3
+ "version": "17.8.2",
4
4
  "authors": [
5
5
  "Frida Developers"
6
6
  ],
@@ -807,6 +807,31 @@ const assetRoot = params?.assetRoot ?? null;
807
807
  get isCancelled(): boolean {
808
808
  return this._isCancelled();
809
809
  }
810
+ """,
811
+ ),
812
+ CustomMethod(
813
+ typing="static withTimeout(ms: number): Cancellable",
814
+ code="""
815
+ static withTimeout(ms: number): Cancellable {
816
+ const c = new Cancellable();
817
+ setTimeout(() => c.cancel(), ms).unref();
818
+ return c;
819
+ }
820
+ """,
821
+ ),
822
+ CustomMethod(
823
+ typing="combine(other: Cancellable): Cancellable",
824
+ code="""
825
+ combine(other: Cancellable): Cancellable {
826
+ const c = new Cancellable();
827
+ this.cancelled.connect(() => c.cancel());
828
+ other.cancelled.connect(() => c.cancel());
829
+ if (this.isCancelled)
830
+ c.cancel();
831
+ if (other.isCancelled)
832
+ c.cancel();
833
+ return c;
834
+ }
810
835
  """,
811
836
  ),
812
837
  ],
@@ -1,6 +1,6 @@
1
1
  [wrap-git]
2
2
  url = https://github.com/frida/frida-core.git
3
- revision = 17.8.1
3
+ revision = 17.8.2
4
4
  depth = 1
5
5
 
6
6
  [provide]