From 52a706c0223d446394256a748b384f70cc72afc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= <andre.bargull@gmail.com> Date: Thu, 13 Aug 2015 17:42:21 +0200 Subject: [PATCH] Replace runTestCase with assert, try-finally, [test/built-ins/Array] --- .../concat/15.4.4.4-5-b-iii-3-b-1.js | 13 ++++------- .../prototype/concat/15.4.4.4-5-c-i-1.js | 17 +++++--------- .../Array/prototype/every/15.4.4.16-1-10.js | 12 ++-------- .../Array/prototype/every/15.4.4.16-1-13.js | 12 ++-------- .../Array/prototype/every/15.4.4.16-1-3.js | 14 +++-------- .../Array/prototype/every/15.4.4.16-1-5.js | 13 +++-------- .../Array/prototype/every/15.4.4.16-2-12.js | 12 ++-------- .../Array/prototype/every/15.4.4.16-2-15.js | 19 ++++----------- .../Array/prototype/every/15.4.4.16-2-18.js | 14 ++++------- .../Array/prototype/every/15.4.4.16-2-2.js | 12 ++-------- .../Array/prototype/every/15.4.4.16-2-4.js | 14 ++--------- .../Array/prototype/every/15.4.4.16-7-b-10.js | 12 +++------- .../Array/prototype/every/15.4.4.16-7-b-11.js | 12 +++------- .../Array/prototype/every/15.4.4.16-7-b-12.js | 11 ++------- .../Array/prototype/every/15.4.4.16-7-b-13.js | 11 ++------- .../Array/prototype/every/15.4.4.16-7-b-15.js | 10 +------- .../Array/prototype/every/15.4.4.16-7-b-6.js | 10 +------- .../Array/prototype/every/15.4.4.16-7-b-7.js | 10 +------- .../prototype/every/15.4.4.16-7-c-i-12.js | 11 ++------- .../prototype/every/15.4.4.16-7-c-i-14.js | 12 ++-------- .../prototype/every/15.4.4.16-7-c-i-16.js | 11 +-------- .../prototype/every/15.4.4.16-7-c-i-19.js | 14 ++++------- .../prototype/every/15.4.4.16-7-c-i-20.js | 13 +++-------- .../prototype/every/15.4.4.16-7-c-i-22.js | 13 ++--------- .../prototype/every/15.4.4.16-7-c-i-23.js | 16 +++---------- .../prototype/every/15.4.4.16-7-c-i-4.js | 12 ++-------- .../prototype/every/15.4.4.16-7-c-i-6.js | 13 +++-------- .../prototype/every/15.4.4.16-7-c-i-8.js | 12 ++-------- .../Array/prototype/filter/15.4.4.20-1-10.js | 12 ++-------- .../Array/prototype/filter/15.4.4.20-1-13.js | 13 ++--------- .../Array/prototype/filter/15.4.4.20-1-3.js | 11 +-------- .../Array/prototype/filter/15.4.4.20-1-5.js | 12 ++-------- .../Array/prototype/filter/15.4.4.20-2-12.js | 13 +++-------- .../Array/prototype/filter/15.4.4.20-2-15.js | 18 +++------------ .../Array/prototype/filter/15.4.4.20-2-4.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-b-10.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-b-11.js | 13 +++-------- .../prototype/filter/15.4.4.20-9-b-12.js | 11 ++------- .../prototype/filter/15.4.4.20-9-b-13.js | 11 ++------- .../prototype/filter/15.4.4.20-9-b-15.js | 11 ++------- .../Array/prototype/filter/15.4.4.20-9-b-6.js | 11 ++------- .../Array/prototype/filter/15.4.4.20-9-b-7.js | 11 ++------- .../prototype/filter/15.4.4.20-9-c-i-12.js | 12 +++------- .../prototype/filter/15.4.4.20-9-c-i-14.js | 13 +++-------- .../prototype/filter/15.4.4.20-9-c-i-16.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-c-i-19.js | 13 +++-------- .../prototype/filter/15.4.4.20-9-c-i-20.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-c-i-22.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-c-i-23.js | 17 ++++---------- .../prototype/filter/15.4.4.20-9-c-i-4.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-c-i-6.js | 12 ++-------- .../prototype/filter/15.4.4.20-9-c-i-8.js | 12 ++-------- .../Array/prototype/forEach/15.4.4.18-1-10.js | 12 ++-------- .../Array/prototype/forEach/15.4.4.18-1-13.js | 12 ++-------- .../Array/prototype/forEach/15.4.4.18-1-3.js | 11 +-------- .../Array/prototype/forEach/15.4.4.18-1-5.js | 12 ++-------- .../Array/prototype/forEach/15.4.4.18-2-12.js | 10 +------- .../Array/prototype/forEach/15.4.4.18-2-15.js | 17 +++----------- .../Array/prototype/forEach/15.4.4.18-2-4.js | 10 +------- .../prototype/forEach/15.4.4.18-7-b-10.js | 13 +++-------- .../prototype/forEach/15.4.4.18-7-b-11.js | 13 +++-------- .../prototype/forEach/15.4.4.18-7-b-12.js | 12 ++-------- .../prototype/forEach/15.4.4.18-7-b-13.js | 12 ++-------- .../prototype/forEach/15.4.4.18-7-b-15.js | 11 +-------- .../prototype/forEach/15.4.4.18-7-b-6.js | 12 ++-------- .../prototype/forEach/15.4.4.18-7-b-7.js | 12 ++-------- .../prototype/forEach/15.4.4.18-7-c-i-12.js | 12 ++-------- .../prototype/forEach/15.4.4.18-7-c-i-14.js | 12 ++-------- .../prototype/forEach/15.4.4.18-7-c-i-16.js | 11 +-------- .../prototype/forEach/15.4.4.18-7-c-i-19.js | 11 +-------- .../prototype/forEach/15.4.4.18-7-c-i-20.js | 11 +-------- .../prototype/forEach/15.4.4.18-7-c-i-22.js | 12 +--------- .../prototype/forEach/15.4.4.18-7-c-i-23.js | 15 ++---------- .../prototype/forEach/15.4.4.18-7-c-i-4.js | 11 +-------- .../prototype/forEach/15.4.4.18-7-c-i-6.js | 11 +-------- .../prototype/forEach/15.4.4.18-7-c-i-8.js | 11 +-------- .../Array/prototype/indexOf/15.4.4.14-1-10.js | 12 ++-------- .../Array/prototype/indexOf/15.4.4.14-1-13.js | 13 +++-------- .../Array/prototype/indexOf/15.4.4.14-1-17.js | 15 +++--------- .../Array/prototype/indexOf/15.4.4.14-1-3.js | 12 ++-------- .../Array/prototype/indexOf/15.4.4.14-1-5.js | 12 ++-------- .../Array/prototype/indexOf/15.4.4.14-2-12.js | 10 +------- .../Array/prototype/indexOf/15.4.4.14-2-18.js | 14 ++++------- .../Array/prototype/indexOf/15.4.4.14-2-2.js | 13 +++-------- .../Array/prototype/indexOf/15.4.4.14-2-4.js | 13 +---------- .../prototype/indexOf/15.4.4.14-9-a-10.js | 11 +-------- .../prototype/indexOf/15.4.4.14-9-a-13.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-a-14.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-a-15.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-a-16.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-a-18.js | 11 +-------- .../prototype/indexOf/15.4.4.14-9-a-9.js | 11 +-------- .../prototype/indexOf/15.4.4.14-9-b-i-11.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-b-i-12.js | 10 +------- .../prototype/indexOf/15.4.4.14-9-b-i-13.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-b-i-14.js | 11 +-------- .../prototype/indexOf/15.4.4.14-9-b-i-15.js | 16 +++---------- .../prototype/indexOf/15.4.4.14-9-b-i-16.js | 17 +++----------- .../prototype/indexOf/15.4.4.14-9-b-i-19.js | 11 +-------- .../prototype/indexOf/15.4.4.14-9-b-i-21.js | 11 ++------- .../prototype/indexOf/15.4.4.14-9-b-i-22.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-b-i-23.js | 23 +++++-------------- .../prototype/indexOf/15.4.4.14-9-b-i-3.js | 11 ++------- .../prototype/indexOf/15.4.4.14-9-b-i-4.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-b-i-5.js | 11 ++------- .../prototype/indexOf/15.4.4.14-9-b-i-6.js | 12 ++-------- .../prototype/indexOf/15.4.4.14-9-b-i-7.js | 17 ++++---------- .../prototype/indexOf/15.4.4.14-9-b-i-8.js | 18 ++++----------- .../prototype/lastIndexOf/15.4.4.15-1-10.js | 13 ++--------- .../prototype/lastIndexOf/15.4.4.15-1-13.js | 14 +++-------- .../prototype/lastIndexOf/15.4.4.15-1-17.js | 16 ++++--------- .../prototype/lastIndexOf/15.4.4.15-1-3.js | 12 +--------- .../prototype/lastIndexOf/15.4.4.15-1-5.js | 13 ++--------- .../prototype/lastIndexOf/15.4.4.15-2-12.js | 10 +------- .../prototype/lastIndexOf/15.4.4.15-2-18.js | 15 ++++-------- .../prototype/lastIndexOf/15.4.4.15-2-2.js | 13 +++-------- .../prototype/lastIndexOf/15.4.4.15-2-4.js | 13 +++-------- .../prototype/lastIndexOf/15.4.4.15-8-a-10.js | 11 +-------- .../prototype/lastIndexOf/15.4.4.15-8-a-13.js | 12 ++-------- .../prototype/lastIndexOf/15.4.4.15-8-a-14.js | 12 ++-------- .../prototype/lastIndexOf/15.4.4.15-8-a-15.js | 12 ++-------- .../prototype/lastIndexOf/15.4.4.15-8-a-16.js | 12 ++-------- .../prototype/lastIndexOf/15.4.4.15-8-a-18.js | 11 +-------- .../prototype/lastIndexOf/15.4.4.15-8-a-9.js | 11 +-------- .../lastIndexOf/15.4.4.15-8-b-i-11.js | 12 ++-------- .../lastIndexOf/15.4.4.15-8-b-i-12.js | 10 +------- .../lastIndexOf/15.4.4.15-8-b-i-13.js | 12 ++-------- .../lastIndexOf/15.4.4.15-8-b-i-14.js | 11 +-------- .../lastIndexOf/15.4.4.15-8-b-i-15.js | 16 +++---------- .../lastIndexOf/15.4.4.15-8-b-i-16.js | 17 +++----------- .../lastIndexOf/15.4.4.15-8-b-i-19.js | 13 +++-------- .../lastIndexOf/15.4.4.15-8-b-i-20.js | 13 +++-------- .../lastIndexOf/15.4.4.15-8-b-i-21.js | 11 ++------- .../lastIndexOf/15.4.4.15-8-b-i-22.js | 12 ++-------- .../lastIndexOf/15.4.4.15-8-b-i-23.js | 23 +++++-------------- .../lastIndexOf/15.4.4.15-8-b-i-3.js | 11 ++------- .../lastIndexOf/15.4.4.15-8-b-i-4.js | 12 ++-------- .../lastIndexOf/15.4.4.15-8-b-i-5.js | 11 ++------- .../lastIndexOf/15.4.4.15-8-b-i-6.js | 12 ++-------- .../lastIndexOf/15.4.4.15-8-b-i-7.js | 18 ++++----------- .../lastIndexOf/15.4.4.15-8-b-i-8.js | 18 ++++----------- .../Array/prototype/map/15.4.4.19-1-10.js | 14 +++-------- .../Array/prototype/map/15.4.4.19-1-13.js | 12 ++-------- .../Array/prototype/map/15.4.4.19-1-3.js | 13 ++--------- .../Array/prototype/map/15.4.4.19-1-5.js | 12 ++-------- .../Array/prototype/map/15.4.4.19-2-12.js | 11 ++------- .../Array/prototype/map/15.4.4.19-2-15.js | 17 +++----------- .../Array/prototype/map/15.4.4.19-2-18.js | 11 ++------- .../Array/prototype/map/15.4.4.19-2-4.js | 12 +++------- .../Array/prototype/map/15.4.4.19-5-1.js | 22 ++++++------------ .../Array/prototype/map/15.4.4.19-8-b-10.js | 12 +++------- .../Array/prototype/map/15.4.4.19-8-b-11.js | 12 +++------- .../Array/prototype/map/15.4.4.19-8-b-12.js | 11 ++------- .../Array/prototype/map/15.4.4.19-8-b-13.js | 11 ++------- .../Array/prototype/map/15.4.4.19-8-b-15.js | 12 +++------- .../Array/prototype/map/15.4.4.19-8-b-6.js | 12 +++------- .../Array/prototype/map/15.4.4.19-8-b-7.js | 12 +++------- .../Array/prototype/map/15.4.4.19-8-c-i-12.js | 13 +---------- .../Array/prototype/map/15.4.4.19-8-c-i-14.js | 11 +-------- .../Array/prototype/map/15.4.4.19-8-c-i-16.js | 13 +---------- .../Array/prototype/map/15.4.4.19-8-c-i-19.js | 11 +-------- .../Array/prototype/map/15.4.4.19-8-c-i-22.js | 11 +-------- .../Array/prototype/map/15.4.4.19-8-c-i-23.js | 15 ++---------- .../Array/prototype/map/15.4.4.19-8-c-i-4.js | 11 +-------- .../Array/prototype/map/15.4.4.19-8-c-i-6.js | 12 ++-------- .../Array/prototype/map/15.4.4.19-8-c-i-8.js | 10 +------- .../Array/prototype/reduce/15.4.4.21-1-10.js | 13 ++--------- .../Array/prototype/reduce/15.4.4.21-1-13.js | 13 ++--------- .../Array/prototype/reduce/15.4.4.21-1-3.js | 13 +---------- .../Array/prototype/reduce/15.4.4.21-1-5.js | 11 +-------- .../Array/prototype/reduce/15.4.4.21-2-12.js | 13 ++--------- .../Array/prototype/reduce/15.4.4.21-2-15.js | 18 +++------------ .../Array/prototype/reduce/15.4.4.21-2-4.js | 10 +------- .../reduce/15.4.4.21-8-b-iii-1-12.js | 11 ++------- .../reduce/15.4.4.21-8-b-iii-1-14.js | 12 ++-------- .../reduce/15.4.4.21-8-b-iii-1-16.js | 12 ++-------- .../reduce/15.4.4.21-8-b-iii-1-19.js | 12 ++-------- .../reduce/15.4.4.21-8-b-iii-1-20.js | 11 +-------- .../reduce/15.4.4.21-8-b-iii-1-22.js | 12 +--------- .../reduce/15.4.4.21-8-b-iii-1-23.js | 17 ++------------ .../prototype/reduce/15.4.4.21-8-b-iii-1-4.js | 11 +-------- .../prototype/reduce/15.4.4.21-8-b-iii-1-6.js | 12 ++-------- .../prototype/reduce/15.4.4.21-8-b-iii-1-8.js | 14 ++--------- .../Array/prototype/reduce/15.4.4.21-8-c-4.js | 8 ------- .../prototype/reduce/15.4.4.21-9-b-10.js | 13 +++-------- .../prototype/reduce/15.4.4.21-9-b-11.js | 13 +++-------- .../prototype/reduce/15.4.4.21-9-b-12.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-b-13.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-b-15.js | 11 +-------- .../prototype/reduce/15.4.4.21-9-b-19.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-b-20.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-b-23.js | 13 +++-------- .../prototype/reduce/15.4.4.21-9-b-24.js | 13 +++-------- .../prototype/reduce/15.4.4.21-9-b-25.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-b-26.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-b-28.js | 11 +-------- .../Array/prototype/reduce/15.4.4.21-9-b-6.js | 12 ++-------- .../Array/prototype/reduce/15.4.4.21-9-b-7.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-c-i-12.js | 11 +-------- .../prototype/reduce/15.4.4.21-9-c-i-14.js | 11 +-------- .../prototype/reduce/15.4.4.21-9-c-i-16.js | 11 +-------- .../prototype/reduce/15.4.4.21-9-c-i-19.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-c-i-20.js | 11 +-------- .../prototype/reduce/15.4.4.21-9-c-i-22.js | 11 +-------- .../prototype/reduce/15.4.4.21-9-c-i-23.js | 16 ++----------- .../prototype/reduce/15.4.4.21-9-c-i-4.js | 12 ++-------- .../prototype/reduce/15.4.4.21-9-c-i-6.js | 12 +--------- .../prototype/reduce/15.4.4.21-9-c-i-8.js | 13 +---------- .../prototype/reduceRight/15.4.4.22-1-10.js | 14 +++-------- .../prototype/reduceRight/15.4.4.22-1-13.js | 14 +++-------- .../prototype/reduceRight/15.4.4.22-1-3.js | 14 +++-------- .../prototype/reduceRight/15.4.4.22-1-5.js | 14 +++-------- .../prototype/reduceRight/15.4.4.22-2-12.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-2-15.js | 19 ++++----------- .../prototype/reduceRight/15.4.4.22-2-18.js | 13 +++-------- .../prototype/reduceRight/15.4.4.22-2-4.js | 13 ++--------- .../reduceRight/15.4.4.22-8-b-iii-1-12.js | 11 +-------- .../reduceRight/15.4.4.22-8-b-iii-1-14.js | 11 +-------- .../reduceRight/15.4.4.22-8-b-iii-1-16.js | 11 +-------- .../reduceRight/15.4.4.22-8-b-iii-1-19.js | 11 +-------- .../reduceRight/15.4.4.22-8-b-iii-1-20.js | 11 +-------- .../reduceRight/15.4.4.22-8-b-iii-1-22.js | 12 +--------- .../reduceRight/15.4.4.22-8-b-iii-1-23.js | 17 ++------------ .../reduceRight/15.4.4.22-8-b-iii-1-4.js | 11 +-------- .../reduceRight/15.4.4.22-8-b-iii-1-6.js | 12 +--------- .../reduceRight/15.4.4.22-8-b-iii-1-8.js | 13 +---------- .../prototype/reduceRight/15.4.4.22-8-c-4.js | 8 ------- .../prototype/reduceRight/15.4.4.22-9-b-10.js | 13 +++-------- .../prototype/reduceRight/15.4.4.22-9-b-11.js | 13 +++-------- .../prototype/reduceRight/15.4.4.22-9-b-12.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-13.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-15.js | 11 +-------- .../prototype/reduceRight/15.4.4.22-9-b-19.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-20.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-23.js | 13 +++-------- .../prototype/reduceRight/15.4.4.22-9-b-24.js | 13 +++-------- .../prototype/reduceRight/15.4.4.22-9-b-25.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-26.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-28.js | 11 +-------- .../prototype/reduceRight/15.4.4.22-9-b-6.js | 12 ++-------- .../prototype/reduceRight/15.4.4.22-9-b-7.js | 12 ++-------- .../reduceRight/15.4.4.22-9-c-i-12.js | 11 +-------- .../reduceRight/15.4.4.22-9-c-i-14.js | 11 +-------- .../reduceRight/15.4.4.22-9-c-i-16.js | 11 +-------- .../reduceRight/15.4.4.22-9-c-i-19.js | 11 +-------- .../reduceRight/15.4.4.22-9-c-i-20.js | 11 +-------- .../reduceRight/15.4.4.22-9-c-i-22.js | 12 +--------- .../reduceRight/15.4.4.22-9-c-i-23.js | 17 ++------------ .../reduceRight/15.4.4.22-9-c-i-4.js | 11 +-------- .../reduceRight/15.4.4.22-9-c-i-6.js | 12 +--------- .../reduceRight/15.4.4.22-9-c-i-8.js | 13 +---------- .../prototype/slice/15.4.4.10-10-c-ii-1.js | 14 ++++------- .../Array/prototype/some/15.4.4.17-1-10.js | 12 ++-------- .../Array/prototype/some/15.4.4.17-1-13.js | 12 ++-------- .../Array/prototype/some/15.4.4.17-1-3.js | 12 ++-------- .../Array/prototype/some/15.4.4.17-1-5.js | 11 +-------- .../Array/prototype/some/15.4.4.17-2-12.js | 12 ++-------- .../Array/prototype/some/15.4.4.17-2-15.js | 19 ++++----------- .../Array/prototype/some/15.4.4.17-2-18.js | 14 ++++------- .../Array/prototype/some/15.4.4.17-2-2.js | 12 ++-------- .../Array/prototype/some/15.4.4.17-2-4.js | 13 ++--------- .../Array/prototype/some/15.4.4.17-7-b-10.js | 12 +++------- .../Array/prototype/some/15.4.4.17-7-b-11.js | 12 +++------- .../Array/prototype/some/15.4.4.17-7-b-12.js | 11 ++------- .../Array/prototype/some/15.4.4.17-7-b-13.js | 11 ++------- .../Array/prototype/some/15.4.4.17-7-b-15.js | 10 +------- .../Array/prototype/some/15.4.4.17-7-b-6.js | 10 +------- .../Array/prototype/some/15.4.4.17-7-b-7.js | 10 +------- .../prototype/some/15.4.4.17-7-c-i-12.js | 12 ++-------- .../prototype/some/15.4.4.17-7-c-i-14.js | 11 +-------- .../prototype/some/15.4.4.17-7-c-i-16.js | 11 +-------- .../prototype/some/15.4.4.17-7-c-i-19.js | 13 +++-------- .../prototype/some/15.4.4.17-7-c-i-20.js | 12 ++-------- .../prototype/some/15.4.4.17-7-c-i-22.js | 12 +--------- .../prototype/some/15.4.4.17-7-c-i-23.js | 16 +++---------- .../Array/prototype/some/15.4.4.17-7-c-i-4.js | 11 +-------- .../Array/prototype/some/15.4.4.17-7-c-i-6.js | 12 ++-------- .../Array/prototype/some/15.4.4.17-7-c-i-8.js | 11 +-------- .../prototype/splice/15.4.4.12-9-c-ii-1.js | 13 ++++------- 279 files changed, 578 insertions(+), 2902 deletions(-) diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js index 6213da0002..5d7c7ad6a7 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-b-iii-3-b-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.4-5-b-iii-3-b-1 description: > Array.prototype.concat will concat an Array when index property (read-only) exists in Array.prototype (Step 5.b.iii.3.b) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 100, writable: false, @@ -39,9 +36,7 @@ function testcase() { delete newArr[0]; verifyConfigurable = newArr.hasOwnProperty("0"); - return verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert(verifyWritable, 'verifyWritable !== true'); diff --git a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js index f9b0a95d1e..ffbe3c161e 100644 --- a/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js +++ b/test/built-ins/Array/prototype/concat/15.4.4.4-5-c-i-1.js @@ -6,11 +6,8 @@ es5id: 15.4.4.4-5-c-i-1 description: > Array.prototype.concat will concat an Array when index property (read-only) exists in Array.prototype (Step 5.c.i) -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { value: 100, writable: false, @@ -41,11 +38,9 @@ function testcase() { delete newArr[0]; verifyConfigurable = newArr.hasOwnProperty("0"); - return hasProperty && instanceOfVerify && verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable; - - - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(hasProperty, 'hasProperty !== true'); +assert(instanceOfVerify, 'instanceOfVerify !== true'); +assert(verifyValue, 'verifyValue !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert(verifyWritable, 'verifyWritable !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js index eae3883e3b..862cc58062 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-10.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.16-1-10 description: Array.prototype.every applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object Math]' !== Object.prototype.toString.call(obj)); } - try { Math.length = 1; Math[0] = 1; - return !Array.prototype.every.call(Math, callbackfn); - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(Math, callbackfn), false, 'Array.prototype.every.call(Math, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js index a3ef08822e..99a2a65c93 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-13.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.16-1-13 description: Array.prototype.every applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object JSON]' !== Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; - return !Array.prototype.every.call(JSON, callbackfn); - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(JSON, callbackfn), false, 'Array.prototype.every.call(JSON, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js index 63ec4d5cee..f0aa17de37 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.16-1-3 description: Array.prototype.every applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return obj instanceof Boolean; } - try { Boolean.prototype[0] = 1; Boolean.prototype.length = 1; - return Array.prototype.every.call(false, callbackfn) && accessed; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(false, callbackfn), 'Array.prototype.every.call(false, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js b/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js index 894af85c45..1cb7632234 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-1-5.js @@ -4,23 +4,16 @@ /*--- es5id: 15.4.4.16-1-5 description: Array.prototype.every applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; - return Array.prototype.every.call(2.5, callbackfn) && accessed; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(2.5, callbackfn), 'Array.prototype.every.call(2.5, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js index 0fa99092d4..b6c2fbf28e 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-12.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-12 description: > Array.prototype.every - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { @@ -17,7 +15,6 @@ function testcase() { return val > 10; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -31,10 +28,5 @@ function testcase() { configurable: true }); - return Array.prototype.every.call(obj, callbackfn) && !accessed; - } finally { - delete Object.prototype.length; - } - - } -runTestCase(testcase); +assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js index d6770afebb..e8e4f71116 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-15.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.16-2-15 description: Array.prototype.every - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -18,19 +15,11 @@ function testcase() { return val > 11; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; - return Array.prototype.every.call(fnGlobalObject(), callbackfn1) && - !Array.prototype.every.call(fnGlobalObject(), callbackfn2); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(fnGlobalObject(), callbackfn1), 'Array.prototype.every.call(fnGlobalObject(), callbackfn1) !== true'); +assert.sameValue(Array.prototype.every.call(fnGlobalObject(), callbackfn2), false, 'Array.prototype.every.call(fnGlobalObject(), callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js index c0fdf9bfa9..de0fb94e0d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-18.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-18 description: > Array.prototype.every applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return parseInt(val, 10) > 1; } @@ -19,12 +17,8 @@ function testcase() { } var str = new String("432"); - try { + String.prototype[3] = "1"; - return Array.prototype.every.call(str, callbackfn1) && - !Array.prototype.every.call(str, callbackfn2); - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(str, callbackfn1), 'Array.prototype.every.call(str, callbackfn1) !== true'); +assert.sameValue(Array.prototype.every.call(str, callbackfn2), false, 'Array.prototype.every.call(str, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js index d0fac1906c..c9a1d4459d 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-2.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.16-2-2 description: Array.prototype.every - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -16,13 +14,7 @@ function testcase() { return val > 11; } - try { Array.prototype[2] = 9; - return [12, 11].every(callbackfn1) && - ![12, 11].every(callbackfn2); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true'); +assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js index b034070d9d..1538d8c711 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-2-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-2-4 description: > Array.prototype.every - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var arrProtoLen = 0; function callbackfn1(val, idx, obj) { return val > 10; @@ -19,17 +17,9 @@ function testcase() { return val > 11; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; Array.prototype[2] = 9; - return [12, 11].every(callbackfn1) && - ![12, 11].every(callbackfn2); - } finally { - Array.prototype.length = arrProtoLen; - delete Array.prototype[2]; - } - - } -runTestCase(testcase); +assert([12, 11].every(callbackfn1), '[12, 11].every(callbackfn1) !== true'); +assert.sameValue([12, 11].every(callbackfn2), false, '[12, 11].every(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js index 6143011cbd..938d3ba2bf 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-10 description: > Array.prototype.every - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return Array.prototype.every.call(arr, callbackfn) && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(arr, callbackfn), 'Array.prototype.every.call(arr, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js index 88fa11342a..8bd0b1c8ed 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-11.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-11 description: > Array.prototype.every - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return arr.every(callbackfn) && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js index 27a3ee00b8..6c2fecf4aa 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.every - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return false; @@ -28,11 +26,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return !Array.prototype.every.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js index 62ee946464..868218c955 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-13 description: > Array.prototype.every - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return false; @@ -27,11 +25,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return !arr.every(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js index 49aef9a9c5..4696de85a4 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-15 description: > Array.prototype.every - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 2 && val === "prototype") { return false; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -35,9 +32,4 @@ function testcase() { configurable: true }); - return !arr.every(callbackfn); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js index ee189be49f..a3e937b837 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-6 description: > Array.prototype.every - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return !Array.prototype.every.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.every.call(arr, callbackfn), false, 'Array.prototype.every.call(arr, callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js index f1f40c869c..1ce29f83db 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-b-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-b-7 description: > Array.prototype.every - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return !arr.every(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js index 6d75b595c8..19bb52286a 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-12.js @@ -6,10 +6,8 @@ es5id: 15.4.4.16-7-c-i-12 description: > Array.prototype.every - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 0) { return val === 10; @@ -19,7 +17,7 @@ function testcase() { } var arr = []; - try { + Array.prototype[0] = 10; Object.defineProperty(arr, "0", { @@ -29,9 +27,4 @@ function testcase() { configurable: true }); - return !arr.every(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js index 46ee18b941..6e7c7cc88b 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-14 description: > Array.prototype.every - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 5; @@ -20,7 +17,7 @@ function testcase() { } var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 5; @@ -35,9 +32,4 @@ function testcase() { configurable: true }); - return !arr.every(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.every(callbackfn), false, 'arr.every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js index 083f71cc3d..532ff09ded 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-16 description: > Array.prototype.every - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val !== 11; @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -27,9 +23,4 @@ function testcase() { configurable: true }); - return ![, , , ].every(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue([, , , ].every(callbackfn), false, '[, , , ].every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js index ccc919361f..88fffa5ced 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.every - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -24,11 +21,8 @@ function testcase() { set: function () { }, configurable: true }); - try { + Object.prototype[1] = 10; - return Array.prototype.every.call(obj, callbackfn) && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.every.call(obj, callbackfn), 'Array.prototype.every.call(obj, callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js index b4d136af25..4a98ce795c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.every - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -26,11 +23,7 @@ function testcase() { configurable: true }); - try { Array.prototype[0] = 100; - return arr.every(callbackfn) && accessed; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.every(callbackfn), 'arr.every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js index b45076a25a..0fbf17c5fa 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-22 description: > Array.prototype.every - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,16 +15,10 @@ function testcase() { return typeof val === "undefined"; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return [, ].every(callbackfn) && accessed; - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert([, ].every(callbackfn), '[, ].every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js index 84d1818f7c..5dcc93e3a3 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.16-7-c-i-23 description: > Array.prototype.every - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val !== 11; @@ -21,14 +17,8 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; - return !Array.prototype.every.call(fnGlobalObject(), callbackfn); - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.every.call(fnGlobalObject(), callbackfn), false, 'Array.prototype.every.call(fnGlobalObject(), callbackfn)'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js index 4ca15dde71..dfdcc49eb7 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-4.js @@ -6,24 +6,16 @@ es5id: 15.4.4.16-7-c-i-4 description: > Array.prototype.every - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var called = 0; function callbackfn(val, idx, obj) { called++; return val === 12; } - try { Array.prototype[0] = 11; Array.prototype[1] = 11; - return [12, 12].every(callbackfn) && called === 2; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert([12, 12].every(callbackfn), '[12, 12].every(callbackfn) !== true'); +assert.sameValue(called, 2, 'called'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js index a7dc6772ab..58101ea155 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-6 description: > Array.prototype.every - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { @@ -18,16 +15,12 @@ function testcase() { return val === 11; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; }, configurable: true }); - return [11].every(callbackfn) && accessed; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert([11].every(callbackfn), '[11].every(callbackfn) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js index 158d7d4cbf..5122c0159c 100644 --- a/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js +++ b/test/built-ins/Array/prototype/every/15.4.4.16-7-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.16-7-c-i-8 description: > Array.prototype.every - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 1) { return val !== 13; @@ -19,11 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 13; - return ![, , , ].every(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue([, , , ].every(callbackfn), false, '[, , , ].every(callbackfn)'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js index f37a264d51..7e04a5d22f 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-10.js @@ -4,22 +4,14 @@ /*--- es5id: 15.4.4.20-1-10 description: Array.prototype.filter applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return '[object Math]' === Object.prototype.toString.call(obj); } - try { Math.length = 1; Math[0] = 1; var newArr = Array.prototype.filter.call(Math, callbackfn); - return newArr[0] === 1; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js index 5fe44bc8ea..01d90636ba 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-13.js @@ -4,23 +4,14 @@ /*--- es5id: 15.4.4.20-1-13 description: Array.prototype.filter applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return '[object JSON]' === Object.prototype.toString.call(JSON); } - try { JSON.length = 1; JSON[0] = 1; var newArr = Array.prototype.filter.call(JSON, callbackfn); - return newArr[0] === 1; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js index e28ad21f8c..206fc72ec2 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-3.js @@ -4,24 +4,15 @@ /*--- es5id: 15.4.4.20-1-3 description: Array.prototype.filter applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; var newArr = Array.prototype.filter.call(false, callbackfn); - return newArr[0] === true; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(newArr[0], true, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js index 57b05bfd72..2259c056e9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-1-5.js @@ -4,23 +4,15 @@ /*--- es5id: 15.4.4.20-1-5 description: Array.prototype.filter applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; var newArr = Array.prototype.filter.call(2.5, callbackfn); - return newArr[0] === 1; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(newArr[0], 1, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js index 7e2e1c9a87..d7feb9fe71 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-12.js @@ -6,18 +6,14 @@ es5id: 15.4.4.20-2-12 description: > Array.prototype.filter - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(val, idx, obj) { accessed = true; return true; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -32,9 +28,6 @@ function testcase() { }); var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 0 && !accessed; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 0, 'newArr.length'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js index 0c1de8b5af..70ab8e9e4c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-15.js @@ -4,30 +4,18 @@ /*--- es5id: 15.4.4.20-2-15 description: Array.prototype.filter - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj.length === 2; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); - return newArr.length === 2; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js index f1e276c131..b36c82c111 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-2-4.js @@ -6,24 +6,16 @@ es5id: 15.4.4.20-2-4 description: > Array.prototype.filter - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arrProtoLen; function callbackfn(val, idx, obj) { return obj.length === 2; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; var newArr = [12, 11].filter(callbackfn); - return newArr.length === 2; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js index 8f0117671c..5a2b72963d 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-10 description: > Array.prototype.filter - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -24,13 +21,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && newArr[1] !== 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js index 91d8425dc5..c5beda40a1 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.20-9-b-11 description: > Array.prototype.filter - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return true; } @@ -24,12 +21,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; var newArr = arr.filter(callbackfn); - return newArr.length === 2 && newArr[1] !== 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.notSameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js index 971d6fb1ac..b2795b2757 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.filter - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } @@ -24,13 +22,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 3 && newArr[1] === 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js index a2c95dc80f..1a6b93b3bc 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.20-9-b-13 description: > Array.prototype.filter - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val < 3 ? true : false; } @@ -23,13 +21,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[1] === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 1, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js index bfecbab571..6ec65a0785 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-15.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-b-15 description: > Array.prototype.filter - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -33,9 +30,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[2] === "prototype"; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[2], "prototype", 'newArr[2]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js index fb6cb8546b..0fe3fbe53c 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-6.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-b-6 description: > Array.prototype.filter - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } var obj = { length: 2 }; - try { Object.defineProperty(obj, "0", { get: function () { Object.defineProperty(Object.prototype, "1", { @@ -31,9 +28,5 @@ function testcase() { var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 2 && Array[1] === 6.99; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 2, 'newArr.length'); +assert.sameValue(Array[1], 6.99, 'Array[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js index 3f5425bdb2..07895b968a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-b-7.js @@ -6,16 +6,13 @@ es5id: 15.4.4.20-9-b-7 description: > Array.prototype.filter - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return true; } var arr = [0, , 2]; - try { Object.defineProperty(arr, "0", { get: function () { Object.defineProperty(Array.prototype, "1", { @@ -31,9 +28,5 @@ function testcase() { var newArr = arr.filter(callbackfn); - return newArr.length === 3 && newArr[1] === 6.99; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 3, 'newArr.length'); +assert.sameValue(newArr[1], 6.99, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js index d5de9313b6..53fa3c59c8 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-12.js @@ -6,16 +6,14 @@ es5id: 15.4.4.20-9-c-i-12 description: > Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val === 111 && idx === 0; } var arr = []; - try { + Array.prototype[0] = 10; Object.defineProperty(arr, "0", { @@ -26,9 +24,5 @@ function testcase() { }); var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 111; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 111, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js index e1fc9a360c..2dbcb59cab 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-14.js @@ -6,17 +6,14 @@ es5id: 15.4.4.20-9-c-i-14 description: > Array.prototype.filter - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 5; @@ -32,9 +29,5 @@ function testcase() { }); var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js index bf19222a3d..d2e1b6a8c9 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-16.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-i-16 description: > Array.prototype.filter - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -24,9 +20,5 @@ function testcase() { }); var newArr = [, , , ].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js index c376762f1f..19f7889416 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 1; } @@ -21,13 +18,9 @@ function testcase() { set: function () { }, configurable: true }); - try { + Object.prototype[1] = 10; var newArr = Array.prototype.filter.call(obj, callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js index cab605947d..347c1b2f0a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.filter - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 0; } @@ -23,13 +20,8 @@ function testcase() { configurable: true }); - try { Array.prototype[0] = 100; var newArr = arr.filter(callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js index 80dea66bc5..f1aea69c89 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-22.js @@ -6,25 +6,17 @@ es5id: 15.4.4.20-9-c-i-22 description: > Array.prototype.filter - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return undefined === val && idx === 0; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); var newArr = [, ].filter(callbackfn); - return newArr.length === 1 && newArr[0] === undefined; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], undefined, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js index 65c7065850..a6a8070f54 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-23.js @@ -6,26 +6,17 @@ es5id: 15.4.4.20-9-c-i-23 description: > Array.prototype.filter - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return idx === 0 && val === 11; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; var newArr = Array.prototype.filter.call(fnGlobalObject(), callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js index 8a8df41e47..730f8e654a 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-4.js @@ -6,22 +6,14 @@ es5id: 15.4.4.20-9-c-i-4 description: > Array.prototype.filter - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return (idx === 0) && (val === 12); } - try { Array.prototype[0] = 11; var newArr = [12].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 12; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 12, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js index 60664f516a..5442b25683 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-6.js @@ -6,16 +6,12 @@ es5id: 15.4.4.20-9-c-i-6 description: > Array.prototype.filter - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return val === 11; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; @@ -24,9 +20,5 @@ function testcase() { }); var newArr = [11].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 11; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 11, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js index 461a5747e0..24277b8661 100644 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js +++ b/test/built-ins/Array/prototype/filter/15.4.4.20-9-c-i-8.js @@ -6,22 +6,14 @@ es5id: 15.4.4.20-9-c-i-8 description: > Array.prototype.filter - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return (idx === 1) && (val === 13); } - try { Array.prototype[1] = 13; var newArr = [, , , ].filter(callbackfn); - return newArr.length === 1 && newArr[0] === 13; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr.length, 1, 'newArr.length'); +assert.sameValue(newArr[0], 13, 'newArr[0]'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js index 1075b71eb0..aa3e95bc1a 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-10.js @@ -4,24 +4,16 @@ /*--- es5id: 15.4.4.18-1-10 description: Array.prototype.forEach applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = ('[object Math]' === Object.prototype.toString.call(obj)); } - try { Math.length = 1; Math[0] = 1; Array.prototype.forEach.call(Math, callbackfn); - return result; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js index a8bd710890..f0a8a9fab2 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-13.js @@ -4,23 +4,15 @@ /*--- es5id: 15.4.4.18-1-13 description: Array.prototype.forEach applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; Array.prototype.forEach.call(JSON, callbackfn); - return result; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js index 39f15fb9d4..a022e67fd9 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-3.js @@ -4,26 +4,17 @@ /*--- es5id: 15.4.4.18-1-3 description: Array.prototype.forEach applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; Array.prototype.forEach.call(false, callbackfn); - return result; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js index 1b5d8581d9..1d91a9c254 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-1-5.js @@ -4,24 +4,16 @@ /*--- es5id: 15.4.4.18-1-5 description: Array.prototype.forEach applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; Array.prototype.forEach.call(2.5, callbackfn); - return result; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js index e80245d666..ddfb0705a4 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-12.js @@ -7,16 +7,13 @@ description: > Array.prototype.forEach - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -31,10 +28,5 @@ function testcase() { }); Array.prototype.forEach.call(obj, callbackfn); - return !accessed; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js index 6405b659a5..4ffc305bd0 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-15.js @@ -4,30 +4,19 @@ /*--- es5id: 15.4.4.18-2-15 description: Array.prototype.forEach - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var result = false; function callbackfn(val, idx, obj) { result = (obj.length === 2); } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; Array.prototype.forEach.call(fnGlobalObject(), callbackfn); - return result; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js index f2e1142471..63fab39077 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-2-4.js @@ -6,24 +6,16 @@ es5id: 15.4.4.18-2-4 description: > Array.prototype.forEach - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var result = false; var arrProtoLen; function callbackfn(val, idx, obj) { result = (obj.length === 2); } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; [12, 11].forEach(callbackfn); - return result; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +assert(result, 'result !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js index 4d2baaba64..5decb3084f 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-10 description: > Array.prototype.forEach - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -31,12 +28,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.forEach.call(obj, callbackfn); - return testResult && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js index c035e4cf0c..3b9d3e7265 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-11 description: > Array.prototype.forEach - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -31,12 +28,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.forEach(callbackfn); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js index 97fa5dd6bf..fbb3fc5f6b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.forEach.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js index 47e6076727..2aeb3d93b7 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-13 description: > Array.prototype.forEach - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -28,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js index a9f7266593..919cc3f183 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-15 description: > Array.prototype.forEach - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js index 5e519a5117..5ee511ca58 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-6 description: > Array.prototype.forEach - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.forEach.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js index 556792dcb7..3c5d7780d8 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-b-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-b-7 description: > Array.prototype.forEach - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js index 27ac3e1b07..3501d59448 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-12 description: > Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -20,7 +17,7 @@ function testcase() { } var arr = []; - try { + Array.prototype[0] = 10; Object.defineProperty(arr, "0", { @@ -32,9 +29,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js index 030a7501de..6112a791cc 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-14 description: > Array.prototype.forEach - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -20,7 +17,7 @@ function testcase() { } var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 5; @@ -37,9 +34,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js index 9474fa7ce6..0ac1f6e70b 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-16 description: > Array.prototype.forEach - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -29,9 +25,4 @@ function testcase() { [, , , ].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js index 4666928731..7ac8752f53 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -27,7 +24,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Object.prototype, "1", { get: function () { return 10; @@ -37,9 +33,4 @@ function testcase() { Array.prototype.forEach.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js index 7b892e1446..4c5f348214 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.forEach - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -27,7 +24,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 100; @@ -37,9 +33,4 @@ function testcase() { arr.forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js index 3ba358eb4e..4f5b441325 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-22 description: > Array.prototype.forEach - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true @@ -27,10 +23,4 @@ function testcase() { [, 1].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js index 55b1339b42..7818c59d7d 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.18-7-c-i-23 description: > Array.prototype.forEach - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -21,17 +17,10 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; Array.prototype.forEach.call(fnGlobalObject(), callbackfn); - return testResult; - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js index a0259fb98c..833b519f97 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-4 description: > Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,14 +16,8 @@ function testcase() { } } - try { Array.prototype[0] = 11; [12].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js index 5a95ec9653..e1a7f9851c 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-6 description: > Array.prototype.forEach - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; @@ -29,9 +25,4 @@ function testcase() { [11].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js index d2efd7e9c9..a213a17a66 100644 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js +++ b/test/built-ins/Array/prototype/forEach/15.4.4.18-7-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.18-7-c-i-8 description: > Array.prototype.forEach - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(val, idx, obj) { @@ -19,14 +16,8 @@ function testcase() { } } - try { Array.prototype[1] = 13; [, , , ].forEach(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js index f77c37a11d..dbbcefece9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-10.js @@ -4,17 +4,9 @@ /*--- es5id: 15.4.4.14-1-10 description: Array.prototype.indexOf applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - try { Math[1] = true; Math.length = 2; - return Array.prototype.indexOf.call(Math, true) === 1; - } finally { - delete Math[1]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(Math, true), 1, 'Array.prototype.indexOf.call(Math, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js index a492656df6..f04b1089d6 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-13.js @@ -4,18 +4,11 @@ /*--- es5id: 15.4.4.14-1-13 description: Array.prototype.indexOf applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + JSON[3] = targetObj; JSON.length = 5; - return Array.prototype.indexOf.call(JSON, targetObj) === 3; - } finally { - delete JSON[3]; - delete JSON.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(JSON, targetObj), 3, 'Array.prototype.indexOf.call(JSON, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js index 26a8e4778b..375445d10d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-17.js @@ -4,20 +4,11 @@ /*--- es5id: 15.4.4.14-1-17 description: Array.prototype.indexOf applied to the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[1] = true; fnGlobalObject().length = 2; - return Array.prototype.indexOf.call(fnGlobalObject(), true) === 1; - } finally { - delete fnGlobalObject()[1]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), true), 1, 'Array.prototype.indexOf.call(fnGlobalObject(), true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js index 70e6ba624b..adac07916d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-3.js @@ -4,19 +4,11 @@ /*--- es5id: 15.4.4.14-1-3 description: Array.prototype.indexOf applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Boolean.prototype[1] = targetObj; Boolean.prototype.length = 2; - return Array.prototype.indexOf.call(true, targetObj) === 1; - } finally { - delete Boolean.prototype[1]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(true, targetObj), 1, 'Array.prototype.indexOf.call(true, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js index 896156aa9c..9d0a3f6fa8 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-1-5.js @@ -4,19 +4,11 @@ /*--- es5id: 15.4.4.14-1-5 description: Array.prototype.indexOf applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Number.prototype[1] = targetObj; Number.prototype.length = 2; - return Array.prototype.indexOf.call(5, targetObj) === 1; - } finally { - delete Number.prototype[1]; - delete Number.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(5, targetObj), 1, 'Array.prototype.indexOf.call(5, targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js index cb3f134ef4..c38c41d40a 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 20; @@ -25,9 +22,4 @@ function testcase() { configurable: true }); - return Array.prototype.indexOf.call(obj, 1) === -1; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, 1), -1, 'Array.prototype.indexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js index e0ba535b52..0e0c49fc48 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-18.js @@ -6,17 +6,11 @@ es5id: 15.4.4.14-2-18 description: > Array.prototype.indexOf applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { var str = new String("012"); - try { + String.prototype[3] = "3"; - return Array.prototype.indexOf.call(str, "2") === 2 && - Array.prototype.indexOf.call(str, "3") === -1; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(str, "2"), 2, 'Array.prototype.indexOf.call(str, "2")'); +assert.sameValue(Array.prototype.indexOf.call(str, "3"), -1, 'Array.prototype.indexOf.call(str, "3")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js index 1c9b02f38e..fadb62c9ac 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-2.js @@ -4,19 +4,12 @@ /*--- es5id: 15.4.4.14-2-2 description: Array.prototype.indexOf - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Array.prototype[2] = targetObj; - return [0, targetObj].indexOf(targetObj) === 1 && - [0, 1].indexOf(targetObj) === -1; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([0, targetObj].indexOf(targetObj), 1, '[0, targetObj].indexOf(targetObj)'); +assert.sameValue([0, 1].indexOf(targetObj), -1, '[0, 1].indexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js index 7537df83ab..6614dfd67b 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-2-4.js @@ -6,23 +6,12 @@ es5id: 15.4.4.14-2-4 description: > Array.prototype.indexOf - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; var arrProtoLen; - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; - return [0, targetObj].indexOf(targetObj) === 1; - - } finally { - - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); +assert.sameValue([0, targetObj].indexOf(targetObj), 1, '[0, targetObj].indexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js index 2d648413b0..0613b8931f 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-10 description: > Array.prototype.indexOf - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "0", { @@ -26,10 +23,4 @@ function testcase() { configurable: true }); - try { - return arr.indexOf(6.99) === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(6.99), 1, 'arr.indexOf(6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js index 5cf2946672..1d0e8b9e30 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-13.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-13 description: > Array.prototype.indexOf - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 2: 2, length: 20 }; Object.defineProperty(arr, "0", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return -1 === Array.prototype.indexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(arr, 1), -1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js index 2c819c8492..441d6548ea 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-14 description: > Array.prototype.indexOf - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "0", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return -1 === arr.indexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(1), -1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js index be5c7ddf72..c0cdb29c74 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-15.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; Object.defineProperty(arr, "0", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return 1 === Array.prototype.indexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(arr, 1), 1, 'Array.prototype.indexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js index 715c7b2d81..b0b90e1104 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-16 description: > Array.prototype.indexOf - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 111, 2]; Object.defineProperty(arr, "0", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return 1 === arr.indexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.indexOf(1), 1, 'arr.indexOf(1)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js index cca19813ba..dba9ebe128 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-18.js @@ -6,14 +6,10 @@ es5id: 15.4.4.14-9-a-18 description: > Array.prototype.indexOf - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 2 === arr.indexOf("prototype"); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf("prototype"), 2, 'arr.indexOf("prototype")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js index be22ec2e16..946f145166 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-a-9.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-a-9 description: > Array.prototype.indexOf - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 2 }; Object.defineProperty(arr, "0", { @@ -26,10 +23,4 @@ function testcase() { configurable: true }); - try { - return Array.prototype.indexOf.call(arr, 6.99) === 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(arr, 6.99), 1, 'Array.prototype.indexOf.call(arr, 6.99)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js index 264dee961d..91f888fe3e 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-11.js @@ -6,13 +6,10 @@ es5id: 15.4.4.14-9-b-i-11 description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Array.prototype[0] = false; Object.defineProperty(arr, "0", { get: function () { @@ -21,9 +18,4 @@ function testcase() { configurable: true }); - return 0 === arr.indexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(true), 0, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js index b81c508874..d57984392d 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-12.js @@ -7,13 +7,10 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { length: 1 }; - try { Object.prototype[0] = false; Object.defineProperty(obj, "0", { get: function () { @@ -22,9 +19,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 0, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js index 8b10ac1ce7..89e660c3a1 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-13.js @@ -6,13 +6,10 @@ es5id: 15.4.4.14-9-b-i-13 description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return false; @@ -27,9 +24,4 @@ function testcase() { configurable: true }); - return 0 === arr.indexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(true), 0, 'arr.indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js index 3f11e9c8f4..f7fa2ff9b5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-14.js @@ -7,14 +7,10 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call(obj, true), 0, 'Array.prototype.indexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js index 9b48b40cab..172a32b6b5 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.14-9-b-i-15 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 10; @@ -32,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === [, , , ].indexOf(10) && - 1 === [, , , ].indexOf(20) && - 2 === [, , , ].indexOf(30); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([, , , ].indexOf(10), 0, '[, , , ].indexOf(10)'); +assert.sameValue([, , , ].indexOf(20), 1, '[, , , ].indexOf(20)'); +assert.sameValue([, , , ].indexOf(30), 2, '[, , , ].indexOf(30)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js index 06a2388a10..7aab5413dc 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-16.js @@ -6,12 +6,8 @@ es5id: 15.4.4.14-9-b-i-16 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return 10; @@ -33,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.indexOf.call({ length: 3 }, 10) && - 1 === Array.prototype.indexOf.call({ length: 3 }, 20) && - 2 === Array.prototype.indexOf.call({ length: 3 }, 30); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 10), 0, 'Array.prototype.indexOf.call({ length: 3 }, 10)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 20), 1, 'Array.prototype.indexOf.call({ length: 3 }, 20)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, 30), 2, 'Array.prototype.indexOf.call({ length: 3 }, 30)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js index 4fd2ad3ef1..895c3a2dcc 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.indexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; Object.defineProperty(arr, "0", { @@ -19,7 +16,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 2; @@ -27,9 +23,4 @@ function testcase() { configurable: true }); - return arr.indexOf(undefined) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.indexOf(undefined), 0, 'arr.indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js index 5dbbdc8a92..da3b000c59 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-21.js @@ -6,18 +6,11 @@ es5id: 15.4.4.14-9-b-i-21 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return 0 === [, ].indexOf(undefined); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([, ].indexOf(undefined), 0, '[, ].indexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js index 437535a958..765ea49344 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-22.js @@ -6,19 +6,11 @@ es5id: 15.4.4.14-9-b-i-22 description: > Array.prototype.indexOf - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { set: function () { }, configurable: true }); - return 0 === Array.prototype.indexOf.call({ length: 1 }, undefined); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ length: 1 }, undefined), 0, 'Array.prototype.indexOf.call({ length: 1 }, undefined)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js index 048df751e1..0b4a011aef 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-23.js @@ -4,28 +4,17 @@ /*--- es5id: 15.4.4.14-9-b-i-23 description: Array.prototype.indexOf - This object is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var targetObj = {}; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = targetObj; fnGlobalObject()[100] = "100"; fnGlobalObject()[200] = "200"; fnGlobalObject().length = 200; - return 0 === Array.prototype.indexOf.call(fnGlobalObject(), targetObj) && - 100 === Array.prototype.indexOf.call(fnGlobalObject(), "100") && - -1 === Array.prototype.indexOf.call(fnGlobalObject(), "200"); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[100]; - delete fnGlobalObject()[200]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), targetObj), 0, 'Array.prototype.indexOf.call(fnGlobalObject(), targetObj)'); +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), "100"), 100, 'Array.prototype.indexOf.call(fnGlobalObject(), "100")'); +assert.sameValue(Array.prototype.indexOf.call(fnGlobalObject(), "200"), -1, 'Array.prototype.indexOf.call(fnGlobalObject(), "200")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js index 8eed802396..b25f32a114 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-3.js @@ -6,15 +6,8 @@ es5id: 15.4.4.14-9-b-i-3 description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Array.prototype[0] = false; - return [true].indexOf(true) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([true].indexOf(true), 0, '[true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js index 2e8f71094f..050883cf54 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-4.js @@ -7,16 +7,8 @@ description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = false; - return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js index 3fd67f5bc8..865f0bcc78 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-5.js @@ -6,20 +6,13 @@ es5id: 15.4.4.14-9-b-i-5 description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === [true].indexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([true].indexOf(true), 0, '[true].indexOf(true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js index 7891b45ca6..44fc076460 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-6.js @@ -7,21 +7,13 @@ description: > Array.prototype.indexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.indexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js index 24cdc01979..6c2ca2f4c9 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-7.js @@ -6,21 +6,12 @@ es5id: 15.4.4.14-9-b-i-7 description: > Array.prototype.indexOf - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Array.prototype[0] = true; Array.prototype[1] = false; Array.prototype[2] = "true"; - return 0 === [, , , ].indexOf(true) && - 1 === [, , , ].indexOf(false) && - 2 === [, , , ].indexOf("true"); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue([, , , ].indexOf(true), 0, '[, , , ].indexOf(true)'); +assert.sameValue([, , , ].indexOf(false), 1, '[, , , ].indexOf(false)'); +assert.sameValue([, , , ].indexOf("true"), 2, '[, , , ].indexOf("true")'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js index 8dc554233e..7278aa4e62 100644 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js +++ b/test/built-ins/Array/prototype/indexOf/15.4.4.14-9-b-i-8.js @@ -6,22 +6,12 @@ es5id: 15.4.4.14-9-b-i-8 description: > Array.prototype.indexOf - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = true; Object.prototype[1] = false; Object.prototype[2] = "true"; - return 0 === Array.prototype.indexOf.call({ length: 3 }, true) && - 1 === Array.prototype.indexOf.call({ length: 3 }, false) && - 2 === Array.prototype.indexOf.call({ length: 3 }, "true"); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, true), 0, 'Array.prototype.indexOf.call({ length: 3 }, true)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, false), 1, 'Array.prototype.indexOf.call({ length: 3 }, false)'); +assert.sameValue(Array.prototype.indexOf.call({ length: 3 }, "true"), 2, 'Array.prototype.indexOf.call({ length: 3 }, "true")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js index c14fdcdab1..0031493629 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-10.js @@ -4,18 +4,9 @@ /*--- es5id: 15.4.4.15-1-10 description: Array.prototype.lastIndexOf applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Math.length = 2; Math[1] = 100; - return 1 === Array.prototype.lastIndexOf.call(Math, 100); - } finally { - delete Math.length; - delete Math[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(Math, 100), 1, 'Array.prototype.lastIndexOf.call(Math, 100)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js index 2248f30798..853dc236cf 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-13.js @@ -4,19 +4,11 @@ /*--- es5id: 15.4.4.15-1-13 description: Array.prototype.lastIndexOf applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; - try { + JSON[3] = targetObj; JSON.length = 5; - return 3 === Array.prototype.lastIndexOf.call(JSON, targetObj); - } finally { - delete JSON[3]; - delete JSON.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(JSON, targetObj), 3, 'Array.prototype.lastIndexOf.call(JSON, targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js index 86c066c180..d3ce162508 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-17.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.15-1-17 description: Array.prototype.lastIndexOf applied to the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { var targetObj = ["global"]; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject()[1] = targetObj; fnGlobalObject().length = 3; - return 1 === Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj); - } finally { - delete fnGlobalObject()[1]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js index 003cce69d0..a116942339 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-3.js @@ -4,19 +4,9 @@ /*--- es5id: 15.4.4.15-1-3 description: Array.prototype.lastIndexOf applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Boolean.prototype[1] = true; Boolean.prototype.length = 2; - return 1 === Array.prototype.lastIndexOf.call(true, true); - } finally { - delete Boolean.prototype[1]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(true, true), 1, 'Array.prototype.lastIndexOf.call(true, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js index b4e63bca83..5d8e942143 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-1-5.js @@ -4,18 +4,9 @@ /*--- es5id: 15.4.4.15-1-5 description: Array.prototype.lastIndexOf applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Number.prototype[1] = isNaN; Number.prototype.length = 2; - return 1 === Array.prototype.lastIndexOf.call(5, isNaN); - } finally { - delete Number.prototype[1]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(5, isNaN), 1, 'Array.prototype.lastIndexOf.call(5, isNaN)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js index d36a4b77d5..d5416b835a 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 20; @@ -25,9 +22,4 @@ function testcase() { configurable: true }); - return Array.prototype.lastIndexOf.call(obj, 1) === -1; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, 1), -1, 'Array.prototype.lastIndexOf.call(obj, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js index 1fc26ab04a..752ca25e17 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-18.js @@ -6,18 +6,11 @@ es5id: 15.4.4.15-2-18 description: > Array.prototype.lastIndexOf applied to String object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var str = new String("012"); - try { + String.prototype[3] = "3"; - return Array.prototype.lastIndexOf.call(str, "2") === 2 && - Array.prototype.lastIndexOf.call(str, "3") === -1; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(str, "2"), 2, 'Array.prototype.lastIndexOf.call(str, "2")'); +assert.sameValue(Array.prototype.lastIndexOf.call(str, "3"), -1, 'Array.prototype.lastIndexOf.call(str, "3")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js index 6f1bec1a06..4bd36ef64b 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-2.js @@ -6,18 +6,11 @@ es5id: 15.4.4.15-2-2 description: > Array.prototype.lastIndexOf - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var targetObj = {}; - try { + Array.prototype[2] = targetObj; - return [0, targetObj].lastIndexOf(targetObj) === 1 && - [0, 1].lastIndexOf(targetObj) === -1; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([0, targetObj].lastIndexOf(targetObj), 1, '[0, targetObj].lastIndexOf(targetObj)'); +assert.sameValue([0, 1].lastIndexOf(targetObj), -1, '[0, 1].lastIndexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js index 3e7d765d7a..60676edb71 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-2-4.js @@ -6,19 +6,12 @@ es5id: 15.4.4.15-2-4 description: > Array.prototype.lastIndexOf when 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var targetObj = {}; var arrProtoLen; - try { + arrProtoLen = Array.prototype.length; Array.prototype.length = 0; - return [0, targetObj, 2].lastIndexOf(targetObj) === 1; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); + +assert.sameValue([0, targetObj, 2].lastIndexOf(targetObj), 1, '[0, targetObj, 2].lastIndexOf(targetObj)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js index 5ec39f5b75..a65561e05c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-10.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-10 description: > Array.prototype.lastIndexOf - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "2", { @@ -26,10 +23,4 @@ function testcase() { configurable: true }); - try { - return arr.lastIndexOf(6.99) === 1; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(6.99), 1, 'arr.lastIndexOf(6.99)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js index 7636e44119..916acc55a0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 2: 2, length: 20 }; Object.defineProperty(arr, "3", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return -1 === Array.prototype.lastIndexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), -1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js index 6a7c0e0048..03969578ab 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-a-14 description: > Array.prototype.lastIndexOf - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, , 2]; Object.defineProperty(arr, "20", { @@ -21,11 +18,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return -1 === arr.lastIndexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(1), -1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js index 72d4bcae7c..8d5ca467cb 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-15.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { 0: 0, 1: 111, 2: 2, length: 10 }; Object.defineProperty(arr, "6", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return 1 === Array.prototype.lastIndexOf.call(arr, 1); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(arr, 1), 1, 'Array.prototype.lastIndexOf.call(arr, 1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js index 9cf101b44c..2d54abecb9 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-16.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 111, 2]; Object.defineProperty(arr, "2", { @@ -22,11 +19,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return 1 === arr.lastIndexOf(1); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.lastIndexOf(1), 1, 'arr.lastIndexOf(1)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js index 3ccde5b66e..229cf7e581 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-18.js @@ -6,14 +6,10 @@ es5id: 15.4.4.15-8-a-18 description: > Array.prototype.lastIndexOf - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [0, 1, 2, 3, 4]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 2 === arr.lastIndexOf("prototype"); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf("prototype"), 2, 'arr.lastIndexOf("prototype")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js index 0cce8eaeb0..6465641430 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-a-9.js @@ -7,11 +7,8 @@ description: > Array.prototype.lastIndexOf - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = { length: 9 }; Object.defineProperty(arr, "4", { @@ -27,10 +24,4 @@ function testcase() { configurable: true }); - try { - return Array.prototype.lastIndexOf.call(arr, Infinity) === 1; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(arr, Infinity), 1, 'Array.prototype.lastIndexOf.call(arr, Infinity)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js index 806209dd93..7f88d0691e 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-11.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Array.prototype[0] = false; Object.defineProperty(arr, "0", { get: function () { @@ -22,9 +19,4 @@ function testcase() { configurable: true }); - return 0 === arr.lastIndexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(true), 0, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js index b67dfe5ed9..a699e40779 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-12.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var obj = { length: 1 }; - try { Object.prototype[0] = false; Object.defineProperty(obj, "0", { get: function () { @@ -22,9 +19,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.lastIndexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 0, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js index 0b527f82be..43c6045bd0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-13.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = []; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return false; @@ -28,9 +25,4 @@ function testcase() { configurable: true }); - return 0 === arr.lastIndexOf(true); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(arr.lastIndexOf(true), 0, 'arr.lastIndexOf(true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js index 474ce9b0a4..60245d65f5 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-14.js @@ -7,14 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; @@ -29,9 +25,4 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.lastIndexOf.call(obj, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, true), 0, 'Array.prototype.lastIndexOf.call(obj, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js index 6ff9ba3d6b..2bdb9cd522 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.15-8-b-i-15 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 10; @@ -32,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === [, , , ].lastIndexOf(10) && - 1 === [, , , ].lastIndexOf(20) && - 2 === [, , , ].lastIndexOf(30); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue([, , , ].lastIndexOf(10), 0, '[, , , ].lastIndexOf(10)'); +assert.sameValue([, , , ].lastIndexOf(20), 1, '[, , , ].lastIndexOf(20)'); +assert.sameValue([, , , ].lastIndexOf(30), 2, '[, , , ].lastIndexOf(30)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js index ab7348aa80..9d9696d608 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-16.js @@ -6,12 +6,8 @@ es5id: 15.4.4.15-8-b-i-16 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return 10; @@ -33,13 +29,6 @@ function testcase() { configurable: true }); - return 0 === Array.prototype.lastIndexOf.call({ length: 3 }, 10) && - 1 === Array.prototype.lastIndexOf.call({ length: 3 }, 20) && - 2 === Array.prototype.lastIndexOf.call({ length: 3 }, 30); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 10), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, 10)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 20), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, 20)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, 30), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, 30)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js index 71477a04b9..6ab787b591 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-19.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var obj = { length: 1 }; - try { + Object.defineProperty(Object.prototype, "0", { get: function () { return 20; @@ -25,9 +22,5 @@ function testcase() { configurable: true }); - return obj.hasOwnProperty(0) && 0 === Array.prototype.lastIndexOf.call(obj, undefined); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); +assert(obj.hasOwnProperty(0), 'obj.hasOwnProperty(0) !== true'); +assert.sameValue(Array.prototype.lastIndexOf.call(obj, undefined), 0, 'Array.prototype.lastIndexOf.call(obj, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js index f11603bc84..779199dbec 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-20.js @@ -7,13 +7,10 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is an own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, 1]; - try { + Object.defineProperty(Array.prototype, "0", { get: function () { return 100; @@ -25,9 +22,5 @@ function testcase() { configurable: true }); - return arr.hasOwnProperty(0) && arr.lastIndexOf(undefined) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(arr.hasOwnProperty(0), 'arr.hasOwnProperty(0) !== true'); +assert.sameValue(arr.lastIndexOf(undefined), 0, 'arr.lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js index 5388971f44..b3a5e120a7 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-21.js @@ -6,18 +6,11 @@ es5id: 15.4.4.15-8-b-i-21 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return [, ].lastIndexOf(undefined) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([, ].lastIndexOf(undefined), 0, '[, ].lastIndexOf(undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js index ba1d369b63..0387717f9d 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-22.js @@ -6,19 +6,11 @@ es5id: 15.4.4.15-8-b-i-22 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited accessor property without a get function on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { set: function () { }, configurable: true }); - return 0 === Array.prototype.lastIndexOf.call({ length: 1 }, undefined); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 1 }, undefined), 0, 'Array.prototype.lastIndexOf.call({ length: 1 }, undefined)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js index 6e703b419f..1cae882267 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-23.js @@ -4,28 +4,17 @@ /*--- es5id: 15.4.4.15-8-b-i-23 description: Array.prototype.lastIndexOf - This object is the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var targetObj = {}; - try { + var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = targetObj; fnGlobalObject()[100] = "100"; fnGlobalObject()[200] = "200"; fnGlobalObject().length = 200; - return 0 === Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj) && - 100 === Array.prototype.lastIndexOf.call(fnGlobalObject(), "100") && - -1 === Array.prototype.lastIndexOf.call(fnGlobalObject(), "200"); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[100]; - delete fnGlobalObject()[200]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj), 0, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), targetObj)'); +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), "100"), 100, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), "100")'); +assert.sameValue(Array.prototype.lastIndexOf.call(fnGlobalObject(), "200"), -1, 'Array.prototype.lastIndexOf.call(fnGlobalObject(), "200")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js index 1c68910915..9409d4a82c 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-3.js @@ -6,15 +6,8 @@ es5id: 15.4.4.15-8-b-i-3 description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Array.prototype[0] = Object; - return [Object.prototype].lastIndexOf(Object.prototype) === 0; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([Object.prototype].lastIndexOf(Object.prototype), 0, '[Object.prototype].lastIndexOf(Object.prototype)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js index 2bd1212e76..4b1e8873b1 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-4.js @@ -7,16 +7,8 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = false; - return 0 === Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js index ca9741e2eb..a03864b3a8 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-5.js @@ -6,20 +6,13 @@ es5id: 15.4.4.15-8-b-i-5 description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - try { Object.defineProperty(Array.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === [Number].lastIndexOf(Number); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue([Number].lastIndexOf(Number), 0, '[Number].lastIndexOf(Number)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js index e5a16ce6fc..112b55bc53 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-6.js @@ -7,21 +7,13 @@ description: > Array.prototype.lastIndexOf - element to be retrieved is own data property that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.defineProperty(Object.prototype, "0", { get: function () { return false; }, configurable: true }); - return 0 === Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true); - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true), 0, 'Array.prototype.lastIndexOf.call({ 0: true, 1: 1, length: 2 }, true)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js index 491783e0df..91db948358 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-7.js @@ -6,22 +6,12 @@ es5id: 15.4.4.15-8-b-i-7 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Array.prototype[0] = true; Array.prototype[1] = false; Array.prototype[2] = "true"; - return 0 === [, , , ].lastIndexOf(true) && - 1 === [, , , ].lastIndexOf(false) && - 2 === [, , , ].lastIndexOf("true"); - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue([, , , ].lastIndexOf(true), 0, '[, , , ].lastIndexOf(true)'); +assert.sameValue([, , , ].lastIndexOf(false), 1, '[, , , ].lastIndexOf(false)'); +assert.sameValue([, , , ].lastIndexOf("true"), 2, '[, , , ].lastIndexOf("true")'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js index 46dee4a022..7bb0a3e3d0 100644 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js +++ b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-8-b-i-8.js @@ -6,22 +6,12 @@ es5id: 15.4.4.15-8-b-i-8 description: > Array.prototype.lastIndexOf - element to be retrieved is inherited data property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - - try { Object.prototype[0] = true; Object.prototype[1] = false; Object.prototype[2] = "true"; - return 0 === Array.prototype.lastIndexOf.call({ length: 3 }, true) && - 1 === Array.prototype.lastIndexOf.call({ length: 3 }, false) && - 2 === Array.prototype.lastIndexOf.call({ length: 3 }, "true"); - } finally { - delete Object.prototype[0]; - delete Object.prototype[1]; - delete Object.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, true), 0, 'Array.prototype.lastIndexOf.call({ length: 3 }, true)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, false), 1, 'Array.prototype.lastIndexOf.call({ length: 3 }, false)'); +assert.sameValue(Array.prototype.lastIndexOf.call({ length: 3 }, "true"), 2, 'Array.prototype.lastIndexOf.call({ length: 3 }, "true")'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js index 41e50d3f1a..df6724e5e2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-10.js @@ -4,22 +4,14 @@ /*--- es5id: 15.4.4.19-1-10 description: Array.prototype.map - applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object Math]' === Object.prototype.toString.call(obj)); } - - try { + Math.length = 1; Math[0] = 1; var testResult = Array.prototype.map.call(Math, callbackfn); - return testResult[0] === true; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js index 7fb75ac180..b346c70694 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-13.js @@ -4,22 +4,14 @@ /*--- es5id: 15.4.4.19-1-13 description: Array.prototype.map - applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; var testResult = Array.prototype.map.call(JSON, callbackfn); - return testResult[0] === true; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js index 6f8186e3e5..cf445ae5a8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-3.js @@ -4,24 +4,15 @@ /*--- es5id: 15.4.4.19-1-3 description: Array.prototype.map - applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; var testResult = Array.prototype.map.call(false, callbackfn); - return testResult[0] === true; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js b/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js index 3902cede49..42edb09b81 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-1-5.js @@ -4,23 +4,15 @@ /*--- es5id: 15.4.4.19-1-5 description: Array.prototype.map - applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; var testResult = Array.prototype.map.call(2.5, callbackfn); - return testResult[0] === true; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js index 12897a9d4a..10d6cd9904 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-12.js @@ -7,15 +7,12 @@ description: > Array.prototype.map - applied to the Array-like object when 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val > 10; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -30,9 +27,5 @@ function testcase() { }); var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult.length === 0; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 0, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js index 3c5f2e4192..96ad9dc0d8 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-15.js @@ -6,29 +6,18 @@ es5id: 15.4.4.19-2-15 description: > Array.prototype.map - when 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val > 10; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); - return testResult.length === 2; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js index d0b007728a..9a642eb49a 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-18.js @@ -6,22 +6,15 @@ es5id: 15.4.4.19-2-18 description: > Array.prototype.map - applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return parseInt(val, 10) > 1; } var str = new String("432"); - try { + String.prototype[3] = "1"; var testResult = Array.prototype.map.call(str, callbackfn); - return 3 === testResult.length; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); +assert.sameValue(testResult.length, 3, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js index 380a48157f..fb09280330 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-2-4.js @@ -6,21 +6,15 @@ es5id: 15.4.4.19-2-4 description: > Array.prototype.map - when 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return val > 10; } var arrProtoLen; - try { + arrProtoLen = Array.prototype.length; Array.prototype.length = 0; var testResult = [12, 11].map(callbackfn); - return testResult.length === 2; - } finally { - Array.prototype.length = arrProtoLen; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 2, 'testResult.length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js index 348844e732..8ecad2ed00 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-5-1.js @@ -5,14 +5,12 @@ es5id: 15.4.4.19-5-1 description: Array.prototype.map - thisArg not passed flags: [noStrict] -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - try { fnGlobalObject()._15_4_4_19_5_1 = true; + +(function() { var _15_4_4_19_5_1 = false; function callbackfn(val, idx, obj) { @@ -20,13 +18,7 @@ function testcase() { } var srcArr = [1]; var resArr = srcArr.map(callbackfn); - if( resArr[0] === true) - return true; - - return false; - } - finally { - delete fnGlobalObject()._15_4_4_19_5_1; - } - } -runTestCase(testcase); + +assert.sameValue(resArr[0], true, 'resArr[0]'); + +})(); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js index 878b638347..e89ff27c09 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-10 description: > Array.prototype.map - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return idx === 1 && typeof val === "undefined"; } @@ -23,12 +21,8 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult.length === 20 && typeof testResult[1] === "undefined"; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 20, 'testResult.length'); +assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js index a3642aa3a4..f03c01e7f3 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-11.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-11 description: > Array.prototype.map - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return idx === 1 && typeof val === "undefined"; } @@ -23,12 +21,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; var testResult = arr.map(callbackfn); - return testResult.length === 3 && typeof testResult[1] === "undefined"; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 3, 'testResult.length'); +assert.sameValue(typeof testResult[1], "undefined", 'typeof testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js index 037a444c0e..8d7e2b7c98 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.map - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 3) { return false; @@ -28,12 +26,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 3; var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult[1] === false; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js index bd9e316b3b..f0c563a32b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-13 description: > Array.prototype.map - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 3) { return false; @@ -27,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 3; var testResult = arr.map(callbackfn); - return testResult[1] === false; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js index 2ed922634b..6df5013c8d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-15 description: > Array.prototype.map - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 2 && val === "prototype") { return false; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -36,9 +33,6 @@ function testcase() { }); var testResult = arr.map(callbackfn); - return testResult.length === 3 && testResult[2] === false; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult.length, 3, 'testResult.length'); +assert.sameValue(testResult[2], false, 'testResult[2]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js index 9a037a13e2..effed61537 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-6 description: > Array.prototype.map - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -32,11 +30,7 @@ function testcase() { configurable: true }); - try { var testResult = Array.prototype.map.call(obj, callbackfn); - return testResult[0] === true && testResult[1] === false; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js index 2ab6eab8e2..20a2b97cfc 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-b-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-b-7 description: > Array.prototype.map - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return false; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, , 2]; - try { Object.defineProperty(arr, "0", { get: function () { Object.defineProperty(Array.prototype, "1", { @@ -34,9 +31,6 @@ function testcase() { }); var testResult = arr.map(callbackfn); - return testResult[0] === true && testResult[1] === false; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); +assert.sameValue(testResult[1], false, 'testResult[1]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js index 2b8436a92e..962266bb0d 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-12 description: > Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -22,7 +19,6 @@ function testcase() { var arr = []; - try { Array.prototype[0] = 11; Object.defineProperty(arr, "0", { @@ -34,11 +30,4 @@ function testcase() { var testResult = arr.map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - - - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js index 2bef80c0e6..d8b569e66b 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-14 description: > Array.prototype.map - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -22,7 +19,6 @@ function testcase() { var arr = []; - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 11; @@ -39,9 +35,4 @@ function testcase() { var testResult = arr.map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js index e380db295a..b699886dc2 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-16 description: > Array.prototype.map - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return kValue; @@ -30,11 +26,4 @@ function testcase() { var testResult = [, ].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - - - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js index a402884f23..1efaff41a6 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.map - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -21,7 +18,6 @@ function testcase() { var arr = []; - try { Object.defineProperty(arr, "0", { set: function () { }, configurable: true @@ -36,9 +32,4 @@ function testcase() { var testResult = arr.map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js index 04ae7f3a0d..2779c6be15 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-22 description: > Array.prototype.map - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -18,7 +15,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true @@ -26,9 +22,4 @@ function testcase() { var testResult = [,].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js index b1708513bd..d3cb8edddf 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.19-8-c-i-23 description: > Array.prototype.map - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -22,17 +18,10 @@ function testcase() { return false; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = kValue; fnGlobalObject().length = 2; var testResult = Array.prototype.map.call(fnGlobalObject(), callbackfn); - return testResult[0] === true; - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js index 2de5c4a29f..495608a4fe 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-4 description: > Array.prototype.map - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,14 +17,8 @@ function testcase() { return false; } - try { Array.prototype[0] = 11; var testResult = [kValue].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js index 2063d22b50..69e6c2b155 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.19-8-c-i-6 description: > Array.prototype.map - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; @@ -29,9 +25,5 @@ function testcase() { }); var testResult = [kValue].map(callbackfn); - return testResult[0] === true; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert.sameValue(testResult[0], true, 'testResult[0]'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js index c6bb4d070f..7bb2463d48 100644 --- a/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js +++ b/test/built-ins/Array/prototype/map/15.4.4.19-8-c-i-8.js @@ -6,10 +6,8 @@ es5id: 15.4.4.19-8-c-i-8 description: > Array.prototype.map - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1) { return val === 13; @@ -17,14 +15,8 @@ function testcase() { return false; } - try { Array.prototype[1] = 13; var newArr = [, , , ].map(callbackfn); - return newArr[1] === true; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert.sameValue(newArr[1], true, 'newArr[1]'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js index 4b83a862e0..c4d43ade4e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-10.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.21-1-10 description: Array.prototype.reduce applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return ('[object Math]' === Object.prototype.toString.call(obj)); } - try { Math.length = 1; Math[0] = 1; - return Array.prototype.reduce.call(Math, callbackfn, 1); - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduce.call(Math, callbackfn, 1), 'Array.prototype.reduce.call(Math, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js index 26fb719852..f69286416c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-13.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.21-1-13 description: Array.prototype.reduce applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; - return Array.prototype.reduce.call(JSON, callbackfn, 1); - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduce.call(JSON, callbackfn, 1), 'Array.prototype.reduce.call(JSON, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js index 41d0f0f700..fc90a041ff 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-3.js @@ -4,24 +4,13 @@ /*--- es5id: 15.4.4.21-1-3 description: Array.prototype.reduce applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = true; Boolean.prototype.length = 1; - return Array.prototype.reduce.call(false, callbackfn, 1); - - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(false, callbackfn, 1), 'Array.prototype.reduce.call(false, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js index b4d6a33f60..b49b2ed695 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-1-5.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.21-1-5 description: Array.prototype.reduce applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(prevVal, curVal, idx, obj) { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; - return Array.prototype.reduce.call(2.5, callbackfn, 1); - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); +assert(Array.prototype.reduce.call(2.5, callbackfn, 1), 'Array.prototype.reduce.call(2.5, callbackfn, 1) !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js index 3367bd74d7..d4d464b378 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-12.js @@ -7,17 +7,13 @@ description: > Array.prototype.reduce - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { accessed = true; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -31,10 +27,5 @@ function testcase() { configurable: true }); - return Array.prototype.reduce.call(obj, callbackfn, 1) === 1 && !accessed; - } finally { - delete Object.prototype.length; - } - - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduce.call(obj, callbackfn, 1), 1, 'Array.prototype.reduce.call(obj, callbackfn, 1)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js index a549632240..136c455d5b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-15.js @@ -4,29 +4,17 @@ /*--- es5id: 15.4.4.21-2-15 description: Array.prototype.reduce - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; - return Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1) === true; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1), true, 'Array.prototype.reduce.call(fnGlobalObject(), callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js index 65f6ab980d..c81d714b76 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-2-4.js @@ -6,23 +6,15 @@ es5id: 15.4.4.21-2-4 description: > Array.prototype.reduce - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var storeProtoLength; function callbackfn(prevVal, curVal, idx, obj) { return (obj.length === 2); } - try { storeProtoLength = Array.prototype.length; Array.prototype.length = 0; - return [12, 11].reduce(callbackfn, 1) === true; - } finally { - Array.prototype.length = storeProtoLength; - } - } -runTestCase(testcase); +assert.sameValue([12, 11].reduce(callbackfn, 1), true, '[12, 11].reduce(callbackfn, 1)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js index 5a58617869..c424aec718 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-12.js @@ -6,10 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-12 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,7 +16,6 @@ function testcase() { } } - try { Array.prototype[0] = 0; var arr = [, 1, 2]; @@ -30,9 +27,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js index 890abdb073..d39a7cae8a 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-14 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 0; @@ -35,9 +31,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js index ee48f7229d..e55a1f28ff 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-16 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 0; @@ -29,9 +25,5 @@ function testcase() { var arr = [, 1, 2]; arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js index aa6858ffa6..234bc4733e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.prototype[0] = 0; var obj = { 1: 1, 2: 2, length: 3 }; @@ -30,9 +26,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js index f277c76876..da85e960b2 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[0] = 0; var arr = [, 1, 2]; Object.defineProperty(arr, "0", { @@ -28,10 +24,5 @@ function testcase() { }); arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js index 06161f964c..45a6b6187b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-22 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true @@ -27,11 +23,5 @@ function testcase() { var arr = [, 1, 2]; arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js index a7950d53fa..bd3aee02e1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.21-8-b-iii-1-23 description: > Array.prototype.reduce - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +16,6 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; @@ -28,13 +23,5 @@ function testcase() { fnGlobalObject().length = 3; Array.prototype.reduce.call(fnGlobalObject(), callbackfn); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js index a7fb1aef75..6ae2de2f63 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-4 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,13 +15,7 @@ function testcase() { } } - try { Array.prototype[0] = "9"; [0, 1, 2].reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js index 61e59a16f9..d22b5dfcb3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-6 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return "5"; @@ -27,9 +23,5 @@ function testcase() { }); [0, 1, 2].reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js index f95968531c..65385bf3a1 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-b-iii-1-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-8-b-iii-1-8 description: > Array.prototype.reduce - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,16 +15,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , ,].reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js index d51d654f4c..73a14f8160 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-8-c-4.js @@ -6,21 +6,13 @@ es5id: 15.4.4.21-8-c-4 description: > Array.prototype.reduce doesn't throw error when array has no own properties but prototype contains a single property -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, , , ]; try { Array.prototype[1] = "prototype"; arr.reduce(function () { }); - return true; - } catch (ex) { - return false; } finally { delete Array.prototype[1]; } - } -runTestCase(testcase); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js index 364d473a8a..94251d5840 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-10.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,12 +29,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduce.call(obj, callbackfn); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js index 2e6175b843..571998554b 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-11 description: > Array.prototype.reduce - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js index 00a571679a..518230d384 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js index 2a87c6cbaa..0ac438a305 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -29,12 +26,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js index d617adae4c..cb33ae3b1e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-15.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-15 description: > Array.prototype.reduce - decreasing length of array with prototype property in step 8 causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js index b5ce1f2765..25d1b31728 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-19 description: > Array.prototype.reduce - properties added to prototype are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js index 70a64eb374..16ee69830e 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-20 description: > Array.prototype.reduce - properties can be added to prototype are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduce(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js index 35fe6ee223..817c69c880 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-23.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-23 description: > Array.prototype.reduce - deleting property of prototype causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -31,12 +28,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js index 93f9208c90..177cac34f5 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-24.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-24 description: > Array.prototype.reduce - deleting property of prototype causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js index cfc7ffdb5c..0298579da3 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduce.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js index f27c604230..46b7258488 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-26.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-26 description: > Array.prototype.reduce - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -28,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduce(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js index 8bbc583a77..a44efd94ac 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-28 description: > Array.prototype.reduce - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.reduce(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js index d2c78e07ad..13789a7195 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-6 description: > Array.prototype.reduce - properties added to prototype in step 8 are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduce.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js index 919a860f6d..b0ec143987 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-b-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-b-7 description: > Array.prototype.reduce - properties added to prototype in step 8 are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(accum, val, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduce(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js index f1ef648573..db642de13c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-12 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 1; var arr = [0, ,2]; @@ -31,10 +27,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js index adf87d01d9..3067ab15e4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-14 description: > Array.prototype.reduce - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -36,10 +32,5 @@ function testcase() { configurable: true }); arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js index 58f4a8472c..aaacf94e00 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-16 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -30,10 +26,5 @@ function testcase() { var arr = [0, , 2, ]; arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js index cdc1ba9ff0..8f0fde6b4d 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } } - try { Object.defineProperty(Object.prototype, "1", { get: function () { return 1; @@ -36,9 +32,5 @@ function testcase() { }); Array.prototype.reduce.call(obj, callbackfn, initialValue); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js index d7948d50b0..1e98a7a551 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduce - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 11; @@ -35,10 +31,5 @@ function testcase() { }); arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js index e4d7ef9b61..ef835d0ac4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-22 description: > Array.prototype.reduce - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { set: function () { }, configurable: true @@ -28,10 +24,5 @@ function testcase() { var arr = [0, , 2]; arr.reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js index 00113eb514..7d8ad83f1c 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.21-9-c-i-23 description: > Array.prototype.reduce - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -21,19 +17,11 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; fnGlobalObject().length = 2; Array.prototype.reduce.call(fnGlobalObject(), callbackfn, initialValue); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js index 41a712ed5e..8808f44d1f 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-4 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,12 +16,7 @@ function testcase() { } } - try { Array.prototype[1] = "3"; [0, 1, 2].reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js index 5cecfe0499..db1c864bd4 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-6 description: > Array.prototype.reduce - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return "9"; @@ -27,11 +23,5 @@ function testcase() { configurable: true }); [0, 1, 2].reduce(callbackfn, initialValue); - return testResult; - - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js index c57e824a21..1d8b72d921 100644 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js +++ b/test/built-ins/Array/prototype/reduce/15.4.4.21-9-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.21-9-c-i-8 description: > Array.prototype.reduce - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; var initialValue = 0; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,17 +16,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , , ].reduce(callbackfn, initialValue); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js index a146182dfd..35b7715bb0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-10.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-10 description: Array.prototype.reduceRight applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return '[object Math]' === Object.prototype.toString.call(obj); } - try { Math.length = 1; Math[0] = 1; - return Array.prototype.reduceRight.call(Math, callbackfn, 1) && accessed; - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(Math, callbackfn, 1), 'Array.prototype.reduceRight.call(Math, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js index b85fa21ff2..1791e2bc8c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-13.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-13 description: Array.prototype.reduceRight applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return ('[object JSON]' === Object.prototype.toString.call(obj)); } - try { JSON.length = 1; JSON[0] = 1; - return Array.prototype.reduceRight.call(JSON, callbackfn, 1) && accessed; - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(JSON, callbackfn, 1), 'Array.prototype.reduceRight.call(JSON, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js index 6d932248a9..22200e7777 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-3.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-3 description: Array.prototype.reduceRight applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return obj instanceof Boolean; } - try { Boolean.prototype[0] = 1; Boolean.prototype.length = 1; - return Array.prototype.reduceRight.call(false, callbackfn, 1) && accessed; - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(false, callbackfn, 1), 'Array.prototype.reduceRight.call(false, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js index e482f0fbd2..16d8c5bbd6 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-1-5.js @@ -4,11 +4,8 @@ /*--- es5id: 15.4.4.22-1-5 description: Array.prototype.reduceRight applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -16,13 +13,8 @@ function testcase() { return obj instanceof Number; } - try { Number.prototype[0] = 1; Number.prototype.length = 1; - return Array.prototype.reduceRight.call(2.5, callbackfn, 1) && accessed; - } finally { - delete Number.prototype[0]; - delete Number.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(2.5, callbackfn, 1), 'Array.prototype.reduceRight.call(2.5, callbackfn, 1) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js index 55c81f6277..093e493bad 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - 'length' is own accessor property without a get function that overrides an inherited accessor property -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -19,7 +16,6 @@ function testcase() { return typeof obj.length === "undefined"; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -33,9 +29,5 @@ function testcase() { configurable: true }); - return Array.prototype.reduceRight.call(obj, callbackfn, 11) === 11 && !accessed; - } finally { - delete Object.prototype.length; - } - } -runTestCase(testcase); +assert.sameValue(Array.prototype.reduceRight.call(obj, callbackfn, 11), 11, 'Array.prototype.reduceRight.call(obj, callbackfn, 11)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js index ae3bf03ab6..78a7ee7e9f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-15.js @@ -6,13 +6,9 @@ es5id: 15.4.4.22-2-15 description: > Array.prototype.reduceRight - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var accessed = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,18 +16,11 @@ function testcase() { return obj.length === fnGlobalObject().length; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 12; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 9; fnGlobalObject().length = 2; - return Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111) && accessed; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111), 'Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, 111) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js index af67834e87..3d3aed3291 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-18.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-18 description: > Array.prototype.reduceRight applied to String object, which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var str = new String("432"); @@ -19,11 +16,7 @@ function testcase() { return obj.length === 3; } - try { String.prototype[3] = "1"; - return Array.prototype.reduceRight.call(str, callbackfn, 111) && accessed; - } finally { - delete String.prototype[3]; - } - } -runTestCase(testcase); + +assert(Array.prototype.reduceRight.call(str, callbackfn, 111), 'Array.prototype.reduceRight.call(str, callbackfn, 111) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js index 930853b5c2..3c3a8e6b98 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-2-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-2-4 description: > Array.prototype.reduceRight - 'length' is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var arrProtoLen; function callbackfn(prevVal, curVal, idx, obj) { @@ -18,14 +15,8 @@ function testcase() { return obj.length === 2; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; - return [12, 11].reduceRight(callbackfn, 11) && accessed; - } finally { - Array.prototype.length = arrProtoLen; - } - - } -runTestCase(testcase); +assert([12, 11].reduceRight(callbackfn, 11), '[12, 11].reduceRight(callbackfn, 11) !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js index 96616646d1..8842789828 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[2] = 2; var arr = [0, 1]; @@ -31,10 +27,5 @@ function testcase() { }); arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js index f35f43bd61..bbf4477691 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-14.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { get: function () { return 2; @@ -37,10 +33,5 @@ function testcase() { }); arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js index a7814ef349..7e37073a50 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-16 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { get: function () { return 2; @@ -29,10 +25,5 @@ function testcase() { var arr = [0, 1, , ]; arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js index c0087cdb08..cb28c4bb1c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.prototype[2] = 2; var obj = { 0: 0, 1: 1, length: 3 }; @@ -29,10 +25,5 @@ function testcase() { }); Array.prototype.reduceRight.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js index 16d9ea43a6..a08f1b962c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[2] = 2; var arr = [0, 1]; Object.defineProperty(arr, "2", { @@ -28,10 +24,5 @@ function testcase() { }); arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js index c3d2e698b5..0f687743b5 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-22 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { set: function () { }, configurable: true @@ -27,11 +23,5 @@ function testcase() { var arr = [0, 1, , ]; arr.reduceRight(callbackfn); - return testResult; - - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js index dfbd2db0ae..bbe19f73dc 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.22-8-b-iii-1-23 description: > Array.prototype.reduceRight - This object is the global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +16,6 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; @@ -28,13 +23,5 @@ function testcase() { fnGlobalObject().length = 3; Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js index b4daf842ae..579c346cd7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-4 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,13 +15,7 @@ function testcase() { } } - try { Array.prototype[2] = "11"; [0, 1, 2].reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js index 6195bef8a4..34ff8e5b31 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-6 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "2"; @@ -26,11 +22,5 @@ function testcase() { configurable: true }); [0, 1, 2].reduceRight(callbackfn); - return testResult; - - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js index 3d23c6185a..2471f3353d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-b-iii-1-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-8-b-iii-1-8 description: > Array.prototype.reduceRight - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,17 +15,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , ,].reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js index 9b1d5fb86a..2824cfd960 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-8-c-4.js @@ -6,21 +6,13 @@ es5id: 15.4.4.22-8-c-4 description: > Array.prototype.reduceRight doesn't throw error when array has no own properties but prototype contains a single property -includes: [runTestCase.js] ---*/ -function testcase() { - var arr = [, , , ]; try { Array.prototype[1] = "prototype"; arr.reduceRight(function () { }); - return true; - } catch (ex) { - return false; } finally { delete Array.prototype[1]; } - } -runTestCase(testcase); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js index 0467957d7f..8054929e9b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-10.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,12 +29,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduceRight.call(obj, callbackfn); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js index b8dd5940e3..c18b3c552b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-11.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-11 description: > Array.prototype.reduceRight - deleting property of prototype in step 8 causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js index a9d1c21659..883290baa0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduceRight.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js index 725c3de547..b4617abc1f 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-13.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting own property with prototype property in step 8 causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -29,12 +26,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js index 3fe58488a1..d2c89fe56c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-15.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - decreasing length of array with prototype property in step 8 causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -21,7 +18,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -39,9 +35,4 @@ function testcase() { arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js index 9fc059f060..677fc5218b 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-19.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-19 description: > Array.prototype.reduceRight - properties added to prototype are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js index 5d47fd9f1a..4a1c7dcc47 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-20.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-20 description: > Array.prototype.reduceRight - properties added to prototype can be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js index 33f4344336..6ced9a8166 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-23.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting property of prototype causes deleted index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -32,12 +29,8 @@ function testcase() { configurable: true }); - try { Object.prototype[3] = 1; Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Object.prototype[3]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js index 0fee30536b..218340c5f0 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-24.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-24 description: > Array.prototype.reduceRight - deleting property of prototype causes deleted index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var accessed = false; var testResult = true; @@ -30,12 +27,8 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn, "initialValue"); - return testResult && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js index 5234c19580..ab59c0780c 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-25.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -30,12 +27,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js index 96ecdf625b..08231b2e46 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-26.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-26 description: > Array.prototype.reduceRight - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -28,12 +25,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js index e77cae3653..7c3743976a 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-28.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-28 description: > Array.prototype.reduceRight - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2, 3]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -38,9 +34,4 @@ function testcase() { arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js index 8f96ac4840..db4e3977d7 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-6 description: > Array.prototype.reduceRight - properties added to prototype in step 8 visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(preVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { Array.prototype.reduceRight.call(obj, callbackfn); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js index c83e459fbc..9dd8692bdf 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-b-7.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-b-7 description: > Array.prototype.reduceRight - properties added to prototype in step 8 visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(preVal, curVal, idx, obj) { @@ -34,11 +31,6 @@ function testcase() { configurable: true }); - try { arr.reduceRight(callbackfn); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js index d62bfc9d57..495ed10405 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-12.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 11; var arr = [0, ,2]; @@ -31,10 +27,5 @@ function testcase() { }); arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js index f9a8c8adad..80e358bc94 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-14.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 11; @@ -36,10 +32,5 @@ function testcase() { configurable: true }); arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js index ced9ca9bfc..494abf8029 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-16 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 1; @@ -29,10 +25,5 @@ function testcase() { var arr = [0, , 2]; arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js index b93bb45e00..a5c367dd85 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Object.prototype[1] = 1; var obj = { 0: 0, 2: 2, length: 3 }; @@ -29,10 +25,5 @@ function testcase() { }); Array.prototype.reduceRight.call(obj, callbackfn, "initialValue"); - return testResult; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js index 0e2c194fa2..5a901f843e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.reduceRight - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -19,7 +16,6 @@ function testcase() { } } - try { Array.prototype[1] = 1; var arr = [0, ,2]; Object.defineProperty(arr, "1", { @@ -28,10 +24,5 @@ function testcase() { }); arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js index 2b20628670..256d03072d 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-22 description: > Array.prototype.reduceRight - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { set: function () { }, configurable: true @@ -27,11 +23,5 @@ function testcase() { var arr = [0, , 2]; arr.reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js index 2411819bad..854466ce7e 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.22-9-c-i-23 description: > Array.prototype.reduceRight - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -20,7 +16,6 @@ function testcase() { } } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 0; fnGlobalObject()[1] = 1; @@ -28,13 +23,5 @@ function testcase() { fnGlobalObject().length = 3; Array.prototype.reduceRight.call(fnGlobalObject(), callbackfn, "initialValue"); - return testResult; - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js index 6bdad8d75b..1021829d70 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-4 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,13 +15,7 @@ function testcase() { } } - try { Array.prototype[1] = "11"; [0, 1, 2].reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js index d4b4e6f238..80d577ff87 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-6 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,7 +15,6 @@ function testcase() { } } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return "11"; @@ -26,11 +22,5 @@ function testcase() { configurable: true }); [0, 1, 2].reduceRight(callbackfn, "initialValue"); - return testResult; - - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js index e961a66b87..bf150824ff 100644 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js +++ b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-9-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.22-9-c-i-8 description: > Array.prototype.reduceRight - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { @@ -18,17 +15,9 @@ function testcase() { } } - try { Array.prototype[0] = 0; Array.prototype[1] = 1; Array.prototype[2] = 2; [, , , ].reduceRight(callbackfn, "initialValue"); - return testResult; - } finally { - delete Array.prototype[0]; - delete Array.prototype[1]; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(testResult, 'testResult !== true'); diff --git a/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js b/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js index 1d6502bb0a..87c916c8e9 100644 --- a/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js +++ b/test/built-ins/Array/prototype/slice/15.4.4.10-10-c-ii-1.js @@ -6,12 +6,10 @@ es5id: 15.4.4.10-10-c-ii-1 description: > Array.prototype.slice will slice a string from start to end when index property (read-only) exists in Array.prototype (Step 10.c.ii) -includes: [runTestCase.js] ---*/ -function testcase() { var arrObj = [1, 2, 3]; - try { + Object.defineProperty(Array.prototype, "0", { value: "test", writable: false, @@ -19,9 +17,7 @@ function testcase() { }); var newArr = arrObj.slice(0, 1); - return newArr.hasOwnProperty("0") && newArr[0] === 1 && typeof newArr[1] === "undefined"; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(newArr.hasOwnProperty("0"), 'newArr.hasOwnProperty("0") !== true'); +assert.sameValue(newArr[0], 1, 'newArr[0]'); +assert.sameValue(typeof newArr[1], "undefined", 'typeof newArr[1]'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js index 17802f684b..dc3da61b6a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-10.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.17-1-10 description: Array.prototype.some applied to the Math object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return '[object Math]' === Object.prototype.toString.call(obj); } - try { Math.length = 1; Math[0] = 1; - return Array.prototype.some.call(Math, callbackfn); - } finally { - delete Math[0]; - delete Math.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(Math, callbackfn), 'Array.prototype.some.call(Math, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js index 000540c0bb..7490883da1 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-13.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.17-1-13 description: Array.prototype.some applied to the JSON object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return '[object JSON]' === Object.prototype.toString.call(obj); } - try { JSON.length = 1; JSON[0] = 1; - return Array.prototype.some.call(JSON, callbackfn); - } finally { - delete JSON.length; - delete JSON[0]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(JSON, callbackfn), 'Array.prototype.some.call(JSON, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js index 170a7a338f..7acbd36b91 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-3.js @@ -4,21 +4,13 @@ /*--- es5id: 15.4.4.17-1-3 description: Array.prototype.some applied to boolean primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Boolean; } - try { Boolean.prototype[0] = 1; Boolean.prototype.length = 1; - return Array.prototype.some.call(false, callbackfn); - } finally { - delete Boolean.prototype[0]; - delete Boolean.prototype.length; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(false, callbackfn), 'Array.prototype.some.call(false, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js b/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js index b1a9aa3c25..bf46fb2e4e 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-1-5.js @@ -4,22 +4,13 @@ /*--- es5id: 15.4.4.17-1-5 description: Array.prototype.some applied to number primitive -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { return obj instanceof Number; } - try { Number.prototype[1] = true; Number.prototype.length = 2; - return Array.prototype.some.call(5, callbackfn); - } finally { - delete Number.prototype[1]; - delete Number.prototype.length; - } - } -runTestCase(testcase); +assert(Array.prototype.some.call(5, callbackfn), 'Array.prototype.some.call(5, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js index 11cb05fb46..12fd36f0a1 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.some - 'length' is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { @@ -18,7 +16,6 @@ function testcase() { return val > 10; } - try { Object.defineProperty(Object.prototype, "length", { get: function () { return 2; @@ -32,10 +29,5 @@ function testcase() { configurable: true }); - return !Array.prototype.some.call(obj, callbackfn) && !accessed; - } finally { - delete Object.prototype.length; - } - - } -runTestCase(testcase); +assert.sameValue(Array.prototype.some.call(obj, callbackfn), false, 'Array.prototype.some.call(obj, callbackfn)'); +assert.sameValue(accessed, false, 'accessed'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js index 0fd2726993..ea05feca4f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-15.js @@ -4,12 +4,9 @@ /*--- es5id: 15.4.4.17-2-15 description: Array.prototype.some - 'length' is property of the global object -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -18,19 +15,11 @@ function testcase() { return val > 11; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 9; fnGlobalObject()[1] = 11; fnGlobalObject()[2] = 12; fnGlobalObject().length = 2; - return Array.prototype.some.call(fnGlobalObject(), callbackfn1) && - !Array.prototype.some.call(fnGlobalObject(), callbackfn2); - } finally { - delete fnGlobalObject()[0]; - delete fnGlobalObject()[1]; - delete fnGlobalObject()[2]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(fnGlobalObject(), callbackfn1), 'Array.prototype.some.call(fnGlobalObject(), callbackfn1) !== true'); +assert.sameValue(Array.prototype.some.call(fnGlobalObject(), callbackfn2), false, 'Array.prototype.some.call(fnGlobalObject(), callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js index 76fe238619..e219d16d02 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-18.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-18 description: > Array.prototype.some applied to String object which implements its own property get method -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return parseInt(val, 10) > 1; } @@ -19,12 +17,8 @@ function testcase() { } var str = new String("12"); - try { + String.prototype[2] = "3"; - return Array.prototype.some.call(str, callbackfn1) && - !Array.prototype.some.call(str, callbackfn2); - } finally { - delete String.prototype[2]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(str, callbackfn1), 'Array.prototype.some.call(str, callbackfn1) !== true'); +assert.sameValue(Array.prototype.some.call(str, callbackfn2), false, 'Array.prototype.some.call(str, callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js index beffb9869b..2a2ddb2e6a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-2.js @@ -4,10 +4,8 @@ /*--- es5id: 15.4.4.17-2-2 description: Array.prototype.some - 'length' is own data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn1(val, idx, obj) { return val > 10; } @@ -16,13 +14,7 @@ function testcase() { return val > 11; } - try { Array.prototype[2] = 12; - return [9, 11].some(callbackfn1) && - ![9, 11].some(callbackfn2); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert([9, 11].some(callbackfn1), '[9, 11].some(callbackfn1) !== true'); +assert.sameValue([9, 11].some(callbackfn2), false, '[9, 11].some(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js index 7a5dc81e83..be0080c1a9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-2-4.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-2-4 description: > Array.prototype.some - 'length' is an own data property that overrides an inherited data property on an array -includes: [runTestCase.js] ---*/ -function testcase() { var arrProtoLen = 0; function callbackfn1(val, idx, obj) { return val > 10; @@ -19,16 +17,9 @@ function testcase() { return val > 11; } - try { arrProtoLen = Array.prototype.length; Array.prototype.length = 0; Array.prototype[2] = 12; - return [9, 11].some(callbackfn1) && - ![9, 11].some(callbackfn2); - } finally { - Array.prototype.length = arrProtoLen; - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert([9, 11].some(callbackfn1), '[9, 11].some(callbackfn1) !== true'); +assert.sameValue([9, 11].some(callbackfn2), false, '[9, 11].some(callbackfn2)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js index a09079c054..64e1ab5f10 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-10.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-10 description: > Array.prototype.some - deleting property of prototype causes prototype index property not to be visited on an Array-like Object -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return !Array.prototype.some.call(arr, callbackfn) && accessed; - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(Array.prototype.some.call(arr, callbackfn), false, 'Array.prototype.some.call(arr, callbackfn)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js index d9137ecdd3..f17bcee474 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-11.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-11 description: > Array.prototype.some - deleting property of prototype causes prototype index property not to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { var accessed = false; function callbackfn(val, idx, obj) { accessed = true; @@ -25,11 +23,7 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return !arr.some(callbackfn) && accessed; - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert.sameValue(arr.some(callbackfn), false, 'arr.some(callbackfn)'); +assert(accessed, 'accessed !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js index c3ac908bc9..0081c57f56 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-12.js @@ -7,10 +7,8 @@ description: > Array.prototype.some - deleting own property with prototype property causes prototype index property to be visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return true; @@ -28,11 +26,6 @@ function testcase() { configurable: true }); - try { Object.prototype[1] = 1; - return Array.prototype.some.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js index e8ca3bbd29..b8247515dc 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-13.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-13 description: > Array.prototype.some - deleting own property with prototype property causes prototype index property to be visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 1) { return true; @@ -27,11 +25,6 @@ function testcase() { configurable: true }); - try { Array.prototype[1] = 1; - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); + +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js index 257b6e61f4..16c4c4b10a 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-15.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-15 description: > Array.prototype.some - decreasing length of array with prototype property causes prototype index property to be visited -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 2 && val === "prototype") { return true; @@ -19,7 +17,6 @@ function testcase() { } var arr = [0, 1, 2]; - try { Object.defineProperty(Array.prototype, "2", { get: function () { return "prototype"; @@ -35,9 +32,4 @@ function testcase() { configurable: true }); - return arr.some(callbackfn); - } finally { - delete Array.prototype[2]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js index 1fab1f9e5b..71e74ef6d8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-6.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-6 description: > Array.prototype.some - properties can be added to prototype after current position are visited on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return true; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return Array.prototype.some.call(arr, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); +assert(Array.prototype.some.call(arr, callbackfn), 'Array.prototype.some.call(arr, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js index 185e674042..2211b41ddd 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-b-7.js @@ -6,10 +6,8 @@ es5id: 15.4.4.17-7-b-7 description: > Array.prototype.some - properties can be added to prototype after current position are visited on an Array -includes: [runTestCase.js] ---*/ -function testcase() { function callbackfn(val, idx, obj) { if (idx === 1 && val === 6.99) { return true; @@ -32,10 +30,4 @@ function testcase() { configurable: true }); - try { - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js index 80f0f862a4..10383aea31 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-12.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-12 description: > Array.prototype.some - element to be retrieved is own accessor property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -21,7 +18,7 @@ function testcase() { } var arr = []; - try { + Array.prototype[1] = 100; Object.defineProperty(arr, "1", { get: function () { @@ -30,9 +27,4 @@ function testcase() { configurable: true }); - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js index 9ec54a9edd..01a6805598 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-14.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-14 description: > Array.prototype.some - element to be retrieved is own accessor property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -28,7 +25,6 @@ function testcase() { configurable: true }); - try { Object.defineProperty(Array.prototype, "1", { get: function () { return 10; @@ -36,9 +32,4 @@ function testcase() { configurable: true }); - return arr.some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js index fee268da8c..da4e0699b6 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-16.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-16 description: > Array.prototype.some - element to be retrieved is inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,7 +17,6 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "1", { get: function () { return kValue; @@ -28,9 +24,4 @@ function testcase() { configurable: true }); - return [, , ].some(callbackfn); - } finally { - delete Array.prototype[1]; - } - } -runTestCase(testcase); +assert([, , ].some(callbackfn), '[, , ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js index 9f5825f684..931cf2641f 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-19.js @@ -7,11 +7,8 @@ description: > Array.prototype.some - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array-like object -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 1) { return typeof val === "undefined"; @@ -24,11 +21,7 @@ function testcase() { set: function () { }, configurable: true }); - try { + Object.prototype[1] = 10; - return Array.prototype.some.call(obj, callbackfn); - } finally { - delete Object.prototype[1]; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(obj, callbackfn), 'Array.prototype.some.call(obj, callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js index 39b6fabb2e..885a59f4e9 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-20.js @@ -7,11 +7,8 @@ description: > Array.prototype.some - element to be retrieved is own accessor property without a get function that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -26,11 +23,6 @@ function testcase() { configurable: true }); - try { Array.prototype[0] = 100; - return arr.some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert(arr.some(callbackfn), 'arr.some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js index 8d6f5ae8ed..f46deb8fce 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-22.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-22 description: > Array.prototype.some - element to be retrieved is inherited accessor property without a get function on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return typeof val === "undefined"; @@ -18,16 +15,9 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { set: function () { }, configurable: true }); - return [, ].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - - } -runTestCase(testcase); +assert([, ].some(callbackfn), '[, ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js index 7127d49a2a..4c4ec2ab5b 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-23.js @@ -6,13 +6,9 @@ es5id: 15.4.4.17-7-c-i-23 description: > Array.prototype.some - This object is an global object which contains index property -includes: - - runTestCase.js - - fnGlobalObject.js +includes: [fnGlobalObject.js] ---*/ -function testcase() { - function callbackfn(val, idx, obj) { if (idx === 0) { return val === 11; @@ -20,14 +16,8 @@ function testcase() { return false; } - try { var oldLen = fnGlobalObject().length; fnGlobalObject()[0] = 11; fnGlobalObject().length = 1; - return Array.prototype.some.call(fnGlobalObject(), callbackfn); - } finally { - delete fnGlobalObject()[0]; - fnGlobalObject().length = oldLen; - } - } -runTestCase(testcase); + +assert(Array.prototype.some.call(fnGlobalObject(), callbackfn), 'Array.prototype.some.call(fnGlobalObject(), callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js index 6d335fabbd..f2317b2470 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-4.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-4 description: > Array.prototype.some - element to be retrieved is own data property that overrides an inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = "abc"; function callbackfn(val, idx, obj) { @@ -20,12 +17,6 @@ function testcase() { return false; } - try { Array.prototype[0] = 11; - return [kValue].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js index 36b322b548..237c6c55d8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-6.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-6 description: > Array.prototype.some - element to be retrieved is own data property that overrides an inherited accessor property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = 1000; function callbackfn(val, idx, obj) { @@ -20,16 +17,11 @@ function testcase() { return false; } - try { Object.defineProperty(Array.prototype, "0", { get: function () { return 9; }, configurable: true }); - return [kValue].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); + +assert([kValue].some(callbackfn), '[kValue].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js index b97461441c..db423ed3b8 100644 --- a/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js +++ b/test/built-ins/Array/prototype/some/15.4.4.17-7-c-i-8.js @@ -6,11 +6,8 @@ es5id: 15.4.4.17-7-c-i-8 description: > Array.prototype.some - element to be retrieved is inherited data property on an Array -includes: [runTestCase.js] ---*/ -function testcase() { - var kValue = {}; function callbackfn(val, idx, obj) { @@ -20,12 +17,6 @@ function testcase() { return false; } - try { Array.prototype[0] = kValue; - return [, ].some(callbackfn); - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert([, ].some(callbackfn), '[, ].some(callbackfn) !== true'); diff --git a/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js b/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js index 091e20aef8..0fd56380b9 100644 --- a/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js +++ b/test/built-ins/Array/prototype/splice/15.4.4.12-9-c-ii-1.js @@ -7,11 +7,8 @@ description: > Array.prototype.splice will splice an array even when Array.prototype has index '0' set to read-only and 'fromPresent' less than 'actualDeleteCount (Step 9.c.ii) -includes: [runTestCase.js] ---*/ -function testcase() { - try { var arr = ["a", "b", "c"]; Array.prototype[0] = "test"; var newArr = arr.splice(2, 1, "d"); @@ -35,9 +32,7 @@ function testcase() { delete newArr[0]; verifyConfigurable = newArr.hasOwnProperty("0"); - return verifyValue && !verifyConfigurable && verifyEnumerable && verifyWritable; - } finally { - delete Array.prototype[0]; - } - } -runTestCase(testcase); +assert(verifyValue, 'verifyValue !== true'); +assert.sameValue(verifyConfigurable, false, 'verifyConfigurable'); +assert(verifyEnumerable, 'verifyEnumerable !== true'); +assert(verifyWritable, 'verifyWritable !== true'); -- GitLab