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 30
30
#include " expand.hpp"
31
31
#include " color_maps.hpp"
32
32
#include " sass_functions.hpp"
33
+ #include " error_handling.hpp"
33
34
#include " util_string.hpp"
34
35
35
36
namespace Sass {
@@ -92,6 +93,12 @@ namespace Sass {
92
93
Env* env = environment ();
93
94
sass::string var (a->variable ());
94
95
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
+ }
95
102
if (a->is_default ()) {
96
103
if (env->has_global (var)) {
97
104
Expression* e = Cast<Expression>(env->get_global (var));
Original file line number Diff line number Diff line change 13
13
#include " context.hpp"
14
14
#include " parser.hpp"
15
15
#include " sass_functions.hpp"
16
+ #include " error_handling.hpp"
16
17
17
18
namespace Sass {
18
19
@@ -358,6 +359,12 @@ namespace Sass {
358
359
Env* env = environment ();
359
360
const sass::string& var (a->variable ());
360
361
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
+ }
361
368
if (a->is_default ()) {
362
369
if (env->has_global (var)) {
363
370
ExpressionObj e = Cast<Expression>(env->get_global (var));
You can’t perform that action at this time.
0 commit comments