Fix analysis errors (#1470)

This commit is contained in:
Jennifer Thakar 2021-09-09 15:35:12 -07:00 committed by GitHub
parent 78aacbcda2
commit f06937e2df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View File

@ -1,7 +1,6 @@
name: sass_analysis name: sass_analysis
version: 0.0.0 version: 0.0.0
description: Shared analysis options for Sass team packages. description: Shared analysis options for Sass team packages.
author: Sass Team
homepage: https://github.com/sass/dart-sass/tree/master/analysis homepage: https://github.com/sass/dart-sass/tree/master/analysis
publish_to: none publish_to: none

View File

@ -149,7 +149,9 @@ class ArgumentDeclaration implements SassNode {
if (names.contains(argument.name)) return false; if (names.contains(argument.name)) return false;
} else if (names.contains(argument.name)) { } else if (names.contains(argument.name)) {
namedUsed++; namedUsed++;
} else if (argument.defaultValue == null) return false; } else if (argument.defaultValue == null) {
return false;
}
} }
if (restArgument != null) return true; if (restArgument != null) return true;

View File

@ -5,7 +5,7 @@
import 'package:js/js.dart'; import 'package:js/js.dart';
@JS("Function") @JS("Function")
class JSFunction implements Function { class JSFunction {
external JSFunction(String arg1, [String? arg2, String? arg3]); external JSFunction(String arg1, [String? arg2, String? arg3]);
// Note that this just invokes the function with the given arguments, rather // Note that this just invokes the function with the given arguments, rather

View File

@ -73,7 +73,7 @@ class SassTypes {
} }
@JS() @JS()
class NodeSassBooleanClass implements Function { class NodeSassBooleanClass {
external NodeSassBoolean call(); external NodeSassBoolean call();
external NodeSassBoolean get TRUE; external NodeSassBoolean get TRUE;
external NodeSassBoolean get FALSE; external NodeSassBoolean get FALSE;
@ -124,13 +124,13 @@ class NodeSassMap {
} }
@JS() @JS()
class NodeSassNullClass implements Function { class NodeSassNullClass {
external Object call(); external Object call();
external NodeSassNull get NULL; external NodeSassNull get NULL;
} }
@JS() @JS()
class NodeSassNull implements Function { class NodeSassNull {
external Constructor get constructor; external Constructor get constructor;
} }

View File

@ -108,8 +108,9 @@ void main() {
test( test(
"lists with undefined separators are reported as having space " "lists with undefined separators are reported as having space "
"separators", () { "separators", () {
expect(parseValue("()").getSeparator(), isFalse); expect(parseValue<NodeSassList>("()").getSeparator(), isFalse);
expect(parseValue("join((), 1px)").getSeparator(), isFalse); expect(
parseValue<NodeSassList>("join((), 1px)").getSeparator(), isFalse);
}); });
test("has a useful .constructor.name", () { test("has a useful .constructor.name", () {