mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
docs(transformer): fix comments (#7925)
Fix comment. It was inaccurate previously.
This commit is contained in:
parent
02b653c061
commit
10a86b9242
2 changed files with 2 additions and 2 deletions
|
|
@ -126,7 +126,7 @@ impl<'a> TransformCtx<'a> {
|
|||
// If it *does* have expressions, but they're all literals, then also cannot have side effects,
|
||||
// but don't bother checking for that as it shouldn't occur in real world code.
|
||||
// Why would you write "`x${9}z`" when you can just write "`x9z`"?
|
||||
// Note: "`x${foo}`" *can* have side effects if `foo` is an object with a `valueOf` method.
|
||||
// Note: "`x${foo}`" *can* have side effects if `foo` is an object with a `toString` method.
|
||||
Expression::TemplateLiteral(lit) if lit.expressions.is_empty() => {
|
||||
let references = create_array(|| {
|
||||
ctx.ast.expression_template_literal(
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ fn key_needs_temp_var(key: &Expression, ctx: &TraverseCtx) -> bool {
|
|||
// If it *does* have expressions, but they're all literals, then also cannot have side effects,
|
||||
// but don't bother checking for that as it shouldn't occur in real world code.
|
||||
// Why would you write "`x${9}z`" when you can just write "`x9z`"?
|
||||
// Note: "`x${foo}`" *can* have side effects if `foo` is an object with a `valueOf` method.
|
||||
// Note: "`x${foo}`" *can* have side effects if `foo` is an object with a `toString` method.
|
||||
Expression::TemplateLiteral(lit) => !lit.expressions.is_empty(),
|
||||
// `IdentifierReference`s can have side effects if is unbound.
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in a new issue