Skip to content

Commit ab1a331

Browse files
chore(javascript): drop casts main's narrower types made redundant
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
1 parent 8624bf3 commit ab1a331

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

‎lib/javascript/syntax-parser.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14086,7 +14086,7 @@ class WebpackParser extends BaseParser {
1408614086
const sourceType =
1408714087
this.options.sourceType === "commonjs"
1408814088
? "script"
14089-
: /** @type {"module" | "script"} */ (this.options.sourceType);
14089+
: this.options.sourceType;
1409014090
if (typeof body === "number") {
1409114091
this.next();
1409214092
const program = this._treeNode(
@@ -14376,7 +14376,7 @@ class WebpackParser extends BaseParser {
1437614376
return this.parseLabeledStatement(
1437714377
this.startNodeAt(start),
1437814378
maybeName,
14379-
expr,
14379+
/** @type {Identifier} */ (expr),
1438014380
context
1438114381
);
1438214382
}

‎lib/javascript/syntax-printer.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15502,9 +15502,7 @@ const installEstree = (modules) => {
1550215502
ToplevelNode({
1550315503
startToken: treeStartToken(node),
1550415504
endToken: treeEndToken(node),
15505-
body: normalizeDirectives(
15506-
/** @type {Node[]} */ (mapList(node, Field.body, fromTree))
15507-
)
15505+
body: normalizeDirectives(mapList(node, Field.body, fromTree))
1550815506
});
1550915507
FROM_TREE[NodeType.ArrayPattern] = (node) =>
1551015508
makeNode(DestructuringNode, undefined, {

0 commit comments

Comments
 (0)