Skip to content

Commit

Permalink
Fix analysis errors (#1470)
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak authored Sep 9, 2021
1 parent 78aacbc commit f06937e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion analysis/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: sass_analysis
version: 0.0.0
description: Shared analysis options for Sass team packages.
author: Sass Team
homepage: https://github.com/sass/dart-sass/tree/master/analysis

publish_to: none
Expand Down
4 changes: 3 additions & 1 deletion lib/src/ast/sass/argument_declaration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ class ArgumentDeclaration implements SassNode {
if (names.contains(argument.name)) return false;
} else if (names.contains(argument.name)) {
namedUsed++;
} else if (argument.defaultValue == null) return false;
} else if (argument.defaultValue == null) {
return false;
}
}

if (restArgument != null) return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/node/function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'package:js/js.dart';

@JS("Function")
class JSFunction implements Function {
class JSFunction {
external JSFunction(String arg1, [String? arg2, String? arg3]);

// Note that this just invokes the function with the given arguments, rather
Expand Down
6 changes: 3 additions & 3 deletions test/node_api/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SassTypes {
}

@JS()
class NodeSassBooleanClass implements Function {
class NodeSassBooleanClass {
external NodeSassBoolean call();
external NodeSassBoolean get TRUE;
external NodeSassBoolean get FALSE;
Expand Down Expand Up @@ -124,13 +124,13 @@ class NodeSassMap {
}

@JS()
class NodeSassNullClass implements Function {
class NodeSassNullClass {
external Object call();
external NodeSassNull get NULL;
}

@JS()
class NodeSassNull implements Function {
class NodeSassNull {
external Constructor get constructor;
}

Expand Down
5 changes: 3 additions & 2 deletions test/node_api/value/list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ void main() {
test(
"lists with undefined separators are reported as having space "
"separators", () {
expect(parseValue("()").getSeparator(), isFalse);
expect(parseValue("join((), 1px)").getSeparator(), isFalse);
expect(parseValue<NodeSassList>("()").getSeparator(), isFalse);
expect(
parseValue<NodeSassList>("join((), 1px)").getSeparator(), isFalse);
});

test("has a useful .constructor.name", () {
Expand Down

0 comments on commit f06937e

Please sign in to comment.