From 2c1aed0db6e639625b8ae6842cb74f1c91c4657f Mon Sep 17 00:00:00 2001 From: Leo Balter <leonardo.balter@gmail.com> Date: Mon, 13 Mar 2017 18:43:41 -0400 Subject: [PATCH] Fix duplicate function declarations (#905) Fixes #771 --- test/language/expressions/delete/S11.4.1_A3.1.js | 6 ------ test/language/expressions/this/S11.1.1_A3.1.js | 12 ++++++------ test/language/expressions/this/S11.1.1_A3.2.js | 12 ++++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/test/language/expressions/delete/S11.4.1_A3.1.js b/test/language/expressions/delete/S11.4.1_A3.1.js index 8a5fd33e89..ed59b3e6c4 100644 --- a/test/language/expressions/delete/S11.4.1_A3.1.js +++ b/test/language/expressions/delete/S11.4.1_A3.1.js @@ -27,13 +27,7 @@ if (delete MyFunction !== false) { } //CHECK#4 -function MyFunction(){}; var MyObject = new MyFunction(); if (delete MyObject !== false) { $ERROR('#4: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'); } - -//CHECK#5 -if (delete MyObject !== false) { - $ERROR('#5: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'); -} diff --git a/test/language/expressions/this/S11.1.1_A3.1.js b/test/language/expressions/this/S11.1.1_A3.1.js index 13e1d3fdde..6b18913a0d 100644 --- a/test/language/expressions/this/S11.1.1_A3.1.js +++ b/test/language/expressions/this/S11.1.1_A3.1.js @@ -11,13 +11,13 @@ flags: [noStrict] ---*/ //CHECK#1 -function MyFunction() {return this} -if (MyFunction() !== this) { - $ERROR('#1: function MyFunction() {return this} MyFunction() === this. Actual: ' + (MyFunction())); +function ReturnThis() {return this} +if (ReturnThis() !== this) { + $ERROR('#1: function ReturnThis() {return this} ReturnThis() === this. Actual: ' + (ReturnThis())); } //CHECK#2 -function MyFunction() {return eval("this")} -if (MyFunction() !== this) { - $ERROR('#2: function MyFunction() {return eval("this")} MyFunction() === this. Actual: ' + (MyFunction())); +function ReturnEvalThis() {return eval("this")} +if (ReturnEvalThis() !== this) { + $ERROR('#2: function ReturnEvalThis() {return eval("this")} ReturnEvalThis() === this. Actual: ' + (ReturnEvalThis())); } diff --git a/test/language/expressions/this/S11.1.1_A3.2.js b/test/language/expressions/this/S11.1.1_A3.2.js index 4e0ce6e96e..3fed52eb33 100644 --- a/test/language/expressions/this/S11.1.1_A3.2.js +++ b/test/language/expressions/this/S11.1.1_A3.2.js @@ -11,13 +11,13 @@ flags: [noStrict] ---*/ //CHECK#1 -function MyFunction() {this.THIS = this} -if ((new MyFunction()).THIS.toString() !== "[object Object]") { - $ERROR('#1: function MyFunction() {this.THIS = this} (new MyFunction()).THIS.toString() !== "[object Object]". Actual: ' + ((new MyFunction()).THIS.toString())); +function SetThis() {this.THIS = this} +if ((new SetThis()).THIS.toString() !== "[object Object]") { + $ERROR('#1: function SetThis() {this.THIS = this} (new SetThis()).THIS.toString() !== "[object Object]". Actual: ' + ((new SetThis()).THIS.toString())); } //CHECK#2 -function MyFunction() {this.THIS = eval("this")} -if ((new MyFunction()).THIS.toString() !== "[object Object]") { - $ERROR('#2: function MyFunction() {this.THIS = eval("this")} (new MyFunction()).THIS.toString() !== "[object Object]". Actual: ' + ((new MyFunction()).THIS.toString())); +function SetEvalThis() {this.THIS = eval("this")} +if ((new SetEvalThis()).THIS.toString() !== "[object Object]") { + $ERROR('#2: function SetEvalThis() {this.THIS = eval("this")} (new SetEvalThis()).THIS.toString() !== "[object Object]". Actual: ' + ((new SetEvalThis()).THIS.toString())); } -- GitLab