aboutsummaryrefslogtreecommitdiff
path: root/test/compress/issue-2719.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-05 19:36:02 +0800
committerGitHub <noreply@github.com>2018-01-05 19:36:02 +0800
commit7f2a591c7ecdb13a20bbad5e7c614672dd890431 (patch)
treeb910855717b17a1b9edee369458769d46ac21b76 /test/compress/issue-2719.js
parentafbcebddf63c7ffa5b0df9b3712ee3b560918f1e (diff)
downloadtracifyjs-7f2a591c7ecdb13a20bbad5e7c614672dd890431.tar.gz
tracifyjs-7f2a591c7ecdb13a20bbad5e7c614672dd890431.zip
warn on deprecated features (#2726)
- `function.arguments` - `function.callers` fixes #2719
Diffstat (limited to 'test/compress/issue-2719.js')
-rw-r--r--test/compress/issue-2719.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/issue-2719.js b/test/compress/issue-2719.js
new file mode 100644
index 00000000..93e51d7c
--- /dev/null
+++ b/test/compress/issue-2719.js
@@ -0,0 +1,32 @@
+warn: {
+ options = {
+ evaluate: true,
+ inline: true,
+ passes: 2,
+ properties: true,
+ reduce_funcs: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ function f() {
+ return g();
+ }
+ function g() {
+ return g["call" + "er"].arguments;
+ }
+ // 3
+ console.log(f(1, 2, 3).length);
+ }
+ expect: {
+ // TypeError: Cannot read property 'arguments' of null
+ console.log(function g() {
+ return g.caller.arguments;
+ }().length);
+ }
+ expect_warnings: [
+ "WARN: Function.protoype.caller not supported [test/compress/issue-2719.js:17,19]",
+ "WARN: Function.protoype.arguments not supported [test/compress/issue-2719.js:17,19]",
+ ]
+}