c0e64350ed4ffa536f094cf0fbee532c8a315f1e
[platform/framework/web/crosswalk-tizen.git] /
1 /**
2  * @fileoverview Rule to flag when using new Function
3  * @author Ilya Volodin
4  */
5
6 "use strict";
7
8 //------------------------------------------------------------------------------
9 // Rule Definition
10 //------------------------------------------------------------------------------
11
12 module.exports = function(context) {
13
14     return {
15
16         "NewExpression": function(node) {
17             if (node.callee.name === "Function") {
18                 context.report(node, "The Function constructor is eval.");
19             }
20         }
21     };
22
23 };