Commit 37093575 by xzyfer

Bump LibSass to 3.5.1

Fixes #2280
parent 96d0d0b1
{ {
"name": "node-sass", "name": "node-sass",
"version": "4.8.1", "version": "4.8.1",
"libsass": "3.5.0", "libsass": "3.5.1",
"description": "Wrapper around libsass", "description": "Wrapper around libsass",
"license": "MIT", "license": "MIT",
"bugs": "https://github.com/sass/node-sass/issues", "bugs": "https://github.com/sass/node-sass/issues",
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
"object-merge": "^2.5.1", "object-merge": "^2.5.1",
"read-yaml": "^1.0.0", "read-yaml": "^1.0.0",
"rimraf": "^2.5.2", "rimraf": "^2.5.2",
"sass-spec": "^3.5.0", "sass-spec": "^3.5.1",
"unique-temp-dir": "^1.0.0" "unique-temp-dir": "^1.0.0"
} }
} }
...@@ -3,6 +3,9 @@ There are several implementations of `libsass` for a variety of languages. Here ...@@ -3,6 +3,9 @@ There are several implementations of `libsass` for a variety of languages. Here
### C ### C
* [sassc](https://github.com/hcatlin/sassc) * [sassc](https://github.com/hcatlin/sassc)
### Crystal
* [sass.cr](https://github.com/straight-shoota/sass.cr)
### Elixir ### Elixir
* [sass.ex](https://github.com/scottdavis/sass.ex) * [sass.ex](https://github.com/scottdavis/sass.ex)
......
...@@ -108,9 +108,7 @@ namespace Sass { ...@@ -108,9 +108,7 @@ namespace Sass {
this->visit_children(i); this->visit_children(i);
if (Block_Ptr b = Cast<Block>(i->alternative())) { if (Block_Ptr b = Cast<Block>(i->alternative())) {
for (auto n : i->alternative()->elements()) { for (auto n : b->elements()) n->perform(this);
n->perform(this);
}
} }
return i; return i;
......
...@@ -653,8 +653,11 @@ namespace Sass { ...@@ -653,8 +653,11 @@ namespace Sass {
Expand expand(*this, &global, &backtrace); Expand expand(*this, &global, &backtrace);
Cssize cssize(*this, &backtrace); Cssize cssize(*this, &backtrace);
CheckNesting check_nesting; CheckNesting check_nesting;
// check nesting // check nesting in all files
check_nesting(root); for (auto sheet : sheets) {
auto styles = sheet.second;
check_nesting(styles.root);
}
// expand and eval the tree // expand and eval the tree
root = expand(root); root = expand(root);
// check nesting // check nesting
......
...@@ -1562,6 +1562,7 @@ namespace Sass { ...@@ -1562,6 +1562,7 @@ namespace Sass {
v->value(ops[op](lv, rn.value() * f)); v->value(ops[op](lv, rn.value() * f));
} }
v->reduce();
v->pstate(pstate); v->pstate(pstate);
return v.detach(); return v.detach();
} }
......
...@@ -102,8 +102,6 @@ namespace Sass { ...@@ -102,8 +102,6 @@ namespace Sass {
namespace Functions { namespace Functions {
static Number tmpnr(ParserState("[FN]"), 0);
inline void handle_utf8_error (const ParserState& pstate, Backtrace* backtrace) inline void handle_utf8_error (const ParserState& pstate, Backtrace* backtrace)
{ {
try { try {
...@@ -159,7 +157,7 @@ namespace Sass { ...@@ -159,7 +157,7 @@ namespace Sass {
{ {
// Minimal error handling -- the expectation is that built-ins will be written correctly! // Minimal error handling -- the expectation is that built-ins will be written correctly!
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace); Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
tmpnr = val; Number tmpnr(val);
tmpnr.reduce(); tmpnr.reduce();
double v = tmpnr.value(); double v = tmpnr.value();
if (!(lo <= v && v <= hi)) { if (!(lo <= v && v <= hi)) {
...@@ -175,7 +173,7 @@ namespace Sass { ...@@ -175,7 +173,7 @@ namespace Sass {
{ {
// Minimal error handling -- the expectation is that built-ins will be written correctly! // Minimal error handling -- the expectation is that built-ins will be written correctly!
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace); Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
tmpnr = val; Number tmpnr(val);
tmpnr.reduce(); tmpnr.reduce();
return tmpnr; return tmpnr;
} }
...@@ -193,7 +191,7 @@ namespace Sass { ...@@ -193,7 +191,7 @@ namespace Sass {
{ {
// Minimal error handling -- the expectation is that built-ins will be written correctly! // Minimal error handling -- the expectation is that built-ins will be written correctly!
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace); Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
tmpnr = val; Number tmpnr(val);
tmpnr.reduce(); tmpnr.reduce();
/* /*
if (tmpnr.unit() == "%") { if (tmpnr.unit() == "%") {
...@@ -210,7 +208,7 @@ namespace Sass { ...@@ -210,7 +208,7 @@ namespace Sass {
{ {
// Minimal error handling -- the expectation is that built-ins will be written correctly! // Minimal error handling -- the expectation is that built-ins will be written correctly!
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace); Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
tmpnr = val; Number tmpnr(val);
tmpnr.reduce(); tmpnr.reduce();
return tmpnr.value(); return tmpnr.value();
} }
...@@ -218,7 +216,8 @@ namespace Sass { ...@@ -218,7 +216,8 @@ namespace Sass {
double color_num(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtrace* backtrace) double color_num(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtrace* backtrace)
{ {
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace); Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
tmpnr = val; tmpnr.reduce(); Number tmpnr(val);
tmpnr.reduce();
if (tmpnr.unit() == "%") { if (tmpnr.unit() == "%") {
return std::min(std::max(tmpnr.value() * 255 / 100.0, 0.0), 255.0); return std::min(std::max(tmpnr.value() * 255 / 100.0, 0.0), 255.0);
} else { } else {
...@@ -229,7 +228,8 @@ namespace Sass { ...@@ -229,7 +228,8 @@ namespace Sass {
inline double alpha_num(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtrace* backtrace) { inline double alpha_num(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtrace* backtrace) {
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace); Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
tmpnr = val; tmpnr.reduce(); Number tmpnr(val);
tmpnr.reduce();
if (tmpnr.unit() == "%") { if (tmpnr.unit() == "%") {
return std::min(std::max(tmpnr.value(), 0.0), 100.0); return std::min(std::max(tmpnr.value(), 0.0), 100.0);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment