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

Commit 7929c32

Browse files
authored
Merge pull request #2543 from sass/libsass-subtreee
Bump LibSass to 3.5.5
2 parents 9b7015c + ea9ffd6 commit 7929c32

14 files changed

Lines changed: 60 additions & 125 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.4-1",
86+
"sass-spec": "https://github.com/sass/sass-spec.git#dc2d573",
8787
"unique-temp-dir": "^1.0.0"
8888
}
8989
}

src/binding.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
113113
sass_option_set_precision(sass_options, Nan::To<int32_t>(Nan::Get(options, Nan::New("precision").ToLocalChecked()).ToLocalChecked()).FromJust());
114114
sass_option_set_indent(sass_options, ctx_w->indent);
115115
sass_option_set_linefeed(sass_options, ctx_w->linefeed);
116-
sass_option_push_import_extension(sass_options, ".css");
117116

118117
v8::Local<v8::Value> importer_callback = Nan::Get(options, Nan::New("importer").ToLocalChecked()).ToLocalChecked();
119118

@@ -303,7 +302,7 @@ NAN_METHOD(render_sync) {
303302
}
304303

305304
sass_free_context_wrapper(ctx_w);
306-
305+
307306
info.GetReturnValue().Set(result == 0);
308307
}
309308

src/libsass/include/sass/context.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ ADDAPI size_t ADDCALL sass_compiler_get_callee_stack_size(struct Sass_Compiler*
149149
ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_last_callee(struct Sass_Compiler* compiler);
150150
ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_callee_entry(struct Sass_Compiler* compiler, size_t idx);
151151

152-
// Push function for import extenions
153-
ADDAPI void ADDCALL sass_option_push_import_extension (struct Sass_Options* options, const char* ext);
154-
155152
// Push function for paths (no manipulation support for now)
156153
ADDAPI void ADDCALL sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
157154
ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options, const char* path);

src/libsass/script/ci-build-plugin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ if [ "x$PLUGIN" == "xglob" ]; then
5353
${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss > ${SASS_SPEC_SPEC_DIR}/basic/result.css
5454
${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss --sourcemap > /dev/null
5555
else
56-
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic > ${SASS_SPEC_SPEC_DIR}/basic/result.css
57-
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic --sourcemap > /dev/null
56+
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --precision 5 --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic > ${SASS_SPEC_SPEC_DIR}/basic/result.css
57+
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --precision 5 --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic --sourcemap > /dev/null
5858
fi
5959
RETVAL=$?; if [ "$RETVAL" != "0" ]; then exit $RETVAL; fi
6060

src/libsass/src/cencode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
4747
*codechar++ = base64_encode_value(result);
4848
result = (fragment & 0x003) << 4;
4949
#ifndef _MSC_VER
50-
__attribute__ ((fallthrough));
50+
/* fall through */
5151
#endif
5252
case step_B:
5353
if (plainchar == plaintextend)
@@ -61,7 +61,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
6161
*codechar++ = base64_encode_value(result);
6262
result = (fragment & 0x00f) << 2;
6363
#ifndef _MSC_VER
64-
__attribute__ ((fallthrough));
64+
/* fall through */
6565
#endif
6666
case step_C:
6767
if (plainchar == plaintextend)

src/libsass/src/context.cpp

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ namespace Sass {
9696
// include_paths.push_back(CWD);
9797

9898
// collect more paths from different options
99-
collect_extensions(c_options.extension);
100-
collect_extensions(c_options.extensions);
10199
collect_include_paths(c_options.include_path);
102100
collect_include_paths(c_options.include_paths);
103101
collect_plugin_paths(c_options.plugin_path);
@@ -168,37 +166,6 @@ namespace Sass {
168166
{
169167
}
170168

171-
void Context::collect_extensions(const char* exts_str)
172-
{
173-
if (exts_str) {
174-
const char* beg = exts_str;
175-
const char* end = Prelexer::find_first<PATH_SEP>(beg);
176-
177-
while (end) {
178-
std::string ext(beg, end - beg);
179-
if (!ext.empty()) {
180-
extensions.push_back(ext);
181-
}
182-
beg = end + 1;
183-
end = Prelexer::find_first<PATH_SEP>(beg);
184-
}
185-
186-
std::string ext(beg);
187-
if (!ext.empty()) {
188-
extensions.push_back(ext);
189-
}
190-
}
191-
}
192-
193-
void Context::collect_extensions(string_list* paths_array)
194-
{
195-
while (paths_array)
196-
{
197-
collect_extensions(paths_array->string);
198-
paths_array = paths_array->next;
199-
}
200-
}
201-
202169
void Context::collect_include_paths(const char* paths_str)
203170
{
204171
if (paths_str) {
@@ -269,20 +236,15 @@ namespace Sass {
269236
// looks for alternatives and returns a list from one directory
270237
std::vector<Include> Context::find_includes(const Importer& import)
271238
{
272-
// include configured extensions
273-
std::vector<std::string> exts(File::defaultExtensions);
274-
if (extensions.size() > 0) {
275-
exts.insert(exts.end(), extensions.begin(), extensions.end());
276-
}
277239
// make sure we resolve against an absolute path
278240
std::string base_path(rel2abs(import.base_path));
279241
// first try to resolve the load path relative to the base path
280-
std::vector<Include> vec(resolve_includes(base_path, import.imp_path, exts));
242+
std::vector<Include> vec(resolve_includes(base_path, import.imp_path));
281243
// then search in every include path (but only if nothing found yet)
282244
for (size_t i = 0, S = include_paths.size(); vec.size() == 0 && i < S; ++i)
283245
{
284246
// call resolve_includes and individual base path and append all results
285-
std::vector<Include> resolved(resolve_includes(include_paths[i], import.imp_path, exts));
247+
std::vector<Include> resolved(resolve_includes(include_paths[i], import.imp_path));
286248
if (resolved.size()) vec.insert(vec.end(), resolved.begin(), resolved.end());
287249
}
288250
// return vector
@@ -403,14 +365,6 @@ namespace Sass {
403365
// process the resolved entry
404366
else if (resolved.size() == 1) {
405367
bool use_cache = c_importers.size() == 0;
406-
if (resolved[0].deprecated) {
407-
// emit deprecation warning when import resolves to a .css file
408-
deprecated(
409-
"Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass.",
410-
"Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.",
411-
true, pstate
412-
);
413-
}
414368
// use cache for the resource loading
415369
if (use_cache && sheets.count(resolved[0].abs_path)) return resolved[0];
416370
// try to read the content of the resolved file entry

src/libsass/src/context.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ namespace Sass {
6767

6868
std::vector<std::string> plugin_paths; // relative paths to load plugins
6969
std::vector<std::string> include_paths; // lookup paths for includes
70-
std::vector<std::string> extensions; // lookup extensions for imports`
7170

7271

7372

@@ -110,8 +109,6 @@ namespace Sass {
110109
void collect_plugin_paths(string_list* paths_array);
111110
void collect_include_paths(const char* paths_str);
112111
void collect_include_paths(string_list* paths_array);
113-
void collect_extensions(const char* extensions_str);
114-
void collect_extensions(string_list* extensions_array);
115112
std::string format_embedded_source_map();
116113
std::string format_source_mapping_url(const std::string& out_path);
117114

src/libsass/src/file.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ namespace Sass {
342342
for(auto ext : exts) {
343343
rel_path = join_paths(base, "_" + name + ext);
344344
abs_path = join_paths(root, rel_path);
345-
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path, ext == ".css" });
345+
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
346346
}
347347
// next test plain name with exts
348348
for(auto ext : exts) {
349349
rel_path = join_paths(base, name + ext);
350350
abs_path = join_paths(root, rel_path);
351-
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path, ext == ".css" });
351+
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
352352
}
353353
// nothing found
354354
return includes;

src/libsass/src/file.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,9 @@ namespace Sass {
8989
public:
9090
// resolved absolute path
9191
std::string abs_path;
92-
// is a deprecated file type
93-
bool deprecated;
9492
public:
95-
Include(const Importer& imp, std::string abs_path, bool deprecated)
96-
: Importer(imp), abs_path(abs_path), deprecated(deprecated)
97-
{ }
9893
Include(const Importer& imp, std::string abs_path)
99-
: Importer(imp), abs_path(abs_path), deprecated(false)
94+
: Importer(imp), abs_path(abs_path)
10095
{ }
10196
};
10297

@@ -126,12 +121,11 @@ namespace Sass {
126121

127122
namespace File {
128123

129-
static std::vector<std::string> defaultExtensions = { ".scss", ".sass" };
124+
static std::vector<std::string> defaultExtensions = { ".scss", ".sass", ".css" };
130125

131126
std::vector<Include> resolve_includes(const std::string& root, const std::string& file,
132127
const std::vector<std::string>& exts = defaultExtensions);
133128

134-
135129
}
136130

137131
}

src/libsass/src/inspect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ namespace Sass {
10571057
case Complex_Selector::REFERENCE:
10581058
append_mandatory_space();
10591059
append_string("/");
1060-
c->reference()->perform(this);
1060+
if (c->reference()) c->reference()->perform(this);
10611061
append_string("/");
10621062
append_mandatory_space();
10631063
break;

0 commit comments

Comments
 (0)