chore: remove BigInt exists checks (#9744)
This commit is contained in:
parent
415da92300
commit
3db7d55d26
@ -72,7 +72,7 @@ export function valueFromRemoteObject(
|
|||||||
): any {
|
): any {
|
||||||
assert(!remoteObject.objectId, 'Cannot extract value when objectId is given');
|
assert(!remoteObject.objectId, 'Cannot extract value when objectId is given');
|
||||||
if (remoteObject.unserializableValue) {
|
if (remoteObject.unserializableValue) {
|
||||||
if (remoteObject.type === 'bigint' && typeof BigInt !== 'undefined') {
|
if (remoteObject.type === 'bigint') {
|
||||||
return BigInt(remoteObject.unserializableValue.replace('n', ''));
|
return BigInt(remoteObject.unserializableValue.replace('n', ''));
|
||||||
}
|
}
|
||||||
switch (remoteObject.unserializableValue) {
|
switch (remoteObject.unserializableValue) {
|
||||||
|
@ -23,8 +23,6 @@ import {
|
|||||||
} from './mocha-utils.js';
|
} from './mocha-utils.js';
|
||||||
import utils from './utils.js';
|
import utils from './utils.js';
|
||||||
|
|
||||||
const bigint = typeof BigInt !== 'undefined';
|
|
||||||
|
|
||||||
describe('Evaluation specs', function () {
|
describe('Evaluation specs', function () {
|
||||||
setupTestBrowserHooks();
|
setupTestBrowserHooks();
|
||||||
setupTestPageAndContextHooks();
|
setupTestPageAndContextHooks();
|
||||||
@ -38,7 +36,7 @@ describe('Evaluation specs', function () {
|
|||||||
});
|
});
|
||||||
expect(result).toBe(21);
|
expect(result).toBe(21);
|
||||||
});
|
});
|
||||||
(bigint ? it : it.skip)('should transfer BigInt', async () => {
|
it('should transfer BigInt', async () => {
|
||||||
const {page} = getTestState();
|
const {page} = getTestState();
|
||||||
|
|
||||||
const result = await page.evaluate((a: bigint) => {
|
const result = await page.evaluate((a: bigint) => {
|
||||||
@ -259,7 +257,7 @@ describe('Evaluation specs', function () {
|
|||||||
expect(result).not.toBe(object);
|
expect(result).not.toBe(object);
|
||||||
expect(result).toEqual(object);
|
expect(result).toEqual(object);
|
||||||
});
|
});
|
||||||
(bigint ? it : it.skip)('should return BigInt', async () => {
|
it('should return BigInt', async () => {
|
||||||
const {page} = getTestState();
|
const {page} = getTestState();
|
||||||
|
|
||||||
const result = await page.evaluate(() => {
|
const result = await page.evaluate(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user