JS: Ignore strict-mode-call-stack-introspection for expr stmts

This commit is contained in:
Asger Feldthaus
2020-01-13 15:50:30 +00:00
parent ad0ad3a3e4
commit 73e60a7400
4 changed files with 16 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
| tst.js:5:30:5:45 | arguments.callee | Strict mode code cannot use arguments.callee. |
| tst.js:7:21:7:36 | arguments.callee | Strict mode code cannot use arguments.callee. |
| tst.js:9:20:9:27 | f.caller | Strict mode code cannot use Function.prototype.caller. |
| tst.js:11:8:11:18 | f.arguments | Strict mode code cannot use Function.prototype.arguments. |
| tst.js:18:3:18:18 | arguments.callee | Strict mode code cannot use arguments.callee. |
| tst.js:31:5:31:14 | foo.caller | Strict mode code cannot use Function.prototype.caller. |
| tst.js:31:5:31:14 | foo.caller | Strict mode code cannot use arguments.caller. |
| tst.js:11:17:11:27 | f.arguments | Strict mode code cannot use Function.prototype.arguments. |
| tst.js:18:10:18:25 | arguments.callee | Strict mode code cannot use arguments.callee. |
| tst.js:31:12:31:21 | foo.caller | Strict mode code cannot use Function.prototype.caller. |
| tst.js:31:12:31:21 | foo.caller | Strict mode code cannot use arguments.caller. |

View File

@@ -8,14 +8,14 @@ var o = {
// BAD
console.log(f.caller);
// BAD
f.arguments;
this.y = f.arguments;
this.x = x;
}
};
var D = class extends function() {
// BAD
arguments.callee;
return arguments.callee;
} {};
function g() {
@@ -28,6 +28,11 @@ function g() {
function h() {
var foo = Math.random() > 0.5 ? h : arguments;
// BAD
foo.caller;
return foo.caller;
}
})();
})();
(function() {
'use strict';
arguments.caller; // OK - avoid duplicate alert from useless-expression
})();