Skip to content

Commit 90b6b39

Browse files
authored
Remove useless _currentCallable property in the evaluate visitor (#2570)
Since #2474, the _currentCallable property is not used anymore (except for restoring its state)
1 parent 1a5e0ee commit 90b6b39

File tree

3 files changed

+65
-126
lines changed

3 files changed

+65
-126
lines changed

lib/src/deprecation.dart

Lines changed: 64 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -18,167 +18,118 @@ enum Deprecation {
1818
// Checksum: c57ab2eb07ab1df48581b8484ef9bdbad0ddceaa
1919

2020
/// Deprecation for passing a string directly to meta.call().
21-
callString(
22-
'call-string',
23-
deprecatedIn: '0.0.0',
24-
description: 'Passing a string directly to meta.call().',
25-
),
21+
callString('call-string',
22+
deprecatedIn: '0.0.0',
23+
description: 'Passing a string directly to meta.call().'),
2624

2725
/// Deprecation for @elseif.
2826
elseif('elseif', deprecatedIn: '1.3.2', description: '@elseif.'),
2927

3028
/// Deprecation for @-moz-document.
31-
mozDocument(
32-
'moz-document',
33-
deprecatedIn: '1.7.2',
34-
description: '@-moz-document.',
35-
),
29+
mozDocument('moz-document',
30+
deprecatedIn: '1.7.2', description: '@-moz-document.'),
3631

3732
/// Deprecation for imports using relative canonical URLs.
38-
relativeCanonical(
39-
'relative-canonical',
40-
deprecatedIn: '1.14.2',
41-
description: 'Imports using relative canonical URLs.',
42-
),
33+
relativeCanonical('relative-canonical',
34+
deprecatedIn: '1.14.2',
35+
description: 'Imports using relative canonical URLs.'),
4336

4437
/// Deprecation for declaring new variables with !global.
45-
newGlobal(
46-
'new-global',
47-
deprecatedIn: '1.17.2',
48-
description: 'Declaring new variables with !global.',
49-
),
38+
newGlobal('new-global',
39+
deprecatedIn: '1.17.2',
40+
description: 'Declaring new variables with !global.'),
5041

5142
/// Deprecation for using color module functions in place of plain CSS functions.
52-
colorModuleCompat(
53-
'color-module-compat',
54-
deprecatedIn: '1.23.0',
55-
description:
56-
'Using color module functions in place of plain CSS functions.',
57-
),
43+
colorModuleCompat('color-module-compat',
44+
deprecatedIn: '1.23.0',
45+
description:
46+
'Using color module functions in place of plain CSS functions.'),
5847

5948
/// Deprecation for / operator for division.
60-
slashDiv(
61-
'slash-div',
62-
deprecatedIn: '1.33.0',
63-
description: '/ operator for division.',
64-
),
49+
slashDiv('slash-div',
50+
deprecatedIn: '1.33.0', description: '/ operator for division.'),
6551

6652
/// Deprecation for leading, trailing, and repeated combinators.
67-
bogusCombinators(
68-
'bogus-combinators',
69-
deprecatedIn: '1.54.0',
70-
description: 'Leading, trailing, and repeated combinators.',
71-
),
53+
bogusCombinators('bogus-combinators',
54+
deprecatedIn: '1.54.0',
55+
description: 'Leading, trailing, and repeated combinators.'),
7256

7357
/// Deprecation for ambiguous + and - operators.
74-
strictUnary(
75-
'strict-unary',
76-
deprecatedIn: '1.55.0',
77-
description: 'Ambiguous + and - operators.',
78-
),
58+
strictUnary('strict-unary',
59+
deprecatedIn: '1.55.0', description: 'Ambiguous + and - operators.'),
7960

8061
/// Deprecation for passing invalid units to built-in functions.
81-
functionUnits(
82-
'function-units',
83-
deprecatedIn: '1.56.0',
84-
description: 'Passing invalid units to built-in functions.',
85-
),
62+
functionUnits('function-units',
63+
deprecatedIn: '1.56.0',
64+
description: 'Passing invalid units to built-in functions.'),
8665

8766
/// Deprecation for using !default or !global multiple times for one variable.
88-
duplicateVarFlags(
89-
'duplicate-var-flags',
90-
deprecatedIn: '1.62.0',
91-
description: 'Using !default or !global multiple times for one variable.',
92-
),
67+
duplicateVarFlags('duplicate-var-flags',
68+
deprecatedIn: '1.62.0',
69+
description:
70+
'Using !default or !global multiple times for one variable.'),
9371

9472
/// Deprecation for passing null as alpha in the ${isJS ? 'JS': 'Dart'} API.
95-
nullAlpha(
96-
'null-alpha',
97-
deprecatedIn: '1.62.3',
98-
description: 'Passing null as alpha in the ${isJS ? 'JS' : 'Dart'} API.',
99-
),
73+
nullAlpha('null-alpha',
74+
deprecatedIn: '1.62.3',
75+
description: 'Passing null as alpha in the ${isJS ? 'JS' : 'Dart'} API.'),
10076

10177
/// Deprecation for passing percentages to the Sass abs() function.
102-
absPercent(
103-
'abs-percent',
104-
deprecatedIn: '1.65.0',
105-
description: 'Passing percentages to the Sass abs() function.',
106-
),
78+
absPercent('abs-percent',
79+
deprecatedIn: '1.65.0',
80+
description: 'Passing percentages to the Sass abs() function.'),
10781

10882
/// Deprecation for using the current working directory as an implicit load path.
109-
fsImporterCwd(
110-
'fs-importer-cwd',
111-
deprecatedIn: '1.73.0',
112-
description:
113-
'Using the current working directory as an implicit load path.',
114-
),
83+
fsImporterCwd('fs-importer-cwd',
84+
deprecatedIn: '1.73.0',
85+
description:
86+
'Using the current working directory as an implicit load path.'),
11587

11688
/// Deprecation for function and mixin names beginning with --.
117-
cssFunctionMixin(
118-
'css-function-mixin',
119-
deprecatedIn: '1.76.0',
120-
description: 'Function and mixin names beginning with --.',
121-
),
89+
cssFunctionMixin('css-function-mixin',
90+
deprecatedIn: '1.76.0',
91+
description: 'Function and mixin names beginning with --.'),
12292

12393
/// Deprecation for declarations after or between nested rules.
124-
mixedDecls(
125-
'mixed-decls',
126-
deprecatedIn: '1.77.7',
127-
description: 'Declarations after or between nested rules.',
128-
),
94+
mixedDecls('mixed-decls',
95+
deprecatedIn: '1.77.7',
96+
description: 'Declarations after or between nested rules.'),
12997

13098
/// Deprecation for meta.feature-exists
131-
featureExists(
132-
'feature-exists',
133-
deprecatedIn: '1.78.0',
134-
description: 'meta.feature-exists',
135-
),
99+
featureExists('feature-exists',
100+
deprecatedIn: '1.78.0', description: 'meta.feature-exists'),
136101

137102
/// Deprecation for certain uses of built-in sass:color functions.
138-
color4Api(
139-
'color-4-api',
140-
deprecatedIn: '1.79.0',
141-
description: 'Certain uses of built-in sass:color functions.',
142-
),
103+
color4Api('color-4-api',
104+
deprecatedIn: '1.79.0',
105+
description: 'Certain uses of built-in sass:color functions.'),
143106

144107
/// Deprecation for using global color functions instead of sass:color.
145-
colorFunctions(
146-
'color-functions',
147-
deprecatedIn: '1.79.0',
148-
description: 'Using global color functions instead of sass:color.',
149-
),
108+
colorFunctions('color-functions',
109+
deprecatedIn: '1.79.0',
110+
description: 'Using global color functions instead of sass:color.'),
150111

151112
/// Deprecation for legacy JS API.
152-
legacyJsApi(
153-
'legacy-js-api',
154-
deprecatedIn: '1.79.0',
155-
description: 'Legacy JS API.',
156-
),
113+
legacyJsApi('legacy-js-api',
114+
deprecatedIn: '1.79.0', description: 'Legacy JS API.'),
157115

158116
/// Deprecation for @import rules.
159117
import('import', deprecatedIn: '1.80.0', description: '@import rules.'),
160118

161119
/// Deprecation for global built-in functions that are available in sass: modules.
162-
globalBuiltin(
163-
'global-builtin',
164-
deprecatedIn: '1.80.0',
165-
description:
166-
'Global built-in functions that are available in sass: modules.',
167-
),
120+
globalBuiltin('global-builtin',
121+
deprecatedIn: '1.80.0',
122+
description:
123+
'Global built-in functions that are available in sass: modules.'),
168124

169125
/// Deprecation for functions named "type".
170-
typeFunction(
171-
'type-function',
172-
deprecatedIn: '1.86.0',
173-
description: 'Functions named "type".',
174-
),
126+
typeFunction('type-function',
127+
deprecatedIn: '1.86.0', description: 'Functions named "type".'),
175128

176129
/// Deprecation for passing a relative url to compileString().
177-
compileStringRelativeUrl(
178-
'compile-string-relative-url',
179-
deprecatedIn: '1.88.0',
180-
description: 'Passing a relative url to compileString().',
181-
),
130+
compileStringRelativeUrl('compile-string-relative-url',
131+
deprecatedIn: '1.88.0',
132+
description: 'Passing a relative url to compileString().'),
182133

183134
// END AUTOGENERATED CODE
184135

lib/src/visitor/async_evaluate.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ final class _EvaluateVisitor
210210
/// The human-readable name of the current stack frame.
211211
var _member = "root stylesheet";
212212

213-
/// The innermost user-defined callable that's being invoked.
214-
UserDefinedCallable<AsyncEnvironment>? _currentCallable;
215-
216213
/// The node for the innermost callable that's being invoked.
217214
///
218215
/// This is used to produce warnings for function calls. It's stored as an
@@ -3383,9 +3380,7 @@ final class _EvaluateVisitor
33833380
var name = callable.name;
33843381
if (name != "@content") name += "()";
33853382

3386-
var oldCallable = _currentCallable;
33873383
var oldInDependency = _inDependency;
3388-
_currentCallable = callable;
33893384
_inDependency = callable.inDependency;
33903385
var result = await _withStackFrame(name, nodeWithSpan, () {
33913386
// Add an extra closure() call so that modifications to the environment
@@ -3473,7 +3468,6 @@ final class _EvaluateVisitor
34733468
});
34743469
});
34753470
});
3476-
_currentCallable = oldCallable;
34773471
_inDependency = oldInDependency;
34783472
return result;
34793473
}

lib/src/visitor/evaluate.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_evaluate.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 607745b48d0737b3be112d0a8753dd87492fcc31
8+
// Checksum: 05d8589b401932198e1f52434066ea4d6cbf3756
99
//
1010
// ignore_for_file: unused_import
1111

@@ -218,9 +218,6 @@ final class _EvaluateVisitor
218218
/// The human-readable name of the current stack frame.
219219
var _member = "root stylesheet";
220220

221-
/// The innermost user-defined callable that's being invoked.
222-
UserDefinedCallable<Environment>? _currentCallable;
223-
224221
/// The node for the innermost callable that's being invoked.
225222
///
226223
/// This is used to produce warnings for function calls. It's stored as an
@@ -3384,9 +3381,7 @@ final class _EvaluateVisitor
33843381
var name = callable.name;
33853382
if (name != "@content") name += "()";
33863383

3387-
var oldCallable = _currentCallable;
33883384
var oldInDependency = _inDependency;
3389-
_currentCallable = callable;
33903385
_inDependency = callable.inDependency;
33913386
var result = _withStackFrame(name, nodeWithSpan, () {
33923387
// Add an extra closure() call so that modifications to the environment
@@ -3474,7 +3469,6 @@ final class _EvaluateVisitor
34743469
});
34753470
});
34763471
});
3477-
_currentCallable = oldCallable;
34783472
_inDependency = oldInDependency;
34793473
return result;
34803474
}

0 commit comments

Comments
 (0)