node.references = [];
}
if (node instanceof AST_SymbolLambda) {
- defun.def_function(node, defun);
+ defun.def_function(node, node.name == "arguments" ? undefined : defun);
}
else if (node instanceof AST_SymbolDefun) {
// Careful here, the scope where this should be defined is
}
expect_stdout: "undefined"
}
+
+issue_2728_1: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ typeofs: true,
+ }
+ input: {
+ (function arguments() {
+ console.log(typeof arguments);
+ })();
+ }
+ expect: {
+ (function arguments() {
+ console.log(typeof arguments);
+ })();
+ }
+ expect_stdout: "object"
+}
+
+issue_2728_2: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ typeofs: true,
+ }
+ input: {
+ function arguments() {
+ return typeof arguments;
+ }
+ console.log(typeof arguments, arguments());
+ }
+ expect: {
+ function arguments() {
+ return typeof arguments;
+ }
+ console.log(typeof arguments, arguments());
+ }
+ expect_stdout: "function object"
+}
+
+issue_2728_3: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ typeofs: true,
+ }
+ input: {
+ (function() {
+ function arguments() {
+ }
+ console.log(typeof arguments);
+ })();
+ }
+ expect: {
+ (function() {
+ function arguments() {
+ }
+ console.log("function");
+ })();
+ }
+ expect_stdout: "function"
+}
+
+issue_2728_4: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ typeofs: true,
+ }
+ input: {
+ function arguments() {
+ }
+ console.log(typeof arguments);
+ }
+ expect: {
+ function arguments() {
+ }
+ console.log("function");
+ }
+ expect_stdout: "function"
+}
+
+issue_2728_5: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ typeofs: true,
+ }
+ input: {
+ (function arguments(arguments) {
+ console.log(typeof arguments);
+ })();
+ }
+ expect: {
+ (function arguments(arguments) {
+ console.log(typeof arguments);
+ })();
+ }
+ expect_stdout: "undefined"
+}
+
+issue_2728_6: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ typeofs: true,
+ }
+ input: {
+ function arguments(arguments) {
+ return typeof arguments;
+ }
+ console.log(typeof arguments, arguments());
+ }
+ expect: {
+ function arguments(arguments) {
+ return typeof arguments;
+ }
+ console.log(typeof arguments, arguments());
+ }
+ expect_stdout: "function undefined"
+}