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 ## Properties
| Property | Modifiers | Type | Description | | Property | Modifiers | Type | Description |
| ---------------------- | --------------------- | ---- | -------------------------------------------------------------- | | -------- | --------------------- | ---- | -------------------------------------------------------------- |
| \[\_\_JSHandleSymbol\] | <code>optional</code> | T | Used for nominally typing [JSHandle](./puppeteer.jshandle.md). | | \_ | <code>optional</code> | T | Used for nominally typing [JSHandle](./puppeteer.jshandle.md). |
## Methods ## Methods

View File

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

View File

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

View File

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

View File

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

View File

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