@bake-native/core 0.0.0 → 0.1.0-rc.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/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.txt +548 -0
- package/bake-prelude.js +189 -0
- package/batch-contract.json +21 -0
- package/batch-wire.js +674 -0
- package/compat.json +64 -0
- package/controls.css +108 -0
- package/determinism.js +175 -0
- package/devtools.d.ts +13 -0
- package/devtools.js +73 -0
- package/dialogs.js +59 -0
- package/direct-style.js +105 -0
- package/direct-table.js +261 -0
- package/dist/bake.mjs +2211 -0
- package/dist/build-CMsvCcZ0.mjs +1 -0
- package/dist/build-CkLSZw06.mjs +5514 -0
- package/dist/build-tools-Dxyl6XAf.mjs +80 -0
- package/dist/client-Cm7o6dQd.mjs +17544 -0
- package/dist/compiler.mjs +4 -0
- package/dist/config-B1W8gfZY.mjs +12 -0
- package/dist/dev-Cskd8Hl4.mjs +986 -0
- package/dist/direct-report-Bdda-k_Y.mjs +153 -0
- package/dist/direct-report-Du44nNWl.mjs +1 -0
- package/dist/index.d.mts +176 -0
- package/dist/index.mjs +1 -0
- package/dist/intl-ROnAp2qO.mjs +75 -0
- package/dist/jiti-stub-CKcaShwE.mjs +5 -0
- package/dist/native-views-BuzB9x5H.mjs +7849 -0
- package/dist/octane/package.json +5 -0
- package/dist/package-KkUSMoji.mjs +2784 -0
- package/dist/react/package.json +13 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-D2aPm54a.mjs +6632 -0
- package/dist/scope-8W2aIuQ9.mjs +262 -0
- package/dist/screens/BakeNativeScreen.native.ts +9 -0
- package/dist/screens/package.json +5 -0
- package/dom-exception.js +31 -0
- package/element-api.js +158 -0
- package/first-screen.js +30 -0
- package/fonts/Geist-Italic-Variable.ttf +0 -0
- package/fonts/Geist-Variable.ttf +0 -0
- package/fonts/GeistMono-Italic-Variable.ttf +0 -0
- package/fonts/GeistMono-Variable.ttf +0 -0
- package/fonts/OFL.txt +93 -0
- package/fonts/README.md +27 -0
- package/fonts/geist-italic.css +8 -0
- package/fonts/geist-mono-italic.css +8 -0
- package/fonts/geist-mono.css +8 -0
- package/fonts/geist.css +8 -0
- package/header-icons.json +53 -0
- package/host-runtime.js +508 -0
- package/image-props.js +17 -0
- package/index.d.ts +8 -0
- package/index.js +7 -0
- package/licenses/Apache-2.0.txt +73 -0
- package/locale-entry.d.ts +1 -0
- package/locale-entry.js +1 -0
- package/locale.d.ts +28 -0
- package/locale.js +124 -0
- package/markup-support.js +87 -0
- package/media-element.js +115 -0
- package/native-args-entry.js +2 -0
- package/native-args.d.ts +7 -0
- package/native-args.js +155 -0
- package/native-entry.js +1 -0
- package/native-globals.d.ts +156 -0
- package/native-scenarios.d.ts +17 -0
- package/native-scenarios.js +46 -0
- package/native-support.json +349 -0
- package/native.d.ts +52 -0
- package/native.js +237 -0
- package/package.json +142 -4
- package/page-elements.js +123 -0
- package/runtime-provides.json +412 -0
- package/safe-area.d.ts +1 -0
- package/safe-area.js +44 -0
- package/swift-ui/modifiers.js +164 -0
- package/tab-icons.js +62 -0
- package/templates/create/tabs/AGENTS.md +22 -0
- package/templates/create/tabs/README.md +43 -0
- package/templates/create/tabs/_gitignore +13 -0
- package/templates/create/tabs/android/app/build.gradle.kts +79 -0
- package/templates/create/tabs/android/app/src/main/AndroidManifest.xml +39 -0
- package/templates/create/tabs/android/app/src/main/kotlin/MainActivity.kt +35 -0
- package/templates/create/tabs/android/app/src/main/res/values/themes.xml +8 -0
- package/templates/create/tabs/android/build.gradle.kts +5 -0
- package/templates/create/tabs/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/create/tabs/android/gradle/wrapper/gradle-wrapper.properties +9 -0
- package/templates/create/tabs/android/gradle.properties +3 -0
- package/templates/create/tabs/android/gradlew +248 -0
- package/templates/create/tabs/android/settings.gradle.kts +47 -0
- package/templates/create/tabs/bake.config.ts +10 -0
- package/templates/create/tabs/ios/App/App.swift +30 -0
- package/templates/create/tabs/ios/build.sh +23 -0
- package/templates/create/tabs/ios/project.yml +57 -0
- package/templates/create/tabs/macos/Package.swift +24 -0
- package/templates/create/tabs/macos/Sources/__SWIFT_NAME__/App.swift +146 -0
- package/templates/create/tabs/macos/build.sh +4 -0
- package/templates/create/tabs/package.json +23 -0
- package/templates/create/tabs/pnpm-workspace.yaml +6 -0
- package/templates/create/tabs/src/App.tsrx +92 -0
- package/templates/create/tabs/src/App.tsx +67 -0
- package/templates/create/tabs/src/styles.css +32 -0
- package/templates/create/tabs/tsconfig.json +5 -0
- package/templates/create/tabs/windows/Cargo.toml +29 -0
- package/templates/create/tabs/windows/build.rs +9 -0
- package/templates/create/tabs/windows/src/main.rs +52 -0
- package/templates/create/tabs/windows/src/shell.rs +316 -0
- package/templates/module/__NAME__.kt +20 -0
- package/templates/module/__NAME__.native.ts +24 -0
- package/templates/module/__NAME__.swift +25 -0
- package/templates/module/__NAME__.web.ts +13 -0
- package/templates/module/__NAME__Test.kt +26 -0
- package/templates/module/__NAME__Tests.swift +25 -0
- package/templates/module/__SNAKE__.rs +43 -0
- package/text.d.ts +20 -0
- package/text.js +100 -0
- package/transform-entry.js +1 -0
- package/transform.d.ts +15 -0
- package/transform.js +98 -0
- package/tsconfig.native.json +16 -0
- package/ui/scope.js +103 -0
- package/ui/swift.js +106 -0
- package/ui/ui.css +272 -0
- package/view-ref-writer.js +268 -0
- package/view-ref.d.ts +26 -0
- package/view-ref.js +85 -0
- package/views/Video.native.ts +68 -0
- package/views/generated/VideoViewAndroid.h +68 -0
- package/views/generated/VideoViewJSI.h +94 -0
- package/views/generated/VideoViewSpec.kt +113 -0
- package/views/generated/apple/VideoViewJSI/VideoViewJSIApple.cpp +40 -0
- package/views/generated/apple/VideoViewJSI/include/VideoViewJSIApple.h +28 -0
- package/views/generated/apple/VideoViewSpec/VideoViewInterop.swift +39 -0
- package/views/generated/apple/VideoViewSpec/VideoViewSpec.swift +186 -0
- package/views/generated/video_view_spec.rs +189 -0
- package/views.d.ts +24 -0
- package/views.js +45 -0
- package/virtual-window.js +35 -0
- package/visibility.js +75 -0
- package/web-crypto.js +84 -0
- package/web-fetch.js +1071 -0
- package/README.md +0 -3
package/views.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Native views (docs/design/native-views.md): the runtime half of the components
|
|
2
|
+
// `bake native view gen` writes. A view's ref methods (its spec's commands) go through
|
|
3
|
+
// `viewCommand`:
|
|
4
|
+
//
|
|
5
|
+
// web the element's own method (the custom element implements the command)
|
|
6
|
+
// native the JSI host function the host installs from the generated glue
|
|
7
|
+
// (`native.$views.<View>.<command>(node, ...args)`, <Name>ViewJSI.h): the host hops to
|
|
8
|
+
// main once, runs the command on the node's view (queued until the view is attached),
|
|
9
|
+
// and settles the Promise
|
|
10
|
+
//
|
|
11
|
+
// Errors carry `code`: E_DETACHED (the view is gone), E_UNAVAILABLE (this host does not
|
|
12
|
+
// implement the view: a fail-closed build should have refused the bundle), plus whatever the
|
|
13
|
+
// implementation rejects with.
|
|
14
|
+
|
|
15
|
+
function error(message, code) {
|
|
16
|
+
const err = new Error(message);
|
|
17
|
+
err.code = code;
|
|
18
|
+
return err;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Runs command `command` of view `view` on the element / node handle `el` (the component's ref)
|
|
23
|
+
* with `args`. Always a Promise.
|
|
24
|
+
*/
|
|
25
|
+
export function viewCommand(el, view, command, args) {
|
|
26
|
+
if (el == null) return Promise.reject(error(`${view}.${command}: the view is not mounted (or was removed)`, 'E_DETACHED'));
|
|
27
|
+
if (import.meta.env?.BAKE_TARGET === 'web' || typeof el.id !== 'number') {
|
|
28
|
+
const fn = el[command];
|
|
29
|
+
if (typeof fn !== 'function') return Promise.reject(error(`${view}.${command}: <${el.localName ?? 'element'}> has no such method (is its web implementation registered?)`, 'E_UNAVAILABLE'));
|
|
30
|
+
try {
|
|
31
|
+
return Promise.resolve(fn.apply(el, args));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return Promise.reject(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const fn = globalThis.native?.$views?.[view]?.[command];
|
|
37
|
+
if (typeof fn !== 'function') {
|
|
38
|
+
return Promise.reject(error(`${view}.${command}: this host does not implement the ${view} view (its build registration links only the views the bundle uses: rebuild the app)`, 'E_UNAVAILABLE'));
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
return Promise.resolve(fn(el.id, ...args));
|
|
42
|
+
} catch (e) {
|
|
43
|
+
return Promise.reject(e);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Which row each slot of a VirtualList shows, for a scroll offset. The one formula JS
|
|
2
|
+
// (list.tsrx) and every host (the `VirtualList` op record: UIKit, AppKit, Android, Windows)
|
|
3
|
+
// apply, so a host can place the slots in the scroll's own frame and JS's commit only fills
|
|
4
|
+
// their content. Pinned across languages by native/rust/schema/tests/virtual_list_vectors.json
|
|
5
|
+
// (virtual-window.test.mjs writes and checks it; the Rust, Swift and Kotlin twins read it).
|
|
6
|
+
|
|
7
|
+
/** First row of the rendered window: the rows from `pad = height * overscan` above the viewport,
|
|
8
|
+
* at most `count - pool` (at the end of the list every slot keeps a row, so a fling back up from
|
|
9
|
+
* the bottom has slots to move). */
|
|
10
|
+
export function virtualFirst(scrollY, top, height, itemHeight, overscan, count, pool) {
|
|
11
|
+
const vh = height || 800;
|
|
12
|
+
const pad = vh * overscan;
|
|
13
|
+
const first = Math.floor((scrollY - top - pad) / itemHeight);
|
|
14
|
+
return Math.max(0, Math.min(first, count - pool));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** One past the last row the window spans: the viewport and `pad` below it, in [0, count]. */
|
|
18
|
+
export function virtualLast(scrollY, top, height, itemHeight, overscan, count) {
|
|
19
|
+
const vh = height || 800;
|
|
20
|
+
const pad = vh * overscan;
|
|
21
|
+
return Math.max(0, Math.min(count, Math.ceil((scrollY - top + vh + pad) / itemHeight)));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Slots in the pool: enough for the window plus two (it only grows, as the list keeps it). */
|
|
25
|
+
export function virtualPool(height, itemHeight, overscan, previous) {
|
|
26
|
+
const vh = height || 800;
|
|
27
|
+
const pad = vh * overscan;
|
|
28
|
+
return Math.max(previous, Math.ceil((vh + 2 * pad) / itemHeight) + 2);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Row slot `slot` shows when the window starts at `first`: the one in [first, first + pool)
|
|
32
|
+
* congruent to the slot modulo the pool. */
|
|
33
|
+
export function virtualSlotRow(first, slot, pool) {
|
|
34
|
+
return first + (((slot - (first % pool)) % pool) + pool) % pool;
|
|
35
|
+
}
|
package/visibility.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Page Visibility on the native targets: `document.visibilityState`, `document.hidden` and the
|
|
2
|
+
// `visibilitychange` event, driven by the host. Each host sends the internal host event
|
|
3
|
+
// `__bakeVisibility` ("visible" / "hidden") when the app goes to the background or comes back (iOS:
|
|
4
|
+
// UIApplication, macOS: window occlusion, Android: the view's window visibility, Windows:
|
|
5
|
+
// minimize), as the web does for a tab.
|
|
6
|
+
//
|
|
7
|
+
// The first render always sees "visible": host events reach JS only after the first commit (the
|
|
8
|
+
// runtime replays what came earlier), so a baked first screen and the device's first render agree.
|
|
9
|
+
//
|
|
10
|
+
// `bake build` rewrites `document.visibilityState`, `document.hidden`,
|
|
11
|
+
// `document.addEventListener` and `document.removeEventListener` to `globalThis.__bakeDocument`
|
|
12
|
+
// and bundles this file only when the app names one. Event types other than `visibilitychange`
|
|
13
|
+
// are a build error when written as a literal (fail-closed.mjs, document-event) and a TypeError
|
|
14
|
+
// here otherwise.
|
|
15
|
+
|
|
16
|
+
export const VISIBILITY_EVENT = '__bakeVisibility';
|
|
17
|
+
|
|
18
|
+
/** Installs `g.__bakeDocument`; `hostListeners`: the host event listeners (host-runtime.js). */
|
|
19
|
+
export function installVisibility(g, hostListeners) {
|
|
20
|
+
let state = 'visible';
|
|
21
|
+
// { fn, capture, once } in the order added, as the DOM keeps them.
|
|
22
|
+
let listeners = [];
|
|
23
|
+
const capture = (options) => (typeof options === 'boolean' ? options : !!options?.capture);
|
|
24
|
+
const check = (type, what) => {
|
|
25
|
+
if (type !== 'visibilitychange') {
|
|
26
|
+
throw new TypeError(`document.${what}('${type}'): native targets have only the 'visibilitychange' event on document`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const doc = {
|
|
31
|
+
get visibilityState() { return state; },
|
|
32
|
+
get hidden() { return state === 'hidden'; },
|
|
33
|
+
addEventListener(type, fn, options) {
|
|
34
|
+
check(type, 'addEventListener');
|
|
35
|
+
if (fn == null) return;
|
|
36
|
+
const c = capture(options);
|
|
37
|
+
if (listeners.some((l) => l.fn === fn && l.capture === c)) return;
|
|
38
|
+
listeners.push({ fn, capture: c, once: typeof options === 'object' && !!options?.once });
|
|
39
|
+
},
|
|
40
|
+
removeEventListener(type, fn, options) {
|
|
41
|
+
check(type, 'removeEventListener');
|
|
42
|
+
const c = capture(options);
|
|
43
|
+
listeners = listeners.filter((l) => !(l.fn === fn && l.capture === c));
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const change = (payload) => {
|
|
48
|
+
if ((payload !== 'visible' && payload !== 'hidden') || payload === state) return;
|
|
49
|
+
state = payload;
|
|
50
|
+
let stopped = false;
|
|
51
|
+
const event = {
|
|
52
|
+
type: 'visibilitychange', target: doc, currentTarget: doc, bubbles: true, cancelable: false,
|
|
53
|
+
defaultPrevented: false, eventPhase: 2, timeStamp: g.performance?.now?.() ?? 0,
|
|
54
|
+
preventDefault() {}, stopPropagation() {}, stopImmediatePropagation() { stopped = true; },
|
|
55
|
+
};
|
|
56
|
+
// A listener added while dispatching waits for the next change; one removed does not run.
|
|
57
|
+
for (const l of [...listeners]) {
|
|
58
|
+
if (stopped) break;
|
|
59
|
+
if (!listeners.includes(l)) continue;
|
|
60
|
+
if (l.once) listeners = listeners.filter((x) => x !== l);
|
|
61
|
+
try {
|
|
62
|
+
if (typeof l.fn === 'function') l.fn.call(doc, event); else l.fn.handleEvent(event);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
g.console?.error?.(e);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
event.currentTarget = null;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
let set = hostListeners.get(VISIBILITY_EVENT);
|
|
71
|
+
if (!set) hostListeners.set(VISIBILITY_EVENT, (set = new Set()));
|
|
72
|
+
set.add(change);
|
|
73
|
+
Object.defineProperty(g, '__bakeDocument', { value: doc, writable: true, configurable: true, enumerable: false });
|
|
74
|
+
return doc;
|
|
75
|
+
}
|
package/web-crypto.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// `crypto.getRandomValues()` and `crypto.randomUUID()` on the native targets (W3C Web
|
|
2
|
+
// Cryptography API, as Chromium ships them). The bytes come from the OS CSPRNG through the core:
|
|
3
|
+
// `__bakeRandomWords(count)` (bake-runtime random.rs: arc4random_buf on Apple and Android,
|
|
4
|
+
// BCryptGenRandom on Windows). Nothing is generated or seeded in JS, and every call asks the OS.
|
|
5
|
+
//
|
|
6
|
+
// Errors are the web's: a non-view argument is a TypeError, a float array or DataView a
|
|
7
|
+
// DOMException TypeMismatchError, more than 65536 bytes a QuotaExceededError, and a method called
|
|
8
|
+
// on anything but `crypto` a TypeError (Illegal invocation). `crypto.subtle` is a build error
|
|
9
|
+
// (fail-closed.mjs); at run time it is undefined.
|
|
10
|
+
//
|
|
11
|
+
// The bake records a first-render call as a read (bake-prelude.js traps these two methods), so a
|
|
12
|
+
// baked first screen never shows a value the device would not render.
|
|
13
|
+
//
|
|
14
|
+
// Bundled only when the app names `crypto` (bake build, __BAKE_WEB_CRYPTO__); the bundle's
|
|
15
|
+
// manifest then requires the runtime global `crypto` (compat.mjs).
|
|
16
|
+
import { installDOMException } from './dom-exception.js';
|
|
17
|
+
|
|
18
|
+
/** The most bytes one getRandomValues call fills. */
|
|
19
|
+
export const MAX_RANDOM_BYTES = 65536;
|
|
20
|
+
|
|
21
|
+
const INTEGER_ARRAYS = new Set(['Int8Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'BigInt64Array', 'BigUint64Array']);
|
|
22
|
+
const HEX = Array.from({ length: 256 }, (_, i) => (i < 16 ? '0' : '') + i.toString(16));
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Installs `g.crypto` (when the engine has none). `words(count)` returns `count` random u32
|
|
26
|
+
* numbers; by default the core's `__bakeRandomWords`, read at call time.
|
|
27
|
+
*/
|
|
28
|
+
export function installWebCrypto(g, words = (count) => {
|
|
29
|
+
const native = g.__bakeRandomWords;
|
|
30
|
+
// bake build's layout preview (a node VM, no core): any bytes do; the bake itself (bake-frame)
|
|
31
|
+
// traps the call and fails with its place.
|
|
32
|
+
if (typeof native !== 'function' && g.__bakeBakePreview === true) return new Array(count).fill(0);
|
|
33
|
+
if (typeof native !== 'function') {
|
|
34
|
+
throw new (g.DOMException)('crypto: this BakeNative runtime has no random source; update the app binary', 'NotSupportedError');
|
|
35
|
+
}
|
|
36
|
+
return native(count);
|
|
37
|
+
}) {
|
|
38
|
+
if (typeof g.crypto !== 'undefined') return g.crypto;
|
|
39
|
+
const DOMException = installDOMException(g);
|
|
40
|
+
const fail = (what) => `Failed to execute '${what}' on 'Crypto': `;
|
|
41
|
+
|
|
42
|
+
/** Fills `bytes` (a Uint8Array) from the OS. */
|
|
43
|
+
const fill = (bytes) => {
|
|
44
|
+
const n = bytes.length;
|
|
45
|
+
if (n === 0) return;
|
|
46
|
+
const w = words(Math.ceil(n / 4));
|
|
47
|
+
for (let i = 0; i < n; i++) bytes[i] = (w[i >> 2] >>> ((i & 3) * 8)) & 0xff;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const crypto = {};
|
|
51
|
+
function getRandomValues(array) {
|
|
52
|
+
if (this !== crypto) throw new TypeError('Illegal invocation');
|
|
53
|
+
if (arguments.length < 1) throw new TypeError(fail('getRandomValues') + '1 argument required, but only 0 present.');
|
|
54
|
+
if (!ArrayBuffer.isView(array)) throw new TypeError(fail('getRandomValues') + "parameter 1 is not of type 'ArrayBufferView'.");
|
|
55
|
+
const kind = array[Symbol.toStringTag];
|
|
56
|
+
if (!INTEGER_ARRAYS.has(kind)) {
|
|
57
|
+
const type = kind === undefined || kind === 'DataView' ? 'DataView' : kind.replace(/Array$/, '');
|
|
58
|
+
throw new DOMException(fail('getRandomValues') + `The provided ArrayBufferView is of type '${type}', which is not an integer array type.`, 'TypeMismatchError');
|
|
59
|
+
}
|
|
60
|
+
if (array.byteLength > MAX_RANDOM_BYTES) {
|
|
61
|
+
throw new DOMException(fail('getRandomValues') + `The ArrayBufferView's byte length (${array.byteLength}) exceeds the number of bytes of entropy available via this API (${MAX_RANDOM_BYTES}).`, 'QuotaExceededError');
|
|
62
|
+
}
|
|
63
|
+
// Only the view's own bytes: a subarray leaves the rest of its buffer as it was.
|
|
64
|
+
fill(new Uint8Array(array.buffer, array.byteOffset, array.byteLength));
|
|
65
|
+
return array;
|
|
66
|
+
}
|
|
67
|
+
function randomUUID() {
|
|
68
|
+
if (this !== crypto) throw new TypeError('Illegal invocation');
|
|
69
|
+
const b = new Uint8Array(16);
|
|
70
|
+
fill(b);
|
|
71
|
+
b[6] = (b[6] & 0x0f) | 0x40; // version 4
|
|
72
|
+
b[8] = (b[8] & 0x3f) | 0x80; // variant 10 (RFC 4122)
|
|
73
|
+
let s = '';
|
|
74
|
+
for (let i = 0; i < 16; i++) s += (i === 4 || i === 6 || i === 8 || i === 10 ? '-' : '') + HEX[b[i]];
|
|
75
|
+
return s;
|
|
76
|
+
}
|
|
77
|
+
// Methods on a prototype (as the web's Crypto.prototype): the bake's traps shadow them with
|
|
78
|
+
// own properties during the first render and remove the shadows after.
|
|
79
|
+
const proto = { getRandomValues, randomUUID };
|
|
80
|
+
Object.defineProperty(proto, Symbol.toStringTag, { value: 'Crypto', configurable: true });
|
|
81
|
+
Object.setPrototypeOf(crypto, proto);
|
|
82
|
+
Object.defineProperty(g, 'crypto', { value: crypto, writable: true, configurable: true, enumerable: false });
|
|
83
|
+
return crypto;
|
|
84
|
+
}
|