diff --git a/lib/less/contexts.js b/lib/less/contexts.js index 829760a6e..803b8c6c9 100644 --- a/lib/less/contexts.js +++ b/lib/less/contexts.js @@ -84,7 +84,7 @@ contexts.Eval = class { exitCalc() { this.calcStack.pop(); - if (!this.calcStack) { + if (!this.calcStack.length) { this.inCalc = false; } } diff --git a/test/css/calc.css b/test/css/calc.css index 9b29d7bf8..7f335c69b 100644 --- a/test/css/calc.css +++ b/test/css/calc.css @@ -17,3 +17,12 @@ .c { height: calc(100% - ((10px * 3) + (10px * 2))); } +.correctly-exit-calc-mode h2 { + width: 10px; +} +.correctly-exit-calc-mode div { + width: calc(100px * 2); +} +.correctly-exit-calc-mode h1 { + color: white; +} diff --git a/test/less/calc.less b/test/less/calc.less index 53142290a..8bdf57b61 100644 --- a/test/less/calc.less +++ b/test/less/calc.less @@ -27,4 +27,20 @@ .c { @v: 10px; height: calc(100% - ((@v * 3) + (@v * 2))); -} \ No newline at end of file +} + +.correctly-exit-calc-mode { + @a: 10; + h2 { width: unit(@a, px); } + + div { width: calc(100px * 2); } + + .mk-map() { + text: white; + background: black; + } + + @p: .mk-map(); + + h1 { color: @p[text]; } +} diff --git a/test/sourcemaps/custom-props.json b/test/sourcemaps/custom-props.json index 286846f5b..cb6fb6abe 100644 --- a/test/sourcemaps/custom-props.json +++ b/test/sourcemaps/custom-props.json @@ -1 +1 @@ -{"version":3,"sources":["testweb/sourcemaps/custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,gCAAA","file":"sourcemaps/custom-props.css"} \ No newline at end of file +{"version":3,"sources":["testweb/sourcemaps/custom-props.less"],"names":[],"mappings":"AAEA;EACC,uBAHO,UAGP;EACA,OAAO,eAAP;EACA,sBALO,UAKP","file":"sourcemaps/custom-props.css"} \ No newline at end of file