Skip to content

Commit 6e0de9e

Browse files
committed
fix(compiler): unwrap ParenthesizedExpression in dom-bindings isDirective
The formatter rewrote `'use dom bindings'` to `('use dom bindings')`, wrapping the string literal in a ParenthesizedExpression. isDirective checked `node.expression.value` directly, which is undefined on a ParenthesizedExpression node. Use the existing `unwrap()` helper to peel type-assertion and parenthesized wrappers before reading .value.
1 parent 06d92dc commit 6e0de9e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/octane/src/compiler/dom-bindings.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function statements(fn) {
212212
}
213213

214214
function isDirective(node) {
215-
return node?.type === 'ExpressionStatement' && node.expression?.value === DIRECTIVE;
215+
return node?.type === 'ExpressionStatement' && unwrap(node.expression)?.value === DIRECTIVE;
216216
}
217217

218218
function attrName(attr) {

0 commit comments

Comments
 (0)