Skip to content

Conversation

@flbulgarelli
Copy link
Member

This is a work in progress since I want to add this check as an inspection instead of an smell, due to backward compatibility issues.

Copy link
Member

@julian-berbel julian-berbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

hasUnusedParameters (js "function x(m2, m2) { g(m1); return m2 } ") `shouldBe` False

it "is False when uses all its parameters in return" $ do
hasUnusedParameters (js "function x(m2, m2) { return m1 + m2 } ") `shouldBe` False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe parameters in these two tests should be x(m1, m2)

describe "hasUnusedParameters" $ do
it "is False for methods of all kinds" $ do
hasUnusedParameters (js "var o = {x: function(m) { return 4; }}") `shouldBe` False
hasUnusedParameters (js "var o = {x: function(m) { return m; }}") `shouldBe` False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants