This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 3030#include " expand.hpp"
3131#include " color_maps.hpp"
3232#include " sass_functions.hpp"
33+ #include " error_handling.hpp"
3334#include " util_string.hpp"
3435
3536namespace Sass {
@@ -92,6 +93,12 @@ namespace Sass {
9293 Env* env = environment ();
9394 sass::string var (a->variable ());
9495 if (a->is_global ()) {
96+ if (!env->has_global (var)) {
97+ deprecated (
98+ " !global assignments won't be able to declare new variables in future versions." ,
99+ " Consider adding `" + var + " : null` at the top level." ,
100+ true , a->pstate ());
101+ }
95102 if (a->is_default ()) {
96103 if (env->has_global (var)) {
97104 Expression* e = Cast<Expression>(env->get_global (var));
Original file line number Diff line number Diff line change 1313#include " context.hpp"
1414#include " parser.hpp"
1515#include " sass_functions.hpp"
16+ #include " error_handling.hpp"
1617
1718namespace Sass {
1819
@@ -358,6 +359,12 @@ namespace Sass {
358359 Env* env = environment ();
359360 const sass::string& var (a->variable ());
360361 if (a->is_global ()) {
362+ if (!env->has_global (var)) {
363+ deprecated (
364+ " !global assignments won't be able to declare new variables in future versions." ,
365+ " Consider adding `" + var + " : null` at the top level." ,
366+ true , a->pstate ());
367+ }
361368 if (a->is_default ()) {
362369 if (env->has_global (var)) {
363370 ExpressionObj e = Cast<Expression>(env->get_global (var));
You can’t perform that action at this time.
0 commit comments