mirror of
https://github.com/github/codeql.git
synced 2025-12-22 03:36:30 +01:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
17
javascript/ql/src/NodeJS/examples/DubiousImport.js
Normal file
17
javascript/ql/src/NodeJS/examples/DubiousImport.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// point.js
|
||||
function Point(x, y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
Point.prototype.distance = function() {
|
||||
return Math.sqrt(this.x*this.x+this.y*this.y);
|
||||
};
|
||||
|
||||
module.exports = Point;
|
||||
|
||||
// client.js
|
||||
var Point = require('./point').Point;
|
||||
|
||||
var pyth = new Point(3, 4);
|
||||
console.log(pyth.distance());
|
||||
Reference in New Issue
Block a user