From f3cd58335f699c238efc07d9cb5fee9697419217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Sat, 2 Sep 2017 00:28:09 +0200 Subject: [PATCH] Remove duplicate property keys from getOwnPropertyDescriptors Because Proxies no longer allow to return duplicate property keys. --- .../duplicate-keys.js | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 test/built-ins/Object/getOwnPropertyDescriptors/duplicate-keys.js diff --git a/test/built-ins/Object/getOwnPropertyDescriptors/duplicate-keys.js b/test/built-ins/Object/getOwnPropertyDescriptors/duplicate-keys.js deleted file mode 100644 index f67145cfac..0000000000 --- a/test/built-ins/Object/getOwnPropertyDescriptors/duplicate-keys.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2016 Jordan Harband. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: Object.getOwnPropertyDescriptors on a proxy with duplicate ownKeys should work -esid: sec-object.getownpropertydescriptors -author: Jordan Harband -features: [Proxy] ----*/ - -var i = 0; -var descriptors = [ - { enumerable: false, value: "A1", writable: true, configurable: true }, - { enumerable: true, value: "A2", writable: true, configurable: true } -]; -var log = ''; -var proxy = new Proxy({}, { - ownKeys() { - log += 'ownKeys|'; - return ['DUPLICATE', 'DUPLICATE', 'DUPLICATE']; - }, - getOwnPropertyDescriptor(t, name) { - log += 'getOwnPropertyDescriptor:' + name + '|'; - return descriptors[i++]; - } -}); - -var result = Object.getOwnPropertyDescriptors(proxy); -assert.sameValue(result.hasOwnProperty('DUPLICATE'), true); - -var lastDescriptor = descriptors[descriptors.length - 1]; -assert.notSameValue(result.DUPLICATE, lastDescriptor); -assert.sameValue(result.DUPLICATE.enumerable, lastDescriptor.enumerable); -assert.sameValue(result.DUPLICATE.configurable, lastDescriptor.configurable); -assert.sameValue(result.DUPLICATE.value, lastDescriptor.value); -assert.sameValue(result.DUPLICATE.writable, lastDescriptor.writable); - -assert.sameValue(log, 'ownKeys|getOwnPropertyDescriptor:DUPLICATE|getOwnPropertyDescriptor:DUPLICATE|getOwnPropertyDescriptor:DUPLICATE|');