From c779cba592fcb39051fd1d467e472ea71aa2b1d6 Mon Sep 17 00:00:00 2001
From: Kevin Gibbons <bakkot@gmail.com>
Date: Tue, 22 Nov 2016 08:59:37 -0800
Subject: [PATCH] Remove tests for arguments.caller (#797)

---
 .../unique-per-realm-non-simple.js            |  3 ---
 .../unique-per-realm-unmapped-args.js         |  3 ---
 test/language/arguments-object/10.6-13-1.js   | 13 ----------
 .../arguments-object/10.6-13-b-1-s.js         | 15 ------------
 .../arguments-object/10.6-13-b-2-s.js         | 14 -----------
 .../arguments-object/10.6-13-b-3-s.js         | 20 ----------------
 test/language/arguments-object/10.6-14-1-s.js |  3 +--
 .../arguments-object/10.6-14-b-1-s.js         | 24 -------------------
 .../arguments-object/10.6-14-b-4-s.js         | 17 -------------
 .../arguments-object/arguments-caller.js      | 12 ++++++++++
 10 files changed, 13 insertions(+), 111 deletions(-)
 delete mode 100644 test/language/arguments-object/10.6-13-1.js
 delete mode 100644 test/language/arguments-object/10.6-13-b-1-s.js
 delete mode 100644 test/language/arguments-object/10.6-13-b-2-s.js
 delete mode 100644 test/language/arguments-object/10.6-13-b-3-s.js
 delete mode 100644 test/language/arguments-object/10.6-14-b-1-s.js
 delete mode 100644 test/language/arguments-object/10.6-14-b-4-s.js
 create mode 100644 test/language/arguments-object/arguments-caller.js

diff --git a/test/built-ins/ThrowTypeError/unique-per-realm-non-simple.js b/test/built-ins/ThrowTypeError/unique-per-realm-non-simple.js
index 8566c0e412..d526a506e9 100755
--- a/test/built-ins/ThrowTypeError/unique-per-realm-non-simple.js
+++ b/test/built-ins/ThrowTypeError/unique-per-realm-non-simple.js
@@ -19,9 +19,6 @@ function nonSimple(a = 0) {
   return arguments;
 }
 var unmappedCalleeDesc = Object.getOwnPropertyDescriptor(nonSimple(), "callee");
-var unmappedCallerDesc = Object.getOwnPropertyDescriptor(nonSimple(), "caller");
 
 assert.sameValue(ThrowTypeError, unmappedCalleeDesc.get, "callee.get");
 assert.sameValue(ThrowTypeError, unmappedCalleeDesc.set, "callee.set");
-assert.sameValue(ThrowTypeError, unmappedCallerDesc.get, "caller.get");
-assert.sameValue(ThrowTypeError, unmappedCallerDesc.set, "caller.set");
diff --git a/test/built-ins/ThrowTypeError/unique-per-realm-unmapped-args.js b/test/built-ins/ThrowTypeError/unique-per-realm-unmapped-args.js
index 2640da55fd..89f43c4e50 100755
--- a/test/built-ins/ThrowTypeError/unique-per-realm-unmapped-args.js
+++ b/test/built-ins/ThrowTypeError/unique-per-realm-unmapped-args.js
@@ -20,9 +20,6 @@ function strictFn() {
   return arguments;
 }
 var unmappedCalleeDesc = Object.getOwnPropertyDescriptor(strictFn(), "callee");
-var unmappedCallerDesc = Object.getOwnPropertyDescriptor(strictFn(), "caller");
 
 assert.sameValue(ThrowTypeError, unmappedCalleeDesc.get, "callee.get");
 assert.sameValue(ThrowTypeError, unmappedCalleeDesc.set, "callee.set");
-assert.sameValue(ThrowTypeError, unmappedCallerDesc.get, "caller.get");
-assert.sameValue(ThrowTypeError, unmappedCallerDesc.set, "caller.set");
diff --git a/test/language/arguments-object/10.6-13-1.js b/test/language/arguments-object/10.6-13-1.js
deleted file mode 100644
index a3dd382755..0000000000
--- a/test/language/arguments-object/10.6-13-1.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2012 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-es5id: 10.6-13-1
-description: Accessing caller property of Arguments object is allowed
-flags: [noStrict]
----*/
-
-function testcase() {
-    arguments.caller;
- }
-testcase();
diff --git a/test/language/arguments-object/10.6-13-b-1-s.js b/test/language/arguments-object/10.6-13-b-1-s.js
deleted file mode 100644
index efa479cf3f..0000000000
--- a/test/language/arguments-object/10.6-13-b-1-s.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2012 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-es5id: 10.6-13-b-1-s
-description: >
-    Accessing caller property of Arguments object throws TypeError in
-    strict mode
-flags: [onlyStrict]
----*/
-
-
-assert.throws(TypeError, function() {
-    arguments.caller;
-});
diff --git a/test/language/arguments-object/10.6-13-b-2-s.js b/test/language/arguments-object/10.6-13-b-2-s.js
deleted file mode 100644
index 598e0e46c6..0000000000
--- a/test/language/arguments-object/10.6-13-b-2-s.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2012 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-es5id: 10.6-13-b-2-s
-description: arguments.caller exists in strict mode
-flags: [onlyStrict]
----*/
-
-function testcase() {
-  var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
-  assert.notSameValue(desc, undefined);
- }
-testcase();
diff --git a/test/language/arguments-object/10.6-13-b-3-s.js b/test/language/arguments-object/10.6-13-b-3-s.js
deleted file mode 100644
index f9417de122..0000000000
--- a/test/language/arguments-object/10.6-13-b-3-s.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2012 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-es5id: 10.6-13-b-3-s
-description: arguments.caller is non-configurable in strict mode
-flags: [onlyStrict]
----*/
-
-function testcase() {
-  var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
-
-  assert.sameValue(desc.configurable, false, 'desc.configurable');
-  assert.sameValue(desc.enumerable, false, 'desc.enumerable');
-  assert.sameValue(desc.hasOwnProperty('value'), false, 'desc.hasOwnProperty("value")');
-  assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
-  assert.sameValue(desc.hasOwnProperty('get'), true, 'desc.hasOwnProperty("get")');
-  assert.sameValue(desc.hasOwnProperty('set'), true, 'desc.hasOwnProperty("set")');
- }
-testcase();
diff --git a/test/language/arguments-object/10.6-14-1-s.js b/test/language/arguments-object/10.6-14-1-s.js
index 3056e4ed64..fc3514e90d 100644
--- a/test/language/arguments-object/10.6-14-1-s.js
+++ b/test/language/arguments-object/10.6-14-1-s.js
@@ -3,7 +3,7 @@
 
 /*---
 es5id: 10.6-14-1-s
-description: Strict Mode - 'callee' exists and 'caller' exists under strict mode
+description: Strict Mode - 'callee' exists under strict mode
 flags: [onlyStrict]
 ---*/
 
@@ -12,4 +12,3 @@ flags: [onlyStrict]
         } ();
 
 assert(argObj.hasOwnProperty("callee"), 'argObj.hasOwnProperty("callee") !== true');
-assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');
diff --git a/test/language/arguments-object/10.6-14-b-1-s.js b/test/language/arguments-object/10.6-14-b-1-s.js
deleted file mode 100644
index fa13bbcbfd..0000000000
--- a/test/language/arguments-object/10.6-14-b-1-s.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2012 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-es5id: 10.6-14-b-1-s
-description: >
-    Strict Mode - [[Enumerable]] attribute value in 'caller' is false
-    under strict mode
-flags: [onlyStrict]
----*/
-
-        var argObj = function () {
-            return arguments;
-        } ();
-
-        var verifyEnumerable = false;
-        for (var _10_6_14_b_1 in argObj) {
-            if (argObj.hasOwnProperty(_10_6_14_b_1) && _10_6_14_b_1 === "caller") {
-                verifyEnumerable = true;
-            }
-        }
-
-assert.sameValue(verifyEnumerable, false, 'verifyEnumerable');
-assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');
diff --git a/test/language/arguments-object/10.6-14-b-4-s.js b/test/language/arguments-object/10.6-14-b-4-s.js
deleted file mode 100644
index 2ac9023bb9..0000000000
--- a/test/language/arguments-object/10.6-14-b-4-s.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) 2012 Ecma International.  All rights reserved.
-// This code is governed by the BSD license found in the LICENSE file.
-
-/*---
-es5id: 10.6-14-b-4-s
-description: >
-    Strict Mode - TypeError is thrown when accessing the [[Set]]
-    attribute in 'caller' under strict mode
-flags: [onlyStrict]
----*/
-
-        var argObj = function () {
-            return arguments;
-        } ();
-assert.throws(TypeError, function() {
-            argObj.caller = {};
-});
diff --git a/test/language/arguments-object/arguments-caller.js b/test/language/arguments-object/arguments-caller.js
new file mode 100644
index 0000000000..ef4b051385
--- /dev/null
+++ b/test/language/arguments-object/arguments-caller.js
@@ -0,0 +1,12 @@
+// Copyright (c) 2016 Kevin Gibbons.  All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-arguments-exotic-objects
+description: arguments.caller does not exist
+---*/
+
+function getArguments() {
+  return arguments;
+}
+assert.sameValue(Object.getOwnPropertyDescriptor(getArguments(), 'caller'), undefined, 'arguments.caller does not exist');
-- 
GitLab