JS: InconsistentNew regression test

This commit is contained in:
Asger F
2019-09-08 15:11:54 +01:00
parent bdc409ccb6
commit dbfd0ae03b
4 changed files with 11 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
| arraydef.js:1:1:1:19 | function Array() {} | Function Array is sometimes invoked as a constructor (for example $@), and sometimes as a normal function (for example $@). | arraycalls.js:2:1:2:13 | new Array(45) | here | arraycalls.js:1:1:1:9 | Array(45) | here |
| m.js:1:8:1:22 | functio ... = x;\\n} | Function A is sometimes invoked as a constructor (for example $@), and sometimes as a normal function (for example $@). | c1.js:2:1:2:9 | new A(42) | here | c2.js:2:1:2:5 | A(23) | here |
| tst.js:1:1:1:22 | functio ... = y;\\n} | Function Point is sometimes invoked as a constructor (for example $@), and sometimes as a normal function (for example $@). | tst.js:6:1:6:17 | new Point(23, 42) | here | tst.js:7:1:7:13 | Point(56, 72) | here |

View File

@@ -0,0 +1,2 @@
Array(45); // OK
new Array(45); // OK

View File

@@ -0,0 +1,2 @@
function Array() {}
Array.prototype.foo = function() {};

View File

@@ -1,4 +1,10 @@
function Error() {}
Error.prototype.toString = function() {};
function String() {}
String.prototype.toString = function() {};
function Array() {}
Array.prototype.toString = function() {};
//semmle-extractor-options: --externs