Skip to content

Commit

Permalink
fix: update the target to ES2022 (#10574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Jul 18, 2023
1 parent a419abf commit 88439f9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 18 deletions.
6 changes: 3 additions & 3 deletions docs/api/puppeteer.jshandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions packages/puppeteer-core/src/api/JSHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand All @@ -49,7 +47,7 @@ export class JSHandle<T = unknown> {
/**
* Used for nominally typing {@link JSHandle}.
*/
[__JSHandleSymbol]?: T;
declare _?: T;

/**
* @internal
Expand Down
4 changes: 1 addition & 3 deletions packages/puppeteer-core/src/common/Frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions packages/puppeteer-core/src/common/JSHandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion packages/puppeteer-core/src/common/WaitTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "ES2021",
"target": "ES2022",
"useUnknownInCatchVariables": true,
"skipLibCheck": true
}
Expand Down

0 comments on commit 88439f9

Please sign in to comment.