From e22373836954ec63d8b039f3167319c0acd276d3 Mon Sep 17 00:00:00 2001 From: Leonardo Balter Date: Sat, 6 Feb 2016 09:58:36 -0200 Subject: [PATCH] Remove tests for Proxy enumerate Ref #495 --- .../Proxy/enumerate/call-parameters.js | 30 ---------------- .../built-ins/Proxy/enumerate/null-handler.js | 20 ----------- .../result-not-an-object-throws-boolean.js | 23 ------------ .../result-not-an-object-throws-number.js | 23 ------------ .../result-not-an-object-throws-string.js | 23 ------------ .../result-not-an-object-throws-symbol.js | 24 ------------- .../result-not-an-object-throws-undefined.js | 23 ------------ .../Proxy/enumerate/return-is-abrupt.js | 23 ------------ .../enumerate/return-trap-result-no-value.js | 23 ------------ .../Proxy/enumerate/return-trap-result.js | 36 ------------------- .../Proxy/enumerate/trap-is-not-callable.js | 25 ------------- .../Proxy/enumerate/trap-is-undefined.js | 22 ------------ 12 files changed, 295 deletions(-) delete mode 100644 test/built-ins/Proxy/enumerate/call-parameters.js delete mode 100644 test/built-ins/Proxy/enumerate/null-handler.js delete mode 100644 test/built-ins/Proxy/enumerate/result-not-an-object-throws-boolean.js delete mode 100644 test/built-ins/Proxy/enumerate/result-not-an-object-throws-number.js delete mode 100644 test/built-ins/Proxy/enumerate/result-not-an-object-throws-string.js delete mode 100644 test/built-ins/Proxy/enumerate/result-not-an-object-throws-symbol.js delete mode 100644 test/built-ins/Proxy/enumerate/result-not-an-object-throws-undefined.js delete mode 100644 test/built-ins/Proxy/enumerate/return-is-abrupt.js delete mode 100644 test/built-ins/Proxy/enumerate/return-trap-result-no-value.js delete mode 100644 test/built-ins/Proxy/enumerate/return-trap-result.js delete mode 100644 test/built-ins/Proxy/enumerate/trap-is-not-callable.js delete mode 100644 test/built-ins/Proxy/enumerate/trap-is-undefined.js diff --git a/test/built-ins/Proxy/enumerate/call-parameters.js b/test/built-ins/Proxy/enumerate/call-parameters.js deleted file mode 100644 index b87cbace43..0000000000 --- a/test/built-ins/Proxy/enumerate/call-parameters.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - Trap called as trap.call(handler, target) -info: > - [[Enumerate]] () - - 8. Let trapResult be Call(trap, handler, «target»). ----*/ - -var x, _target, _handler; -var target = { - attr: 1 -}; -var handler = { - enumerate: function(t) { - _target = t; - _handler = this; - } -}; -var p = new Proxy(target, handler); - -try { - for (x in p) {} -} catch(e) {} - -assert.sameValue(_handler, handler); -assert.sameValue(_target, target); diff --git a/test/built-ins/Proxy/enumerate/null-handler.js b/test/built-ins/Proxy/enumerate/null-handler.js deleted file mode 100644 index de38e66229..0000000000 --- a/test/built-ins/Proxy/enumerate/null-handler.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - 2. If handler is null, throw a TypeError exception. ----*/ - -var x; -var p = Proxy.revocable({}, {}); - -p.revoke(); - -assert.throws(TypeError, function() { - for (x in p.proxy) { - x; - } -}); diff --git a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-boolean.js b/test/built-ins/Proxy/enumerate/result-not-an-object-throws-boolean.js deleted file mode 100644 index 05fcd28b9b..0000000000 --- a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-boolean.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - The result must be an Object ----*/ - -var x; -var target = { - attr: 1 -}; -var p = new Proxy(target, { - enumerate: function() { - return true; - } -}); - -assert.throws(TypeError, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-number.js b/test/built-ins/Proxy/enumerate/result-not-an-object-throws-number.js deleted file mode 100644 index acd98fb004..0000000000 --- a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-number.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - The result must be an Object ----*/ - -var x; -var target = { - attr: 1 -}; -var p = new Proxy(target, { - enumerate: function() { - return 1; - } -}); - -assert.throws(TypeError, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-string.js b/test/built-ins/Proxy/enumerate/result-not-an-object-throws-string.js deleted file mode 100644 index 71a63f9c7f..0000000000 --- a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-string.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - The result must be an Object ----*/ - -var x; -var target = { - attr: 1 -}; -var p = new Proxy(target, { - enumerate: function() { - return ""; - } -}); - -assert.throws(TypeError, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-symbol.js b/test/built-ins/Proxy/enumerate/result-not-an-object-throws-symbol.js deleted file mode 100644 index f17559d24b..0000000000 --- a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-symbol.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - The result must be an Object -features: [Symbol] ----*/ - -var x; -var target = { - attr: 1 -}; -var p = new Proxy(target, { - enumerate: function() { - return Symbol(); - } -}); - -assert.throws(TypeError, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-undefined.js b/test/built-ins/Proxy/enumerate/result-not-an-object-throws-undefined.js deleted file mode 100644 index 6e0651ce98..0000000000 --- a/test/built-ins/Proxy/enumerate/result-not-an-object-throws-undefined.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - The result must be an Object ----*/ - -var x; -var target = { - attr: 1 -}; -var p = new Proxy(target, { - enumerate: function() { - return undefined; - } -}); - -assert.throws(TypeError, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/return-is-abrupt.js b/test/built-ins/Proxy/enumerate/return-is-abrupt.js deleted file mode 100644 index e669e17886..0000000000 --- a/test/built-ins/Proxy/enumerate/return-is-abrupt.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - Trap returns abrupt. -info: > - [[Enumerate]] () - - 8. Let trapResult be Call(trap, handler, «target»). - 9. ReturnIfAbrupt(trapResult). ----*/ - -var x; -var p = new Proxy({}, { - enumerate: function(t) { - throw new Test262Error(); - } -}); - -assert.throws(Test262Error, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/return-trap-result-no-value.js b/test/built-ins/Proxy/enumerate/return-trap-result-no-value.js deleted file mode 100644 index 208150d55d..0000000000 --- a/test/built-ins/Proxy/enumerate/return-trap-result-no-value.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - Trap returns an iterator whose IteratorResult does not contain a value - property. -info: > - [[Enumerate]] () - - 11. Return trapResult ----*/ - -var x; -var p = new Proxy([1,2,3], { - enumerate: function(t) { - return {next: function() { return { done:true }; } }; - } -}); - -for (x in p) { - $ERROR("returned iterable interface from trap is flagged as done."); -} diff --git a/test/built-ins/Proxy/enumerate/return-trap-result.js b/test/built-ins/Proxy/enumerate/return-trap-result.js deleted file mode 100644 index 7d4678def2..0000000000 --- a/test/built-ins/Proxy/enumerate/return-trap-result.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - Trap returns a iterable result. -info: > - [[Enumerate]] () - - 11. Return trapResult -includes: [compareArray.js] ----*/ - -var x; -var iter = [ - {done: false, value: 1}, - {done: false, value: 2}, - {done: false, value: 3}, - {done: true, value: 42} -]; -var target = { - attr: 1 -}; -var foo = { bar: 1 }; -var p = new Proxy(target, { - enumerate: function() { - return { next: function() { return iter.shift(); } }; - } -}); - -var results = []; -for (x in p) { - results.push(x); -} - -assert(compareArray(results, [1,2,3])); diff --git a/test/built-ins/Proxy/enumerate/trap-is-not-callable.js b/test/built-ins/Proxy/enumerate/trap-is-not-callable.js deleted file mode 100644 index 1af02ef4c2..0000000000 --- a/test/built-ins/Proxy/enumerate/trap-is-not-callable.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - Trap is not callable. -info: > - [[Enumerate]] () - - 5. Let trap be GetMethod(handler, "enumerate"). - ... - - 7.3.9 GetMethod (O, P) - - 5. If IsCallable(func) is false, throw a TypeError exception. ----*/ - -var x; -var p = new Proxy({attr:1}, { - enumerate: {} -}); - -assert.throws(TypeError, function() { - for (x in p) {} -}); diff --git a/test/built-ins/Proxy/enumerate/trap-is-undefined.js b/test/built-ins/Proxy/enumerate/trap-is-undefined.js deleted file mode 100644 index 71efad48d2..0000000000 --- a/test/built-ins/Proxy/enumerate/trap-is-undefined.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2015 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -es6id: 9.5.11 -description: > - [[Enumerate]] () - - 7. If trap is undefined, then Return target.[[Enumerate]](). ----*/ - -var x; -var target = { - attr: 1 -}; -var p = new Proxy(target, {}); - -var count = 0; -for (x in p) { - count++; -} - -assert.sameValue(count, 1);