Commit Graph

1138 Commits

Author SHA1 Message Date
Natalie Weizenbaum
742023a877 Always track variables' source spans
This is necessary for generating useful error messages for
/-as-division.
2021-05-11 13:24:20 -07:00
Christophe Coevoet
be2d3e848a
Fix argument names in str-slice errors (#1303) 2021-05-05 17:02:14 -07:00
Natalie Weizenbaum
574e76326e
Fix a couple doc comment typos (#1302) 2021-04-30 16:46:06 -07:00
Awjin Ahn
30ede40732
Fix extending selectors across multiple modules. (#1298)
* Fix extending selectors across multiple modules.

Allows more than one module to extend the same upstream selector that,
in turn, extends a selector from its upstream module.

Properly skips creating an extra extension that was being counted as
unresolved when evaluating @extends.

See https://github.com/sass/sass-spec/pull/1635
Fixes https://github.com/sass/dart-sass/issues/1295
2021-04-28 14:19:12 -07:00
Natalie Weizenbaum
45c1333276
Properly reset variables in the loop in _peekIndentation() (#1288)
Closes #1287
2021-04-19 12:41:57 -07:00
Henry Catalini Smith
11d09cffd7
Add -w shorthand for --watch CLI flag (#1276)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:23:05 -07:00
Christophe Coevoet
39f19bef98
Fix the name of the blackness argument (#1264)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:22:43 -07:00
Awjin Ahn
2ab4f8061c
Fix deprecation warning typo. (#1247)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:22:02 -07:00
Christophe Coevoet
fbd9cfd8a2
Fix a bunch of typos in comments (#1257)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:01:07 -07:00
Christophe Coevoet
7106bac9e2
Fix typos in the doc of SimpleSelector (#1251)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 13:55:30 -07:00
Natalie Weizenbaum
c2e02a50da Use ?[] instead of .andGet() 2021-04-14 19:11:10 -07:00
Natalie Weizenbaum
5535458edb Fix broken specs 2021-04-14 17:15:09 -07:00
awjin
af0f25cb0e Fix broken tests 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
102d3cedc2 Make the IO interface align with the VM API 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
654744f5f4 Fix bogus null assertions 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
de013bf8ac Make spans universally non-nullable 2021-04-14 17:15:09 -07:00
Natalie Weizenbaum
3ead2e2bb5 Split out an Extender class from Extension
This gets rid of the weird subset of "one-off" extensions which didn't
have target information available. Now instead, each method explicitly
declares whether it takes/returns extensions (which do have target
info) or extenders (which do not).
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
8fd3c1ba03 Rename Extender to ExtensionStore
"Extender" is also commonly used to refer to the parent selector of an
`@extend` rule, so this helps disambiguate.
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
e85d9a7afc Fix automated migrator errors
This gets the project analyzer-clean, but the tests are still failing.
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
81d952dc7d Automated null-safety migration 2021-04-14 17:15:08 -07:00
Jennifer Thakar
dfbdae0d71 Prepare for null-safety migration 2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
8fdb281e83 Make the first parameter to ImportCache() named, not mandatory
It was always valid to pass in `null`, this just makes it more clear.
2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
984e76ef77 Remove type parameters from recursive AST visitors 2021-04-14 17:15:08 -07:00
Natalie Weizenbaum
21e7ec19dc Split Declaration's constructor into two
This doesn't explicitly help null-safety, but it makes the
relationship between `Declaration.value` and `Declaration.children`
more obvious.
2021-04-14 17:15:03 -07:00
Natalie Weizenbaum
ca3c6f5ccc Refactor how style rules interact with at-root
This is more friendly to null-safe code, since we no longer rely on
`_inStyleRule` implying that `_styleRule != null`.
2021-04-12 17:31:11 -07:00
Natalie Weizenbaum
5d0ad6957b Split IfClause into ElseClause
This allows us to be statically explicit about when the expression
does or doesn't exist.
2021-04-12 17:31:11 -07:00
Natalie Weizenbaum
3fa2b1d98a Fix hints and lints 2021-04-12 17:31:11 -07:00
Jennifer Thakar
247cb3d816 Update dependencies to null-safe versions
This also replaces package_resolver with package_config, since
package_resolver is archived and is incompatible with null-safe Dart
packages.
2021-04-12 17:31:09 -07:00
Awjin Ahn
ad4a1692a8
Adds RenderOptions to the context of custom functions. (#1236) 2021-02-18 13:48:47 -08:00
Awjin Ahn
4ea9fff2bb
Let last !default value of @forward...with be commaless. (#1226)
This advances the scanner to the next line even if the !default
identifier is not followed by a comma.
2021-02-04 14:18:19 -08:00
Natalie Weizenbaum
2682992bd4
Split SassNumber into separate subclasses based on units (#1221)
This allows us to use more efficient implementations in the common
case where numbers don't have complex units.

See #113
2021-02-02 17:37:56 -08:00
Mary
058cf0e4df
Fix fuzzyAssertRange, RangeError takes ints as min/max 2021-01-29 13:34:31 -05:00
Natalie Weizenbaum
934bdd556a
Set RangeError.start and .end for color range checks (#1215)
This is useful for sass/dart-sass-embedded#32 because it makes the
range checks easier to deconstruct and reconstruct into useful
embedded error messages.
2021-01-27 15:50:02 -08:00
Natalie Weizenbaum
474956d9a8
Merge branch 'master' into node-api-bugs 2021-01-19 18:38:41 -08:00
Christophe Coevoet
f0720f204d
Implement proper handling of units in for loops (#1200)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-01-19 18:37:41 -08:00
Natalie Weizenbaum
072c5252ca Wrap fiber.yield() calls in runZoned()
This resets the current zone after the fiber returns, where otherwise
it could end up set to a different zone entirely, since Dart's Zone
API is unaware of fibers.

Closes #1204
2021-01-15 16:14:35 -08:00
Natalie Weizenbaum
f93feaf592 Don't try to cast an error to JsError
Dart's runtime understanding of what a "JsError" is isn't sufficient
to make sense of everything that might be thrown by, for example, a
custom function with an error.
2021-01-15 16:14:20 -08:00
Natalie Weizenbaum
66cb55c76f
Avoid throw/catch in Number.== (#1188)
Throwing and catching exceptions is expensive. Testing this on one
user's number-heavy codebase resulted in a 2x speed improvement.
2021-01-11 13:41:37 -08:00
Natalie Weizenbaum
01231e2f4c
Print the values of deprecated numbers passed to color functions (#1184)
See #1174
2021-01-06 15:17:53 -08:00
Natalie Weizenbaum
f24a2b9ca4
Avoid permissions errors in _realCasePath. (#1181)
This catches permissions errors and treats them as indicating that the
path component we have so far is canonical. This also improves the
efficiency of case matching by caching results for higher directories.
2021-01-06 12:49:45 -08:00
Sam Rawlins
006e6aa62f
Remove unnecessary imports (#1177)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2020-12-30 14:57:50 -08:00
Natalie Weizenbaum
bae2968757 Deprecate incorrect HSL units
Partially addresses #1174
2020-12-29 13:26:54 -08:00
Natalie Weizenbaum
f9a9373547 Print the LHS first in incompatible unit errors
Closes #766
2020-12-28 18:06:59 -08:00
Natalie Weizenbaum
d532f015f6 Improve error reporting for incompatible units
The new messages more consistently include argument names and actual
values. Errors about mixed unitless and unitful numbers are now more
consistent.
2020-12-28 17:58:55 -08:00
Natalie Weizenbaum
7ba7351148 Mark deprecation warnings as such 2020-12-28 14:44:00 -08:00
Natalie Weizenbaum
02c92aa7cd
Add support for clamp() as a special math function (#1168)
Closes #1146
See sass/sass#2860
2020-12-28 13:42:04 -08:00
Natalie Weizenbaum
bf623752fb
Avoid always downcasing file paths on Windows (#1172)
Closes #1169
2020-12-23 18:07:20 -08:00
Sam Rawlins
5aeef4ce81
Remove unused dart:async imports (#1160) 2020-12-09 14:20:51 -08:00
Natalie Weizenbaum
a13f7be81b
Apply the change in #1139 to the asynchronous source file (#1150) 2020-11-19 17:44:36 -08:00
Jennifer Thakar
4f1f5c9de8
Fix for importers that return null in load (#1139) 2020-11-10 09:44:37 -08:00