@nativescript/core 9.1.1-next.1 → 9.1.2-next.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/core",
3
- "version": "9.1.1-next.1",
3
+ "version": "9.1.2-next.0",
4
4
  "description": "A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.",
5
5
  "type": "module",
6
6
  "main": "index",
package/references.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!CFNetwork.d.ts" />
3
3
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!CoreText.d.ts" />
4
4
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!Darwin.d.ts" />
5
+ /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!Security.d.ts" />
5
6
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!_DarwinFoundation1.d.ts" />
6
7
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!_DarwinFoundation2.d.ts" />
7
8
  /// <reference path="../types-ios/src/lib/ios/objc-x86_64/objc!_DarwinFoundation3.d.ts" />
@@ -21,10 +21,14 @@ export class Crypto {
21
21
  org.nativescript.winter_tc.Crypto.getRandomValues(bytes);
22
22
  }
23
23
  if (__IOS__) {
24
- // The pointer is V8-owned: freeWhenDone must stay NO, or Foundation and V8's
25
- // ArrayBufferSweeper both free the same allocation.
26
- const data = NSMutableData.dataWithBytesNoCopyLengthFreeWhenDone(bytes, bytes.byteLength, false);
27
- NSCCrypto.getRandomValues(data);
24
+ // The view goes to Security directly: the runtime hands over V8's backing store at
25
+ // the view's byte offset, so the bytes land in the caller's array. No NSData may
26
+ // sit in between — NSMutableData copies bytes it does not own, so a no-copy wrapper
27
+ // fills a private copy, and one that owns them frees V8's allocation.
28
+ const status = SecRandomCopyBytes(kSecRandomDefault, bytes.byteLength, bytes);
29
+ if (status !== errSecSuccess) {
30
+ throw new Error(`getRandomValues: SecRandomCopyBytes failed (${status})`);
31
+ }
28
32
  }
29
33
  return typedArray;
30
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/wgc/crypto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;AAClC,MAAM,OAAO,MAAM;IAClB,IAAI,MAAM;QACT,OAAO,MAAM,CAAC;IACf,CAAC;IACD,UAAU;QACT,IAAI,WAAW,EAAE,CAAC;YACjB,OAAa,GAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC9D,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC,UAAU,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC;IAED,eAAe,CAA6D,UAAa;QACxF,uFAAuF;QACvF,qFAAqF;QACrF,oCAAoC;QACpC,MAAM,KAAK,GAAG,UAAU,CAAC,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QAEhJ,IAAI,WAAW,EAAE,CAAC;YACX,GAAI,CAAC,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACb,6EAA6E;YAC7E,oDAAoD;YACpD,MAAM,IAAI,GAAG,aAAa,CAAC,qCAAqC,CAAC,KAAc,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAE1G,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAA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