blob: 95dab1e8e8963b92c9db33d8c700c074230eb7af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Flags: --expose-internals
'use strict';
/* eslint-disable no-global-assign */
require('../common');
const {
structuredClone: _structuredClone,
} = require('internal/structured_clone');
const {
strictEqual,
throws,
} = require('assert');
strictEqual(globalThis.structuredClone, _structuredClone);
structuredClone = undefined;
strictEqual(globalThis.structuredClone, undefined);
// Restore the value for the known globals check.
structuredClone = _structuredClone;
throws(() => _structuredClone(), /ERR_MISSING_ARGS/);
|