Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: no-new-func rule catching eval case of MemberExpression #14860

Merged
merged 16 commits into from
Sep 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Chore: additional test for Function.bind
archmoj committed Aug 27, 2021
commit 885ed3a52886e20320c96a89241058664e2e46ab
7 changes: 7 additions & 0 deletions tests/lib/rules/no-new-func.js
Original file line number Diff line number Diff line change
@@ -76,6 +76,13 @@ ruleTester.run("no-new-func", rule, {
type: "MemberExpression"
}]
},
{
code: "var a = Function.bind(null, \"b\", \"c\", \"return b+c\");",
errors: [{
messageId: "noFunctionConstructor",
type: "MemberExpression"
}]
},
{
code: "const fn = () => { class Function {} }; new Function('', '')",
parserOptions: {