txs1992 / stylus-converter

🛠️🤖 A tool that converts a stylus into scss, or less, or other precompiled CSS. 一个将 stylus 转换为 scss 或 less 或其他预编译 CSS 的工具。

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken prop reference with operator

knilink opened this issue · comments

input

.foo
  width: 1px
  height: -@width

expected:

.foo {
  width: 1px;
  height: -1px;
}

actual:

TypeError: Cannot read property 'map' of undefined

maybe this line

return `${OPEARTION_MAP[op] || op}(${visitExpression(expr)})`

should be

return `${OPEARTION_MAP[op] || op}(${visitNode(expr)})`

or check undefined in visitExpression