fix: update the target to ES2022 (#10574)

This commit is contained in:
Nikolay Vitkov 2023-07-18 18:28:03 +02:00 committed by GitHub
parent a419abf509
commit 88439f913e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 18 deletions

View File

@ -28,9 +28,9 @@ const windowHandle = await page.evaluateHandle(() => window);
## Properties
| Property | Modifiers | Type | Description |
| ---------------------- | --------------------- | ---- | -------------------------------------------------------------- |
| \[\_\_JSHandleSymbol\] | <code>optional</code> | T | Used for nominally typing [JSHandle](./puppeteer.jshandle.md). |
| Property | Modifiers | Type | Description |
| -------- | --------------------- | ---- | -------------------------------------------------------------- |
| \_ | <code>optional</code> | T | Used for nominally typing [JSHandle](./puppeteer.jshandle.md). |
## Methods

View File

@ -22,8 +22,6 @@ import {EvaluateFuncWith, HandleFor, HandleOr} from '../common/types.js';
import {ElementHandle} from './ElementHandle.js';
declare const __JSHandleSymbol: unique symbol;
/**
* Represents a reference to a JavaScript object. Instances can be created using
* {@link Page.evaluateHandle}.
@ -49,7 +47,7 @@ export class JSHandle<T = unknown> {
/**
* Used for nominally typing {@link JSHandle}.
*/
[__JSHandleSymbol]?: T;
declare _?: T;
/**
* @internal

View File

@ -31,7 +31,7 @@ import {
} from './DeviceRequestPrompt.js';
import {ExecutionContext} from './ExecutionContext.js';
import {FrameManager} from './FrameManager.js';
import {IsolatedWorld, IsolatedWorldChart} from './IsolatedWorld.js';
import {IsolatedWorld} from './IsolatedWorld.js';
import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js';
import {LazyArg} from './LazyArg.js';
import {LifecycleWatcher, PuppeteerLifeCycleEvent} from './LifecycleWatcher.js';
@ -46,11 +46,9 @@ export class Frame extends BaseFrame {
#detached = false;
#client!: CDPSession;
override worlds!: IsolatedWorldChart;
_frameManager: FrameManager;
override _id: string;
_loaderId = '';
override _name?: string;
override _hasStartedLoading = false;
_lifecycleEvents = new Set<string>();
override _parentId?: string;

View File

@ -30,17 +30,10 @@ import {
withSourcePuppeteerURLIfNone,
} from './util.js';
declare const __JSHandleSymbol: unique symbol;
/**
* @internal
*/
export class CDPJSHandle<T = unknown> extends JSHandle<T> {
/**
* Used for nominally typing {@link JSHandle}.
*/
[__JSHandleSymbol]?: T;
#disposed = false;
#context: ExecutionContext;
#remoteObject: Protocol.Runtime.RemoteObject;

View File

@ -228,7 +228,6 @@ export class WaitTask<T = unknown> {
return error;
}
// @ts-expect-error TODO: uncomment once cause is supported in Node types.
return new Error('WaitTask failed with an error', {
cause: error,
});

View File

@ -26,7 +26,7 @@
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "ES2021",
"target": "ES2022",
"useUnknownInCatchVariables": true,
"skipLibCheck": true
}