Fix String.asInterpolation().

We were checking if its contents was an Interpolation, when we should
have been checking for an Expression.
This commit is contained in:
Natalie Weizenbaum 2017-01-06 16:51:20 -08:00
parent f5b04abd8b
commit a7c6a1ad5b
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,9 @@
* Fix a few more small `@extend` bugs.
* Fix a bug where interpolation in a quoted string was being dropped in some
circumstances.
## 1.0.0-alpha.6
* Allow `var()` to be passed to `rgb()`, `rgba()`, `hsl()`, and `hsla()`.

View File

@ -55,8 +55,9 @@ class StringExpression implements Expression {
var buffer = new InterpolationBuffer();
if (quote != null) buffer.writeCharCode(quote);
for (var value in text.contents) {
if (value is Interpolation) {
buffer.addInterpolation(value);
assert(value is Expression || value is String);
if (value is Expression) {
buffer.add(value);
} else if (value is String) {
for (var i = 0; i < value.length; i++) {
var codeUnit = value.codeUnitAt(i);