Repository: rollup/rollup
File: src/ast/nodes/ExportNamedDeclaration.ts (TypeScript)

Code before:
import type MagicString from 'magic-string';
import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';
import type { HasEffectsContext } from '../ExecutionContext';
import ClassDeclaration from './ClassDeclaration';
import type ExportSpecifier from './ExportSpecifier';
import type FunctionDeclaration from './FunctionDeclaration';
import type ImportAttribute from './ImportAttribute';
import type Literal from './Literal';
import type * as NodeType from './NodeType';
import { doNotDeoptimize, type Node, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node';
import type VariableDeclaration from './VariableDeclaration';

export default class ExportNamedDeclaration extends NodeBase {
	attributes!: ImportAttribute[];
	declaration!: FunctionDeclaration | ClassDeclaration | VariableDeclaration | null;
	needsBoundaries!: true;
	source!: Literal<string> | null;
	specifiers!: readonly ExportSpecifier[];
	type!: NodeType.tExportNamedDeclaration;

	bind(): void {
		// Do not bind specifiers
		this.declaration?.bind();
	}

	hasEffects(context: HasEffectsContext): boolean {
		return !!this.declaration?.hasEffects(context);
	}

	initialise(): void {
		super.initialise();
		this.scope.context.addExport(this);
	}

	removeAnnotations(code: MagicString) {
		this.declaration?.removeAnnotations(code);
	}

	render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {
		const { start, end } = nodeRenderOptions as { end: number; start: number };
		if (this.declaration === null) {

Review comment (suggestion):
`ExportNamedDeclaration.prototype.needsBoundaries = true` is set later in this file. Declaring `needsBoundaries!: true` emits an instance field initialized to `undefined`, which shadows the prototype flag and makes `needsBoundaries` falsy at runtime. This should remain `declare needsBoundaries: true` or be initialized to `true` as a real field.
```suggestion
	declare needsBoundaries: true;
```

Code after:
import type MagicString from 'magic-string';
import type { NodeRenderOptions, RenderOptions } from '../../utils/renderHelpers';
import type { HasEffectsContext } from '../ExecutionContext';
import ClassDeclaration from './ClassDeclaration';
import type ExportSpecifier from './ExportSpecifier';
import type FunctionDeclaration from './FunctionDeclaration';
import type ImportAttribute from './ImportAttribute';
import type Literal from './Literal';
import type * as NodeType from './NodeType';
import { doNotDeoptimize, type Node, NodeBase, onlyIncludeSelfNoDeoptimize } from './shared/Node';
import type VariableDeclaration from './VariableDeclaration';

export default class ExportNamedDeclaration extends NodeBase {
	declare attributes: ImportAttribute[];
	declare declaration: FunctionDeclaration | ClassDeclaration | VariableDeclaration | null;
	declare needsBoundaries: true;
	declare source: Literal<string> | null;
	declare specifiers: readonly ExportSpecifier[];
	declare type: NodeType.tExportNamedDeclaration;

	bind(): void {
		// Do not bind specifiers
		this.declaration?.bind();
	}

	hasEffects(context: HasEffectsContext): boolean {
		return !!this.declaration?.hasEffects(context);
	}

	initialise(): void {
		super.initialise();
		this.scope.context.addExport(this);
	}

	removeAnnotations(code: MagicString) {
		this.declaration?.removeAnnotations(code);
	}

	render(code: MagicString, options: RenderOptions, nodeRenderOptions?: NodeRenderOptions): void {
		const { start, end } = nodeRenderOptions as { end: number; start: number };
		if (this.declaration === null) {