Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 3709357

Browse files
committedMar 13, 2018
Bump LibSass to 3.5.1
Fixes #2280
1 parent 96d0d0b commit 3709357

File tree

6 files changed

+20
-15
lines changed

6 files changed

+20
-15
lines changed
 

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "node-sass",
33
"version": "4.8.1",
4-
"libsass": "3.5.0",
4+
"libsass": "3.5.1",
55
"description": "Wrapper around libsass",
66
"license": "MIT",
77
"bugs": "https://github.com/sass/node-sass/issues",
@@ -83,7 +83,7 @@
8383
"object-merge": "^2.5.1",
8484
"read-yaml": "^1.0.0",
8585
"rimraf": "^2.5.2",
86-
"sass-spec": "^3.5.0",
86+
"sass-spec": "^3.5.1",
8787
"unique-temp-dir": "^1.0.0"
8888
}
8989
}

‎src/libsass/docs/implementations.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ There are several implementations of `libsass` for a variety of languages. Here
33
### C
44
* [sassc](https://github.com/hcatlin/sassc)
55

6+
### Crystal
7+
* [sass.cr](https://github.com/straight-shoota/sass.cr)
8+
69
### Elixir
710
* [sass.ex](https://github.com/scottdavis/sass.ex)
811

‎src/libsass/src/check_nesting.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ namespace Sass {
108108
this->visit_children(i);
109109

110110
if (Block_Ptr b = Cast<Block>(i->alternative())) {
111-
for (auto n : i->alternative()->elements()) {
112-
n->perform(this);
113-
}
111+
for (auto n : b->elements()) n->perform(this);
114112
}
115113

116114
return i;

‎src/libsass/src/context.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,11 @@ namespace Sass {
653653
Expand expand(*this, &global, &backtrace);
654654
Cssize cssize(*this, &backtrace);
655655
CheckNesting check_nesting;
656-
// check nesting
657-
check_nesting(root);
656+
// check nesting in all files
657+
for (auto sheet : sheets) {
658+
auto styles = sheet.second;
659+
check_nesting(styles.root);
660+
}
658661
// expand and eval the tree
659662
root = expand(root);
660663
// check nesting

‎src/libsass/src/eval.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,7 @@ namespace Sass {
15621562
v->value(ops[op](lv, rn.value() * f));
15631563
}
15641564

1565+
v->reduce();
15651566
v->pstate(pstate);
15661567
return v.detach();
15671568
}

‎src/libsass/src/functions.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ namespace Sass {
102102

103103
namespace Functions {
104104

105-
static Number tmpnr(ParserState("[FN]"), 0);
106-
107105
inline void handle_utf8_error (const ParserState& pstate, Backtrace* backtrace)
108106
{
109107
try {
@@ -159,7 +157,7 @@ namespace Sass {
159157
{
160158
// Minimal error handling -- the expectation is that built-ins will be written correctly!
161159
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
162-
tmpnr = val;
160+
Number tmpnr(val);
163161
tmpnr.reduce();
164162
double v = tmpnr.value();
165163
if (!(lo <= v && v <= hi)) {
@@ -175,7 +173,7 @@ namespace Sass {
175173
{
176174
// Minimal error handling -- the expectation is that built-ins will be written correctly!
177175
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
178-
tmpnr = val;
176+
Number tmpnr(val);
179177
tmpnr.reduce();
180178
return tmpnr;
181179
}
@@ -193,7 +191,7 @@ namespace Sass {
193191
{
194192
// Minimal error handling -- the expectation is that built-ins will be written correctly!
195193
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
196-
tmpnr = val;
194+
Number tmpnr(val);
197195
tmpnr.reduce();
198196
/*
199197
if (tmpnr.unit() == "%") {
@@ -210,15 +208,16 @@ namespace Sass {
210208
{
211209
// Minimal error handling -- the expectation is that built-ins will be written correctly!
212210
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
213-
tmpnr = val;
211+
Number tmpnr(val);
214212
tmpnr.reduce();
215213
return tmpnr.value();
216214
}
217215

218216
double color_num(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtrace* backtrace)
219217
{
220218
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
221-
tmpnr = val; tmpnr.reduce();
219+
Number tmpnr(val);
220+
tmpnr.reduce();
222221
if (tmpnr.unit() == "%") {
223222
return std::min(std::max(tmpnr.value() * 255 / 100.0, 0.0), 255.0);
224223
} else {
@@ -229,7 +228,8 @@ namespace Sass {
229228

230229
inline double alpha_num(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtrace* backtrace) {
231230
Number_Ptr val = get_arg<Number>(argname, env, sig, pstate, backtrace);
232-
tmpnr = val; tmpnr.reduce();
231+
Number tmpnr(val);
232+
tmpnr.reduce();
233233
if (tmpnr.unit() == "%") {
234234
return std::min(std::max(tmpnr.value(), 0.0), 100.0);
235235
} else {

0 commit comments

Comments
 (0)
This repository has been archived.