From 7972f9bbdc491295c28ca6cc11ee53683a451ef1 Mon Sep 17 00:00:00 2001 From: Leo Balter <leonardo.balter@gmail.com> Date: Tue, 11 Apr 2017 01:40:40 -0400 Subject: [PATCH] Add and update common tests for Array and Array.prototype Ref #960 --- test/built-ins/Array/constructor.js | 10 ++++++ test/built-ins/Array/proto.js | 15 ++++++++ .../built-ins/Array/prototype/S15.4.3.1_A1.js | 13 ------- .../built-ins/Array/prototype/S15.4.3.1_A2.js | 25 ------------- .../built-ins/Array/prototype/S15.4.3.1_A3.js | 36 ------------------- .../built-ins/Array/prototype/S15.4.3.1_A4.js | 16 --------- .../built-ins/Array/prototype/S15.4.3.1_A5.js | 13 ------- .../Array/prototype/S15.4.4_A1.1_T1.js | 24 ------------- .../Array/prototype/S15.4.4_A1.1_T2.js | 15 -------- .../Array/prototype/S15.4.4_A1.1_T3.js | 15 -------- .../Array/prototype/S15.4.4_A1.2_T1.js | 14 -------- .../Array/prototype/S15.4.4_A2.1_T1.js | 16 --------- .../Array/prototype/S15.4.4_A2.1_T2.js | 26 -------------- .../concat/Array.prototype.concat_arity.js | 9 ----- .../Array.prototype.concat_descriptor.js | 11 ------ .../Array/prototype/concat/S15.4.4.4_A4.1.js | 25 ------------- .../Array/prototype/concat/S15.4.4.4_A4.2.js | 25 ------------- .../Array/prototype/concat/S15.4.4.4_A4.3.js | 16 --------- .../Array/prototype/concat/S15.4.4.4_A4.4.js | 13 ------- .../Array/prototype/concat/S15.4.4.4_A4.5.js | 25 ------------- .../Array/prototype/concat/S15.4.4.4_A4.6.js | 13 ------- .../Array/prototype/concat/S15.4.4.4_A4.7.js | 21 ----------- .../Array/prototype/concat/length.js | 32 +++++++++++++++++ .../prototype/concat/not-a-constructor.js | 22 ++++++++++++ .../Array/prototype/concat/prop-desc.js | 21 +++++++++++ test/built-ins/Array/prototype/constructor.js | 25 +++++++++++++ .../prototype/constructor/S15.4.4.1_A1_T1.js | 15 -------- .../prototype/constructor/S15.4.4.1_A2.js | 25 ------------- .../{copyWithin.js => prop-desc.js} | 0 .../entries/{entries.js => prop-desc.js} | 0 .../Array/prototype/every/prop-desc.js | 21 +++++++++++ .../built-ins/Array/prototype/exotic-array.js | 24 +++++++++++++ .../prototype/fill/{fill.js => prop-desc.js} | 0 .../Array/prototype/filter/15.4.4.20-0-1.js | 11 ------ .../Array/prototype/filter/15.4.4.20-0-2.js | 9 ----- .../Array/prototype/filter/length.js | 30 ++++++++++++++++ .../Array/prototype/filter/prop-desc.js | 21 +++++++++++ .../prototype/find/{find.js => prop-desc.js} | 0 .../findIndex/{findIndex.js => prop-desc.js} | 0 .../Array/prototype/forEach/15.4.4.18-0-1.js | 11 ------ .../Array/prototype/forEach/15.4.4.18-0-2.js | 9 ----- .../Array/prototype/forEach/length.js | 30 ++++++++++++++++ .../Array/prototype/forEach/prop-desc.js | 21 +++++++++++ .../Array/prototype/indexOf/15.4.4.14-0-1.js | 11 ------ .../Array/prototype/indexOf/15.4.4.14-0-2.js | 9 ----- .../Array/prototype/indexOf/length.js | 28 +++++++++++++++ .../Array/prototype/indexOf/prop-desc.js | 21 +++++++++++ .../Array/prototype/join/S15.4.4.5_A6.1.js | 25 ------------- .../Array/prototype/join/S15.4.4.5_A6.2.js | 25 ------------- .../Array/prototype/join/S15.4.4.5_A6.3.js | 16 --------- .../Array/prototype/join/S15.4.4.5_A6.4.js | 13 ------- .../Array/prototype/join/S15.4.4.5_A6.5.js | 25 ------------- test/built-ins/Array/prototype/join/length.js | 28 +++++++++++++++ .../Array/prototype/join/prop-desc.js | 21 +++++++++++ .../prototype/keys/{keys.js => prop-desc.js} | 0 .../prototype/lastIndexOf/15.4.4.15-0-1.js | 11 ------ .../prototype/lastIndexOf/15.4.4.15-0-2.js | 9 ----- .../Array/prototype/lastIndexOf/length.js | 28 +++++++++++++++ .../Array/prototype/lastIndexOf/prop-desc.js | 21 +++++++++++ test/built-ins/Array/prototype/length.js | 24 +++++++++++++ .../Array/prototype/map/15.4.4.19-0-1.js | 11 ------ .../Array/prototype/map/15.4.4.19-0-2.js | 9 ----- test/built-ins/Array/prototype/map/length.js | 28 +++++++++++++++ .../Array/prototype/map/prop-desc.js | 21 +++++++++++ .../Array/prototype/pop/S15.4.4.6_A5.1.js | 25 ------------- .../Array/prototype/pop/S15.4.4.6_A5.2.js | 25 ------------- .../Array/prototype/pop/S15.4.4.6_A5.3.js | 16 --------- .../Array/prototype/pop/S15.4.4.6_A5.4.js | 13 ------- .../Array/prototype/pop/S15.4.4.6_A5.5.js | 25 ------------- .../Array/prototype/pop/S15.4.4.6_A5.6.js | 13 ------- test/built-ins/Array/prototype/pop/length.js | 28 +++++++++++++++ .../Array/prototype/pop/prop-desc.js | 21 +++++++++++ test/built-ins/Array/prototype/prop-desc.js | 20 +++++++++++ test/built-ins/Array/prototype/proto.js | 15 ++++++++ .../Array/prototype/push/S15.4.4.7_A6.1.js | 25 ------------- .../Array/prototype/push/S15.4.4.7_A6.2.js | 25 ------------- .../Array/prototype/push/S15.4.4.7_A6.3.js | 16 --------- .../Array/prototype/push/S15.4.4.7_A6.4.js | 13 ------- .../Array/prototype/push/S15.4.4.7_A6.5.js | 25 ------------- .../Array/prototype/push/S15.4.4.7_A6.6.js | 13 ------- test/built-ins/Array/prototype/push/length.js | 32 +++++++++++++++++ .../Array/prototype/push/prop-desc.js | 21 +++++++++++ .../Array/prototype/reduce/15.4.4.21-0-1.js | 11 ------ .../Array/prototype/reduce/15.4.4.21-0-2.js | 9 ----- .../Array/prototype/reduce/length.js | 28 +++++++++++++++ .../Array/prototype/reduce/prop-desc.js | 21 +++++++++++ .../prototype/reduceRight/15.4.4.22-0-1.js | 11 ------ .../prototype/reduceRight/15.4.4.22-0-2.js | 9 ----- .../Array/prototype/reduceRight/length.js | 28 +++++++++++++++ .../Array/prototype/reduceRight/prop-desc.js | 21 +++++++++++ .../Array/prototype/reverse/S15.4.4.8_A5.1.js | 25 ------------- .../Array/prototype/reverse/S15.4.4.8_A5.2.js | 25 ------------- .../Array/prototype/reverse/S15.4.4.8_A5.3.js | 16 --------- .../Array/prototype/reverse/S15.4.4.8_A5.4.js | 13 ------- .../Array/prototype/reverse/S15.4.4.8_A5.5.js | 25 ------------- .../Array/prototype/reverse/S15.4.4.8_A5.6.js | 13 ------- .../Array/prototype/reverse/length.js | 28 +++++++++++++++ .../Array/prototype/reverse/prop-desc.js | 21 +++++++++++ .../Array/prototype/shift/S15.4.4.9_A5.1.js | 25 ------------- .../Array/prototype/shift/S15.4.4.9_A5.2.js | 25 ------------- .../Array/prototype/shift/S15.4.4.9_A5.3.js | 16 --------- .../Array/prototype/shift/S15.4.4.9_A5.4.js | 13 ------- .../Array/prototype/shift/S15.4.4.9_A5.5.js | 25 ------------- .../Array/prototype/shift/S15.4.4.9_A5.6.js | 13 ------- .../built-ins/Array/prototype/shift/length.js | 28 +++++++++++++++ .../Array/prototype/shift/prop-desc.js | 21 +++++++++++ .../Array/prototype/slice/S15.4.4.10_A5.1.js | 25 ------------- .../Array/prototype/slice/S15.4.4.10_A5.2.js | 25 ------------- .../Array/prototype/slice/S15.4.4.10_A5.3.js | 16 --------- .../Array/prototype/slice/S15.4.4.10_A5.4.js | 13 ------- .../Array/prototype/slice/S15.4.4.10_A5.5.js | 25 ------------- .../Array/prototype/slice/S15.4.4.10_A5.6.js | 13 ------- .../built-ins/Array/prototype/slice/length.js | 28 +++++++++++++++ .../Array/prototype/slice/prop-desc.js | 21 +++++++++++ .../Array/prototype/some/15.4.4.17-0-1.js | 11 ------ .../Array/prototype/some/15.4.4.17-0-2.js | 9 ----- test/built-ins/Array/prototype/some/length.js | 28 +++++++++++++++ .../Array/prototype/some/prop-desc.js | 21 +++++++++++ .../Array/prototype/sort/S15.4.4.11_A7.1.js | 25 ------------- .../Array/prototype/sort/S15.4.4.11_A7.2.js | 25 ------------- .../Array/prototype/sort/S15.4.4.11_A7.3.js | 16 --------- .../Array/prototype/sort/S15.4.4.11_A7.4.js | 13 ------- .../Array/prototype/sort/S15.4.4.11_A7.5.js | 25 ------------- .../Array/prototype/sort/S15.4.4.11_A7.6.js | 13 ------- test/built-ins/Array/prototype/sort/length.js | 28 +++++++++++++++ .../Array/prototype/sort/prop-desc.js | 21 +++++++++++ .../Array/prototype/splice/S15.4.4.12_A5.1.js | 25 ------------- .../Array/prototype/splice/S15.4.4.12_A5.2.js | 25 ------------- .../Array/prototype/splice/S15.4.4.12_A5.3.js | 16 --------- .../Array/prototype/splice/S15.4.4.12_A5.4.js | 13 ------- .../Array/prototype/splice/S15.4.4.12_A5.5.js | 25 ------------- .../Array/prototype/splice/S15.4.4.12_A5.6.js | 13 ------- .../Array/prototype/splice/length.js | 28 +++++++++++++++ .../Array/prototype/splice/prop-desc.js | 21 +++++++++++ .../toLocaleString/S15.4.4.3_A4.1.js | 25 ------------- .../toLocaleString/S15.4.4.3_A4.2.js | 27 -------------- .../toLocaleString/S15.4.4.3_A4.3.js | 16 --------- .../toLocaleString/S15.4.4.3_A4.4.js | 13 ------- .../toLocaleString/S15.4.4.3_A4.5.js | 25 ------------- .../toLocaleString/S15.4.4.3_A4.6.js | 13 ------- .../Array/prototype/toLocaleString/length.js | 28 +++++++++++++++ .../prototype/toLocaleString/prop-desc.js | 21 +++++++++++ .../prototype/toString/S15.4.4.2_A4.5.js | 25 ------------- .../prototype/toString/S15.4.4.2_A4.6.js | 13 ------- .../Array/prototype/toString/prop-desc.js | 21 +++++++++++ .../prototype/unshift/S15.4.4.13_A5.1.js | 25 ------------- .../prototype/unshift/S15.4.4.13_A5.2.js | 25 ------------- .../prototype/unshift/S15.4.4.13_A5.3.js | 16 --------- .../prototype/unshift/S15.4.4.13_A5.4.js | 13 ------- .../prototype/unshift/S15.4.4.13_A5.5.js | 25 ------------- .../prototype/unshift/S15.4.4.13_A5.6.js | 13 ------- .../Array/prototype/unshift/length.js | 32 +++++++++++++++++ .../Array/prototype/unshift/prop-desc.js | 21 +++++++++++ 153 files changed, 1144 insertions(+), 1768 deletions(-) create mode 100644 test/built-ins/Array/constructor.js create mode 100644 test/built-ins/Array/proto.js delete mode 100644 test/built-ins/Array/prototype/S15.4.3.1_A1.js delete mode 100644 test/built-ins/Array/prototype/S15.4.3.1_A2.js delete mode 100644 test/built-ins/Array/prototype/S15.4.3.1_A3.js delete mode 100644 test/built-ins/Array/prototype/S15.4.3.1_A4.js delete mode 100644 test/built-ins/Array/prototype/S15.4.3.1_A5.js delete mode 100644 test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js delete mode 100644 test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js delete mode 100644 test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js delete mode 100644 test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js delete mode 100644 test/built-ins/Array/prototype/S15.4.4_A2.1_T1.js delete mode 100644 test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js delete mode 100644 test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js delete mode 100644 test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.1.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.4.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.js delete mode 100644 test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js create mode 100644 test/built-ins/Array/prototype/concat/length.js create mode 100644 test/built-ins/Array/prototype/concat/not-a-constructor.js create mode 100644 test/built-ins/Array/prototype/concat/prop-desc.js create mode 100644 test/built-ins/Array/prototype/constructor.js delete mode 100644 test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js delete mode 100644 test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.js rename test/built-ins/Array/prototype/copyWithin/{copyWithin.js => prop-desc.js} (100%) rename test/built-ins/Array/prototype/entries/{entries.js => prop-desc.js} (100%) create mode 100644 test/built-ins/Array/prototype/every/prop-desc.js create mode 100644 test/built-ins/Array/prototype/exotic-array.js rename test/built-ins/Array/prototype/fill/{fill.js => prop-desc.js} (100%) delete mode 100644 test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js delete mode 100644 test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js create mode 100644 test/built-ins/Array/prototype/filter/length.js create mode 100644 test/built-ins/Array/prototype/filter/prop-desc.js rename test/built-ins/Array/prototype/find/{find.js => prop-desc.js} (100%) rename test/built-ins/Array/prototype/findIndex/{findIndex.js => prop-desc.js} (100%) delete mode 100644 test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js delete mode 100644 test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js create mode 100644 test/built-ins/Array/prototype/forEach/length.js create mode 100644 test/built-ins/Array/prototype/forEach/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js delete mode 100644 test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js create mode 100644 test/built-ins/Array/prototype/indexOf/length.js create mode 100644 test/built-ins/Array/prototype/indexOf/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/join/S15.4.4.5_A6.1.js delete mode 100644 test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js delete mode 100644 test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js delete mode 100644 test/built-ins/Array/prototype/join/S15.4.4.5_A6.4.js delete mode 100644 test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.js create mode 100644 test/built-ins/Array/prototype/join/length.js create mode 100644 test/built-ins/Array/prototype/join/prop-desc.js rename test/built-ins/Array/prototype/keys/{keys.js => prop-desc.js} (100%) delete mode 100644 test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js delete mode 100644 test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js create mode 100644 test/built-ins/Array/prototype/lastIndexOf/length.js create mode 100644 test/built-ins/Array/prototype/lastIndexOf/prop-desc.js create mode 100644 test/built-ins/Array/prototype/length.js delete mode 100644 test/built-ins/Array/prototype/map/15.4.4.19-0-1.js delete mode 100644 test/built-ins/Array/prototype/map/15.4.4.19-0-2.js create mode 100644 test/built-ins/Array/prototype/map/length.js create mode 100644 test/built-ins/Array/prototype/map/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.1.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.4.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.js delete mode 100644 test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.js create mode 100644 test/built-ins/Array/prototype/pop/length.js create mode 100644 test/built-ins/Array/prototype/pop/prop-desc.js create mode 100644 test/built-ins/Array/prototype/prop-desc.js create mode 100644 test/built-ins/Array/prototype/proto.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.1.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.4.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.js delete mode 100644 test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.js create mode 100644 test/built-ins/Array/prototype/push/length.js create mode 100644 test/built-ins/Array/prototype/push/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js delete mode 100644 test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js create mode 100644 test/built-ins/Array/prototype/reduce/length.js create mode 100644 test/built-ins/Array/prototype/reduce/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js delete mode 100644 test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js create mode 100644 test/built-ins/Array/prototype/reduceRight/length.js create mode 100644 test/built-ins/Array/prototype/reduceRight/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.1.js delete mode 100644 test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js delete mode 100644 test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js delete mode 100644 test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.4.js delete mode 100644 test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.js delete mode 100644 test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.js create mode 100644 test/built-ins/Array/prototype/reverse/length.js create mode 100644 test/built-ins/Array/prototype/reverse/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.1.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.2.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.4.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.js delete mode 100644 test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.js create mode 100644 test/built-ins/Array/prototype/shift/length.js create mode 100644 test/built-ins/Array/prototype/shift/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.1.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.2.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.4.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.js delete mode 100644 test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.js create mode 100644 test/built-ins/Array/prototype/slice/length.js create mode 100644 test/built-ins/Array/prototype/slice/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/some/15.4.4.17-0-1.js delete mode 100644 test/built-ins/Array/prototype/some/15.4.4.17-0-2.js create mode 100644 test/built-ins/Array/prototype/some/length.js create mode 100644 test/built-ins/Array/prototype/some/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.1.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.4.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.js delete mode 100644 test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.js create mode 100644 test/built-ins/Array/prototype/sort/length.js create mode 100644 test/built-ins/Array/prototype/sort/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.1.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.4.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.js delete mode 100644 test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.js create mode 100644 test/built-ins/Array/prototype/splice/length.js create mode 100644 test/built-ins/Array/prototype/splice/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.1.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.4.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.js delete mode 100644 test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.js create mode 100644 test/built-ins/Array/prototype/toLocaleString/length.js create mode 100644 test/built-ins/Array/prototype/toLocaleString/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.js delete mode 100644 test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.js create mode 100644 test/built-ins/Array/prototype/toString/prop-desc.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.1.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.4.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.js delete mode 100644 test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.js create mode 100644 test/built-ins/Array/prototype/unshift/length.js create mode 100644 test/built-ins/Array/prototype/unshift/prop-desc.js diff --git a/test/built-ins/Array/constructor.js b/test/built-ins/Array/constructor.js new file mode 100644 index 0000000000..5ee0bd0201 --- /dev/null +++ b/test/built-ins/Array/constructor.js @@ -0,0 +1,10 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array-constructor-array +description: > + The Array constructor is a built-in function +---*/ + +assert.sameValue(typeof Array, 'function'); diff --git a/test/built-ins/Array/proto.js b/test/built-ins/Array/proto.js new file mode 100644 index 0000000000..19ffcba3a8 --- /dev/null +++ b/test/built-ins/Array/proto.js @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-constructor +description: > + The prototype of the Array constructor is the intrinsic object %FunctionPrototype%. +info: | + 22.1.2 Properties of the Array Constructor + + The value of the [[Prototype]] internal slot of the Array constructor is the + intrinsic object %FunctionPrototype%. +---*/ + +assert.sameValue(Object.getPrototypeOf(Array), Function.prototype); diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A1.js b/test/built-ins/Array/prototype/S15.4.3.1_A1.js deleted file mode 100644 index a870752a41..0000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A1.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The Array has property prototype -es5id: 15.4.3.1_A1 -description: Checking use hasOwnProperty ----*/ - -//CHECK#1 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#1: Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A2.js b/test/built-ins/Array/prototype/S15.4.3.1_A2.js deleted file mode 100644 index 96f894a1ff..0000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The Array.prototype property has the attribute DontEnum -es5id: 15.4.3.1_A2 -description: Checking if enumerating the Array.prototype property fails ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('prototype') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'prototype\') === false. Actual: ' + (Array.propertyIsEnumerable('prototype'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "prototype") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "prototype") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A3.js b/test/built-ins/Array/prototype/S15.4.3.1_A3.js deleted file mode 100644 index 5ae77516b0..0000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A3.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The Array.prototype property has the attribute DontDelete -es5id: 15.4.3.1_A3 -description: Checking if deleting the Array.prototype property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#1: Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); -} - -verifyNotConfigurable(Array, "prototype"); - -//CHECK#2 -try { - if((delete Array.prototype) !== false){ - $ERROR('#2: Array.prototype has the attribute DontDelete'); - } -} catch (e) { - if (e instanceof Test262Error) throw e; - assert(e instanceof TypeError); -} - -//CHECK#3 -if (Array.hasOwnProperty('prototype') !== true) { - $ERROR('#3: delete Array.prototype; Array.hasOwnProperty(\'prototype\') === true. Actual: ' + (Array.hasOwnProperty('prototype'))); -} - -//CHECK#4 -if (Array.prototype === undefined) { - $ERROR('#4: delete Array.prototype; Array.prototype !== undefined'); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A4.js b/test/built-ins/Array/prototype/S15.4.3.1_A4.js deleted file mode 100644 index fd62eaff40..0000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A4.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The Array.prototype property has the attribute ReadOnly -es5id: 15.4.3.1_A4 -description: Checking if varying the Array.prototype property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype; -verifyNotWritable(Array, "prototype", null, 1); -if (Array.prototype !== x) { - $ERROR('#1: x = Array.prototype; Array.prototype = 1; Array.prototype === x. Actual: ' + (Array.prototype)); -} diff --git a/test/built-ins/Array/prototype/S15.4.3.1_A5.js b/test/built-ins/Array/prototype/S15.4.3.1_A5.js deleted file mode 100644 index 6c6f5bef4a..0000000000 --- a/test/built-ins/Array/prototype/S15.4.3.1_A5.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of Array.prototype is 0 -es5id: 15.4.3.1_A5 -description: Array.prototype.length === 0 ----*/ - -//CHECK#1 -if (Array.prototype.length !== 0) { - $ERROR('#1.1: Array.prototype.length === 0. Actual: ' + (Array.prototype.length)); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js b/test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js deleted file mode 100644 index aeff0988d0..0000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.1_T1.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - The value of the internal [[Prototype]] property of - the Array prototype object is the Object prototype object -es5id: 15.4.4_A1.1_T1 -description: > - Create new property of Function.prototype. When Array.prototype - object has this property ----*/ - -Object.prototype.myproperty = 1; - -//CHECK#1 -if (Array.prototype.myproperty !== 1) { - $ERROR('#1: Object.prototype.myproperty = 1; Array.prototype.myproperty === 1. Actual: ' + (Array.prototype.myproperty)); -} - -//CHECK#2 -if (Array.prototype.hasOwnProperty('myproperty') !== false) { - $ERROR('#2: Object.prototype.myproperty = 1; Array.prototype.hasOwnProperty(\'myproperty\') === false. Actual: ' + (Array.prototype.hasOwnProperty('myproperty'))); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js b/test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js deleted file mode 100644 index 5438110067..0000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.1_T2.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4_A1.1_T2 -description: > - The Array prototype object is itself an array; its [[Class]] - is "Array", ----*/ - -//CHECK#1 -if (Object.prototype.toString.call(Array.prototype) !== "[object Array]") { - $ERROR('The Array prototype object is itself an array; its' + - '[[Class]] is "Array".'); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js b/test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js deleted file mode 100644 index 86f9edf07e..0000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.1_T3.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - The value of the internal [[Prototype]] property of - the Array prototype object is the Object prototype object -es5id: 15.4.4_A1.1_T3 -description: Checking use isPrototypeOf ----*/ - -//CHECK#1 -if (Object.prototype.isPrototypeOf(Array.prototype) !== true) { - $ERROR('#1: Object.prototype.isPrototypeOf(Array.prototype) === true. Actual: ' + (Object.prototype.isPrototypeOf(Array.prototype))); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js b/test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js deleted file mode 100644 index 0c9cccb559..0000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A1.2_T1.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The [[Class]] property of the Array prototype object is set to "Array" -es5id: 15.4.4_A1.2_T1 -description: Checking use Object.prototype.toString ----*/ - -//CHECK#1 -Array.prototype.getClass = Object.prototype.toString; -if (Array.prototype.getClass() !== "[object " + "Array" + "]") { - $ERROR('#1: Array.prototype.getClass = Object.prototype.toString; Array.prototype is Array object. Actual: ' + (Array.prototype.getClass())); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A2.1_T1.js b/test/built-ins/Array/prototype/S15.4.4_A2.1_T1.js deleted file mode 100644 index 424ed2b6d6..0000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A2.1_T1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - The Array prototype object does not have a valueOf property of - its own; however, it inherits the valueOf property from the valueOf - property from the Object prototype Object -es5id: 15.4.4_A2.1_T1 -description: Checking use hasOwnProperty ----*/ - -//CHECK#1 -if (Array.prototype.hasOwnProperty('valueOf') !== false) { - $ERROR('#1: Array.prototype.hasOwnProperty(\'valueOf\') === false. Actual: ' + (Array.prototype.hasOwnProperty('valueOf'))); -} diff --git a/test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js b/test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js deleted file mode 100644 index 54d9e48474..0000000000 --- a/test/built-ins/Array/prototype/S15.4.4_A2.1_T2.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - The Array prototype object does not have a valueOf property of - its own; however, it inherits the valueOf property from the valueOf - property from the Object prototype Object -es5id: 15.4.4_A2.1_T2 -description: > - Change valueOf property of Object.prototype. When - Array.prototype.valueOf also change ----*/ - -Object.prototype.valueOf = 1; - -//CHECK#1 -if (Array.prototype.valueOf !== 1) { - $ERROR('#1: Object.prototype.valueOf = 1; Array.prototype.valueOf === 1. Actual: ' + (Array.prototype.valueOf)); -} - -//CHECK#2 -var x = new Array(); -if (x.valueOf !== 1) { - $ERROR('#1: Object.prototype.valueOf = 1; x = new Array(); x.valueOf === 1. Actual: ' + (x.valueOf)); -} diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js deleted file mode 100644 index 11de52decb..0000000000 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_arity.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/*--- -es6id: 22.1.3.1_3 -description: Array.prototype.concat arity ----*/ -assert.sameValue(Array.prototype.concat.length, 1); diff --git a/test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js b/test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js deleted file mode 100644 index b2c0a167f4..0000000000 --- a/test/built-ins/Array/prototype/concat/Array.prototype.concat_descriptor.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2014 the V8 project authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - - -/*--- -es6id: 22.1.3.1_3 -description: Array.prototype.concat descriptor ----*/ -var desc = Object.getOwnPropertyDescriptor(Array.prototype, "concat"); -assert.sameValue(desc.enumerable, false); diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.1.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.1.js deleted file mode 100644 index a0ab2f07d7..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of concat has the attribute DontEnum -es5id: 15.4.4.4_A4.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.concat.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.concat.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.concat.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.concat){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.concat) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js deleted file mode 100644 index 6ddfcd66d0..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of concat does not have the attribute DontDelete -es5id: 15.4.4.4_A4.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.concat.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.concat.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.concat.hasOwnProperty('length'))); -} - -delete Array.prototype.concat.length; - -//CHECK#2 -if (Array.prototype.concat.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.concat.length; Array.prototype.concat.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.concat.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.concat.length === undefined) { - $ERROR('#3: delete Array.prototype.concat.length; Array.prototype.concat.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js deleted file mode 100644 index 206c47194e..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of concat has the attribute ReadOnly -es5id: 15.4.4.4_A4.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.concat.length; -verifyNotWritable(Array.prototype.concat, "length", null, Infinity); -if (Array.prototype.concat.length !== x) { - $ERROR('#1: x = Array.prototype.concat.length; Array.prototype.concat.length = Infinity; Array.prototype.concat.length === x. Actual: ' + (Array.prototype.concat.length)); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.4.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.4.js deleted file mode 100644 index ccdfadf2bf..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of concat is 1 -es5id: 15.4.4.4_A4.4 -description: concat.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.concat.length !== 1) { - $ERROR('#1: Array.prototype.concat.length === 1. Actual: ' + (Array.prototype.concat.length)); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.js deleted file mode 100644 index b7aeed7022..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The concat property of Array has the attribute DontEnum -es5id: 15.4.4.4_A4.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('concat') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'concat\') === false. Actual: ' + (Array.propertyIsEnumerable('concat'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "concat") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "concat") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.js deleted file mode 100644 index 195a49a9d1..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The concat property of Array has not prototype property -es5id: 15.4.4.4_A4.6 -description: Checking Array.prototype.concat.prototype ----*/ - -//CHECK#1 -if (Array.prototype.concat.prototype !== undefined) { - $ERROR('#1: Array.prototype.concat.prototype === undefined. Actual: ' + (Array.prototype.concat.prototype)); -} diff --git a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js b/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js deleted file mode 100644 index 5a7e92dfce..0000000000 --- a/test/built-ins/Array/prototype/concat/S15.4.4.4_A4.7.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The concat property of Array can't be used as constructor -es5id: 15.4.4.4_A4.7 -description: > - If property does not implement the internal [[Construct]] method, - throw a TypeError exception ----*/ - -//CHECK#1 - -try { - new Array.prototype.concat(); - $ERROR('#1.1: new Array.prototype.concat() throw TypeError. Actual: ' + (new Array.prototype.concat())); -} catch (e) { - if ((e instanceof TypeError) !== true) { - $ERROR('#1.2: new Array.prototype.concat() throw TypeError. Actual: ' + (e)); - } -} diff --git a/test/built-ins/Array/prototype/concat/length.js b/test/built-ins/Array/prototype/concat/length.js new file mode 100644 index 0000000000..657441f389 --- /dev/null +++ b/test/built-ins/Array/prototype/concat/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.concat +description: > + The "length" property of Array.prototype.concat +info: | + 22.1.3.1 Array.prototype.concat ( ...arguments ) + + The length property of the concat method is 1. + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.concat.length, 1); + +verifyNotEnumerable(Array.prototype.concat, 'length'); +verifyNotWritable(Array.prototype.concat, 'length'); +verifyConfigurable(Array.prototype.concat, 'length'); diff --git a/test/built-ins/Array/prototype/concat/not-a-constructor.js b/test/built-ins/Array/prototype/concat/not-a-constructor.js new file mode 100644 index 0000000000..c69c22c7b5 --- /dev/null +++ b/test/built-ins/Array/prototype/concat/not-a-constructor.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.concat +description: > + Array.prototype.concat is not a constructor. +info: | + 17 ECMAScript Standard Built-in Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. +---*/ + +assert.throws(TypeError, function() { + new Array.prototype.concat(); +}); + +assert.throws(TypeError, function() { + new [].concat(); +}); diff --git a/test/built-ins/Array/prototype/concat/prop-desc.js b/test/built-ins/Array/prototype/concat/prop-desc.js new file mode 100644 index 0000000000..897899142e --- /dev/null +++ b/test/built-ins/Array/prototype/concat/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.concat +description: > + "concat" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.concat, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "concat"); +verifyWritable(Array.prototype, "concat"); +verifyConfigurable(Array.prototype, "concat"); diff --git a/test/built-ins/Array/prototype/constructor.js b/test/built-ins/Array/prototype/constructor.js new file mode 100644 index 0000000000..4530635b59 --- /dev/null +++ b/test/built-ins/Array/prototype/constructor.js @@ -0,0 +1,25 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.constructor +description: > + Array.prototype.constructor +info: | + 22.1.3.2 Array.prototype.constructor + + The initial value of Array.prototype.constructor is the intrinsic object %Array%. + + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.constructor, Array); + +verifyNotEnumerable(Array.prototype, 'constructor'); +verifyWritable(Array.prototype, 'constructor'); +verifyConfigurable(Array.prototype, 'constructor'); diff --git a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js b/test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js deleted file mode 100644 index eaf8d65a59..0000000000 --- a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A1_T1.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - The initial value of Array.prototype.constructor is - the built-in Array constructor -es5id: 15.4.4.1_A1_T1 -description: Array.prototype.constructor === Array ----*/ - -//CHECK#1 -if (Array.prototype.constructor !== Array) { - $ERROR('#1: Array.prototype.constructor === Array. Actual: ' + (Array.prototype.constructor)); -} diff --git a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.js b/test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.js deleted file mode 100644 index b870952046..0000000000 --- a/test/built-ins/Array/prototype/constructor/S15.4.4.1_A2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The constructor property of Array has the attribute DontEnum -es5id: 15.4.4.1_A2 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('constructor') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'constructor\') === false. Actual: ' + (Array.propertyIsEnumerable('constructor'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "constructor") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "constructor") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/copyWithin/copyWithin.js b/test/built-ins/Array/prototype/copyWithin/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/copyWithin/copyWithin.js rename to test/built-ins/Array/prototype/copyWithin/prop-desc.js diff --git a/test/built-ins/Array/prototype/entries/entries.js b/test/built-ins/Array/prototype/entries/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/entries/entries.js rename to test/built-ins/Array/prototype/entries/prop-desc.js diff --git a/test/built-ins/Array/prototype/every/prop-desc.js b/test/built-ins/Array/prototype/every/prop-desc.js new file mode 100644 index 0000000000..0d1b869ca2 --- /dev/null +++ b/test/built-ins/Array/prototype/every/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.every +description: > + "every" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.every, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "every"); +verifyWritable(Array.prototype, "every"); +verifyConfigurable(Array.prototype, "every"); diff --git a/test/built-ins/Array/prototype/exotic-array.js b/test/built-ins/Array/prototype/exotic-array.js new file mode 100644 index 0000000000..e5ecdffccd --- /dev/null +++ b/test/built-ins/Array/prototype/exotic-array.js @@ -0,0 +1,24 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-prototype-object +description: > + Array.prototype is an exoctic array object +info: | + 22.1.3 Properties of the Array Prototype Object + + (...) + The Array prototype object is an Array exotic object and has the internal + methods specified for such objects. +---*/ + +Array.prototype[2] = 42; + +assert.sameValue(Array.prototype.length, 3); +assert.sameValue(Array.prototype[0], undefined, 'Array.prototype[0]'); +assert.sameValue(Array.prototype[1], undefined, 'Array.prototype[1]'); +assert.sameValue(Array.prototype[2], 42, 'Array.prototype[2]'); + +assert.sameValue({}.toString.call(Array.prototype), '[object Array]'); diff --git a/test/built-ins/Array/prototype/fill/fill.js b/test/built-ins/Array/prototype/fill/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/fill/fill.js rename to test/built-ins/Array/prototype/fill/prop-desc.js diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js b/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js deleted file mode 100644 index c507b89db2..0000000000 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.20-0-1 -description: Array.prototype.filter must exist as a function ----*/ - - var f = Array.prototype.filter; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js b/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js deleted file mode 100644 index e5d615e58f..0000000000 --- a/test/built-ins/Array/prototype/filter/15.4.4.20-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.20-0-2 -description: Array.prototype.filter.length must be 1 ----*/ - -assert.sameValue(Array.prototype.filter.length, 1, 'Array.prototype.filter.length'); diff --git a/test/built-ins/Array/prototype/filter/length.js b/test/built-ins/Array/prototype/filter/length.js new file mode 100644 index 0000000000..49c132c33c --- /dev/null +++ b/test/built-ins/Array/prototype/filter/length.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.filter +description: > + The "length" property of Array.prototype.filter +info: | + 22.1.3.7 Array.prototype.filter ( callbackfn [ , thisArg ] ) + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.filter.length, 1); + +verifyNotEnumerable(Array.prototype.filter, 'length'); +verifyNotWritable(Array.prototype.filter, 'length'); +verifyConfigurable(Array.prototype.filter, 'length'); diff --git a/test/built-ins/Array/prototype/filter/prop-desc.js b/test/built-ins/Array/prototype/filter/prop-desc.js new file mode 100644 index 0000000000..62a11c5e59 --- /dev/null +++ b/test/built-ins/Array/prototype/filter/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.filter +description: > + "filter" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.filter, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "filter"); +verifyWritable(Array.prototype, "filter"); +verifyConfigurable(Array.prototype, "filter"); diff --git a/test/built-ins/Array/prototype/find/find.js b/test/built-ins/Array/prototype/find/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/find/find.js rename to test/built-ins/Array/prototype/find/prop-desc.js diff --git a/test/built-ins/Array/prototype/findIndex/findIndex.js b/test/built-ins/Array/prototype/findIndex/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/findIndex/findIndex.js rename to test/built-ins/Array/prototype/findIndex/prop-desc.js diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js deleted file mode 100644 index 4bee8a861b..0000000000 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.18-0-1 -description: Array.prototype.forEach must exist as a function ----*/ - - var f = Array.prototype.forEach; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js b/test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js deleted file mode 100644 index 149383e81d..0000000000 --- a/test/built-ins/Array/prototype/forEach/15.4.4.18-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.18-0-2 -description: Array.prototype.forEach.length must be 1 ----*/ - -assert.sameValue(Array.prototype.forEach.length, 1, 'Array.prototype.forEach.length'); diff --git a/test/built-ins/Array/prototype/forEach/length.js b/test/built-ins/Array/prototype/forEach/length.js new file mode 100644 index 0000000000..a58372f27c --- /dev/null +++ b/test/built-ins/Array/prototype/forEach/length.js @@ -0,0 +1,30 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.forEach +description: > + The "length" property of Array.prototype.forEach +info: | + 22.1.3.10 Array.prototype.forEach ( callbackfn [ , thisArg ] ) + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.forEach.length, 1); + +verifyNotEnumerable(Array.prototype.forEach, 'length'); +verifyNotWritable(Array.prototype.forEach, 'length'); +verifyConfigurable(Array.prototype.forEach, 'length'); diff --git a/test/built-ins/Array/prototype/forEach/prop-desc.js b/test/built-ins/Array/prototype/forEach/prop-desc.js new file mode 100644 index 0000000000..bdbfe25054 --- /dev/null +++ b/test/built-ins/Array/prototype/forEach/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.forEach +description: > + "forEach" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.forEach, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "forEach"); +verifyWritable(Array.prototype, "forEach"); +verifyConfigurable(Array.prototype, "forEach"); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js deleted file mode 100644 index 68068f4525..0000000000 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.14-0-1 -description: Array.prototype.indexOf must exist as a function ----*/ - - var f = Array.prototype.indexOf; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js b/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js deleted file mode 100644 index 3294781683..0000000000 --- a/test/built-ins/Array/prototype/indexOf/15.4.4.14-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.14-0-2 -description: Array.prototype.indexOf has a length property whose value is 1. ----*/ - -assert.sameValue(Array.prototype.indexOf.length, 1, 'Array.prototype.indexOf.length'); diff --git a/test/built-ins/Array/prototype/indexOf/length.js b/test/built-ins/Array/prototype/indexOf/length.js new file mode 100644 index 0000000000..c0bc818491 --- /dev/null +++ b/test/built-ins/Array/prototype/indexOf/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.indexof +description: > + The "length" property of Array.prototype.indexOf +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.indexOf.length, 1); + +verifyNotEnumerable(Array.prototype.indexOf, 'length'); +verifyNotWritable(Array.prototype.indexOf, 'length'); +verifyConfigurable(Array.prototype.indexOf, 'length'); diff --git a/test/built-ins/Array/prototype/indexOf/prop-desc.js b/test/built-ins/Array/prototype/indexOf/prop-desc.js new file mode 100644 index 0000000000..26fd3a8c65 --- /dev/null +++ b/test/built-ins/Array/prototype/indexOf/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.indexof +description: > + "indexOf" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.indexOf, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "indexOf"); +verifyWritable(Array.prototype, "indexOf"); +verifyConfigurable(Array.prototype, "indexOf"); diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.1.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.1.js deleted file mode 100644 index 0980d2090f..0000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of join has the attribute DontEnum -es5id: 15.4.4.5_A6.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.join.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.join.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.join.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.join){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.join) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js deleted file mode 100644 index 3c5cc0b9a8..0000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of join does not have the attribute DontDelete -es5id: 15.4.4.5_A6.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.join.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.join.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.join.hasOwnProperty('length'))); -} - -delete Array.prototype.join.length; - -//CHECK#2 -if (Array.prototype.join.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.join.length; Array.prototype.join.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.join.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.join.length === undefined) { - $ERROR('#3: delete Array.prototype.join.length; Array.prototype.join.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js deleted file mode 100644 index 0a0391e6a4..0000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of join has the attribute ReadOnly -es5id: 15.4.4.5_A6.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.join.length; -verifyNotWritable(Array.prototype.join, "length", null, Infinity); -if (Array.prototype.join.length !== x) { - $ERROR('#1: x = Array.prototype.join.length; Array.prototype.join.length = Infinity; Array.prototype.join.length === x. Actual: ' + (Array.prototype.join.length)); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.4.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.4.js deleted file mode 100644 index 272672ecbe..0000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of join is 1 -es5id: 15.4.4.5_A6.4 -description: join.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.join.length !== 1) { - $ERROR('#1: Array.prototype.join.length === 1. Actual: ' + (Array.prototype.join.length)); -} diff --git a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.js b/test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.js deleted file mode 100644 index dd5dd6b9cf..0000000000 --- a/test/built-ins/Array/prototype/join/S15.4.4.5_A6.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The join property of Array has the attribute DontEnum -es5id: 15.4.4.5_A6.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('join') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'join\') === false. Actual: ' + (Array.propertyIsEnumerable('join'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "join") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "join") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/join/length.js b/test/built-ins/Array/prototype/join/length.js new file mode 100644 index 0000000000..a8fa14f253 --- /dev/null +++ b/test/built-ins/Array/prototype/join/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.join +description: > + The "length" property of Array.prototype.join +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.join.length, 1); + +verifyNotEnumerable(Array.prototype.join, 'length'); +verifyNotWritable(Array.prototype.join, 'length'); +verifyConfigurable(Array.prototype.join, 'length'); diff --git a/test/built-ins/Array/prototype/join/prop-desc.js b/test/built-ins/Array/prototype/join/prop-desc.js new file mode 100644 index 0000000000..9d9b806f5f --- /dev/null +++ b/test/built-ins/Array/prototype/join/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.join +description: > + "join" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.join, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "join"); +verifyWritable(Array.prototype, "join"); +verifyConfigurable(Array.prototype, "join"); diff --git a/test/built-ins/Array/prototype/keys/keys.js b/test/built-ins/Array/prototype/keys/prop-desc.js similarity index 100% rename from test/built-ins/Array/prototype/keys/keys.js rename to test/built-ins/Array/prototype/keys/prop-desc.js diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js deleted file mode 100644 index 2ab710995f..0000000000 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.15-0-1 -description: Array.prototype.lastIndexOf must exist as a function ----*/ - - var f = Array.prototype.lastIndexOf; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js b/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js deleted file mode 100644 index 3cda6dac6a..0000000000 --- a/test/built-ins/Array/prototype/lastIndexOf/15.4.4.15-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.15-0-2 -description: Array.prototype.lastIndexOf has a length property whose value is 1. ----*/ - -assert.sameValue(Array.prototype.lastIndexOf.length, 1, 'Array.prototype.lastIndexOf.length'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/length.js b/test/built-ins/Array/prototype/lastIndexOf/length.js new file mode 100644 index 0000000000..6084d8482c --- /dev/null +++ b/test/built-ins/Array/prototype/lastIndexOf/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.lastindexof +description: > + The "length" property of Array.prototype.lastIndexOf +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.lastIndexOf.length, 1); + +verifyNotEnumerable(Array.prototype.lastIndexOf, 'length'); +verifyNotWritable(Array.prototype.lastIndexOf, 'length'); +verifyConfigurable(Array.prototype.lastIndexOf, 'length'); diff --git a/test/built-ins/Array/prototype/lastIndexOf/prop-desc.js b/test/built-ins/Array/prototype/lastIndexOf/prop-desc.js new file mode 100644 index 0000000000..b882aeebce --- /dev/null +++ b/test/built-ins/Array/prototype/lastIndexOf/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.lastindexof +description: > + "lastIndexOf" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.lastIndexOf, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "lastIndexOf"); +verifyWritable(Array.prototype, "lastIndexOf"); +verifyConfigurable(Array.prototype, "lastIndexOf"); diff --git a/test/built-ins/Array/prototype/length.js b/test/built-ins/Array/prototype/length.js new file mode 100644 index 0000000000..35a38c4f55 --- /dev/null +++ b/test/built-ins/Array/prototype/length.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-prototype-object +description: > + Array.prototype has a length property +info: | + 22.1.3 Properties of the Array Prototype Object + + The Array prototype object is the intrinsic object %ArrayPrototype%. The Array + prototype object is an Array exotic object and has the internal methods specified + for such objects. It has a length property whose initial value is 0 and whose + attributes are { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: + false }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.length, 0); + +verifyNotEnumerable(Array.prototype, 'length'); +// specify the value so it avoids a RangeError while setting the length +verifyWritable(Array.prototype, 'length', false, 42); +verifyNotConfigurable(Array.prototype, 'length'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-0-1.js b/test/built-ins/Array/prototype/map/15.4.4.19-0-1.js deleted file mode 100644 index 8d05c641ec..0000000000 --- a/test/built-ins/Array/prototype/map/15.4.4.19-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.19-0-1 -description: Array.prototype.map must exist as a function ----*/ - - var f = Array.prototype.map; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/map/15.4.4.19-0-2.js b/test/built-ins/Array/prototype/map/15.4.4.19-0-2.js deleted file mode 100644 index 6d2d6f65bd..0000000000 --- a/test/built-ins/Array/prototype/map/15.4.4.19-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.19-0-2 -description: Array.prototype.map.length must be 1 ----*/ - -assert.sameValue(Array.prototype.map.length, 1, 'Array.prototype.map.length'); diff --git a/test/built-ins/Array/prototype/map/length.js b/test/built-ins/Array/prototype/map/length.js new file mode 100644 index 0000000000..af037e98b5 --- /dev/null +++ b/test/built-ins/Array/prototype/map/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.map +description: > + The "length" property of Array.prototype.map +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.map.length, 1); + +verifyNotEnumerable(Array.prototype.map, 'length'); +verifyNotWritable(Array.prototype.map, 'length'); +verifyConfigurable(Array.prototype.map, 'length'); diff --git a/test/built-ins/Array/prototype/map/prop-desc.js b/test/built-ins/Array/prototype/map/prop-desc.js new file mode 100644 index 0000000000..7533034e15 --- /dev/null +++ b/test/built-ins/Array/prototype/map/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.map +description: > + "map" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.map, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "map"); +verifyWritable(Array.prototype, "map"); +verifyConfigurable(Array.prototype, "map"); diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.1.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.1.js deleted file mode 100644 index 9460c82c0a..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of pop has the attribute DontEnum -es5id: 15.4.4.6_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.pop.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.pop.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.pop.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.pop){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.pop) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js deleted file mode 100644 index b84b2a96af..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of pop does not have the attribute DontDelete -es5id: 15.4.4.6_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.pop.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.pop.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.pop.hasOwnProperty('length'))); -} - -delete Array.prototype.pop.length; - -//CHECK#2 -if (Array.prototype.pop.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.pop.length; Array.prototype.pop.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.pop.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.pop.length === undefined) { - $ERROR('#3: delete Array.prototype.pop.length; Array.prototype.pop.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js deleted file mode 100644 index bec89ff414..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of pop has the attribute ReadOnly -es5id: 15.4.4.6_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.pop.length; -verifyNotWritable(Array.prototype.pop, "length", null, Infinity); -if (Array.prototype.pop.length !== x) { - $ERROR('#1: x = Array.prototype.pop.length; Array.prototype.pop.length = Infinity; Array.prototype.pop.length === x. Actual: ' + (Array.prototype.pop.length)); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.4.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.4.js deleted file mode 100644 index 41e2bc9fd9..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of pop is 0 -es5id: 15.4.4.6_A5.4 -description: pop.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.pop.length !== 0) { - $ERROR('#1: Array.prototype.pop.length === 0. Actual: ' + (Array.prototype.pop.length)); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.js deleted file mode 100644 index 2546e4f964..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The pop property of Array has the attribute DontEnum -es5id: 15.4.4.6_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('pop') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'pop\') === false. Actual: ' + (Array.propertyIsEnumerable('pop'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "pop") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "pop") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.js b/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.js deleted file mode 100644 index 7e6b9090e3..0000000000 --- a/test/built-ins/Array/prototype/pop/S15.4.4.6_A5.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The pop property of Array has not prototype property -es5id: 15.4.4.6_A5.6 -description: Checking Array.prototype.pop.prototype ----*/ - -//CHECK#1 -if (Array.prototype.pop.prototype !== undefined) { - $ERROR('#1: Array.prototype.pop.prototype === undefined. Actual: ' + (Array.prototype.pop.prototype)); -} diff --git a/test/built-ins/Array/prototype/pop/length.js b/test/built-ins/Array/prototype/pop/length.js new file mode 100644 index 0000000000..d406ade497 --- /dev/null +++ b/test/built-ins/Array/prototype/pop/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.pop +description: > + The "length" property of Array.prototype.pop +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.pop.length, 0); + +verifyNotEnumerable(Array.prototype.pop, 'length'); +verifyNotWritable(Array.prototype.pop, 'length'); +verifyConfigurable(Array.prototype.pop, 'length'); diff --git a/test/built-ins/Array/prototype/pop/prop-desc.js b/test/built-ins/Array/prototype/pop/prop-desc.js new file mode 100644 index 0000000000..5c8a9f5a47 --- /dev/null +++ b/test/built-ins/Array/prototype/pop/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.pop +description: > + "pop" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.pop, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "pop"); +verifyWritable(Array.prototype, "pop"); +verifyConfigurable(Array.prototype, "pop"); diff --git a/test/built-ins/Array/prototype/prop-desc.js b/test/built-ins/Array/prototype/prop-desc.js new file mode 100644 index 0000000000..7f246469bd --- /dev/null +++ b/test/built-ins/Array/prototype/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype +description: > + The property descriptor of Array.prototype +info: | + 22.1.2.4 Array.prototype + + The value of Array.prototype is %ArrayPrototype%, the intrinsic Array prototype object. + + This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: false }. +includes: [propertyHelper.js] +---*/ + +verifyNotEnumerable(Array, 'prototype'); +verifyNotWritable(Array, 'prototype'); +verifyNotConfigurable(Array, 'prototype'); diff --git a/test/built-ins/Array/prototype/proto.js b/test/built-ins/Array/prototype/proto.js new file mode 100644 index 0000000000..c75dc27b51 --- /dev/null +++ b/test/built-ins/Array/prototype/proto.js @@ -0,0 +1,15 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-properties-of-the-array-prototype-object +description: > + The [[Prototype]] of Array.prototype is Object.Prototype. +info: | + 22.1.3 Properties of the Array Prototype Object + + The value of the [[Prototype]] internal slot of the Array prototype object is + the intrinsic object %ObjectPrototype%. +---*/ + +assert.sameValue(Object.getPrototypeOf(Array.prototype), Object.prototype); diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.1.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.1.js deleted file mode 100644 index 90a12e90e1..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of push has the attribute DontEnum -es5id: 15.4.4.7_A6.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.push.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.push.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.push.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.push){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.push) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js deleted file mode 100644 index b7e5c85e36..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of push does not have the attribute DontDelete -es5id: 15.4.4.7_A6.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.push.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.push.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.push.hasOwnProperty('length'))); -} - -delete Array.prototype.push.length; - -//CHECK#2 -if (Array.prototype.push.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.push.length; Array.prototype.push.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.push.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.push.length === undefined) { - $ERROR('#3: delete Array.prototype.push.length; Array.prototype.push.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js deleted file mode 100644 index 6b1dcf8e04..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of push has the attribute ReadOnly -es5id: 15.4.4.7_A6.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.push.length; -verifyNotWritable(Array.prototype.push, "length", null, Infinity); -if (Array.prototype.push.length !== x) { - $ERROR('#1: x = Array.prototype.push.length; Array.prototype.push.length = Infinity; Array.prototype.push.length === x. Actual: ' + (Array.prototype.push.length)); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.4.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.4.js deleted file mode 100644 index 67b319181d..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of push is 1 -es5id: 15.4.4.7_A6.4 -description: push.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.push.length !== 1) { - $ERROR('#1: Array.prototype.push.length === 1. Actual: ' + (Array.prototype.push.length)); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.js deleted file mode 100644 index 60b48d5cf2..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The push property of Array has the attribute DontEnum -es5id: 15.4.4.7_A6.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('push') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'push\') === false. Actual: ' + (Array.propertyIsEnumerable('push'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "push") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "push") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.js b/test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.js deleted file mode 100644 index cb8ec123c3..0000000000 --- a/test/built-ins/Array/prototype/push/S15.4.4.7_A6.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The push property of Array has not prototype property -es5id: 15.4.4.7_A6.6 -description: Checking Array.prototype.push.prototype ----*/ - -//CHECK#1 -if (Array.prototype.push.prototype !== undefined) { - $ERROR('#1: Array.prototype.push.prototype === undefined. Actual: ' + (Array.prototype.push.prototype)); -} diff --git a/test/built-ins/Array/prototype/push/length.js b/test/built-ins/Array/prototype/push/length.js new file mode 100644 index 0000000000..33d43ba268 --- /dev/null +++ b/test/built-ins/Array/prototype/push/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.push +description: > + The "length" property of Array.prototype.push +info: | + 22.1.3.18 Array.prototype.push ( ...items ) + + The length property of the push method is 1. + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.push.length, 1); + +verifyNotEnumerable(Array.prototype.push, 'length'); +verifyNotWritable(Array.prototype.push, 'length'); +verifyConfigurable(Array.prototype.push, 'length'); diff --git a/test/built-ins/Array/prototype/push/prop-desc.js b/test/built-ins/Array/prototype/push/prop-desc.js new file mode 100644 index 0000000000..157275c1e6 --- /dev/null +++ b/test/built-ins/Array/prototype/push/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.push +description: > + "push" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.push, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "push"); +verifyWritable(Array.prototype, "push"); +verifyConfigurable(Array.prototype, "push"); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js deleted file mode 100644 index b6a168723e..0000000000 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.21-0-1 -description: Array.prototype.reduce must exist as a function ----*/ - - var f = Array.prototype.reduce; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js b/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js deleted file mode 100644 index 06afb159dd..0000000000 --- a/test/built-ins/Array/prototype/reduce/15.4.4.21-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.21-0-2 -description: Array.prototype.reduce.length must be 1 ----*/ - -assert.sameValue(Array.prototype.reduce.length, 1, 'Array.prototype.reduce.length'); diff --git a/test/built-ins/Array/prototype/reduce/length.js b/test/built-ins/Array/prototype/reduce/length.js new file mode 100644 index 0000000000..afc2b80eeb --- /dev/null +++ b/test/built-ins/Array/prototype/reduce/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduce +description: > + The "length" property of Array.prototype.reduce +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.reduce.length, 1); + +verifyNotEnumerable(Array.prototype.reduce, 'length'); +verifyNotWritable(Array.prototype.reduce, 'length'); +verifyConfigurable(Array.prototype.reduce, 'length'); diff --git a/test/built-ins/Array/prototype/reduce/prop-desc.js b/test/built-ins/Array/prototype/reduce/prop-desc.js new file mode 100644 index 0000000000..9e8b41170b --- /dev/null +++ b/test/built-ins/Array/prototype/reduce/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduce +description: > + "reduce" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.reduce, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "reduce"); +verifyWritable(Array.prototype, "reduce"); +verifyConfigurable(Array.prototype, "reduce"); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js deleted file mode 100644 index 1613735e85..0000000000 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.22-0-1 -description: Array.prototype.reduceRight must exist as a function ----*/ - - var f = Array.prototype.reduceRight; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js b/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js deleted file mode 100644 index 21322d512d..0000000000 --- a/test/built-ins/Array/prototype/reduceRight/15.4.4.22-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.22-0-2 -description: Array.prototype.reduceRight.length must be 1 ----*/ - -assert.sameValue(Array.prototype.reduceRight.length, 1, 'Array.prototype.reduceRight.length'); diff --git a/test/built-ins/Array/prototype/reduceRight/length.js b/test/built-ins/Array/prototype/reduceRight/length.js new file mode 100644 index 0000000000..a74578c096 --- /dev/null +++ b/test/built-ins/Array/prototype/reduceRight/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduceright +description: > + The "length" property of Array.prototype.reduceRight +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.reduceRight.length, 1); + +verifyNotEnumerable(Array.prototype.reduceRight, 'length'); +verifyNotWritable(Array.prototype.reduceRight, 'length'); +verifyConfigurable(Array.prototype.reduceRight, 'length'); diff --git a/test/built-ins/Array/prototype/reduceRight/prop-desc.js b/test/built-ins/Array/prototype/reduceRight/prop-desc.js new file mode 100644 index 0000000000..502b5164da --- /dev/null +++ b/test/built-ins/Array/prototype/reduceRight/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reduceright +description: > + "reduceRight" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.reduceRight, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "reduceRight"); +verifyWritable(Array.prototype, "reduceRight"); +verifyConfigurable(Array.prototype, "reduceRight"); diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.1.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.1.js deleted file mode 100644 index 267ddba834..0000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of reverse has the attribute DontEnum -es5id: 15.4.4.8_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.reverse.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.reverse.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.reverse.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (p in Array.prototype.reverse){ - if (p === "length") { - var result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.reverse) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js deleted file mode 100644 index 13cde2c9ce..0000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of reverse does not have the attribute DontDelete -es5id: 15.4.4.8_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.reverse.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.reverse.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.reverse.hasOwnProperty('length'))); -} - -delete Array.prototype.reverse.length; - -//CHECK#2 -if (Array.prototype.reverse.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.reverse.length; Array.prototype.reverse.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.reverse.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.reverse.length === undefined) { - $ERROR('#3: delete Array.prototype.reverse.length; Array.prototype.reverse.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js deleted file mode 100644 index d18c4bad86..0000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of reverse has the attribute ReadOnly -es5id: 15.4.4.8_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.reverse.length; -verifyNotWritable(Array.prototype.reverse, "length", null, Infinity); -if (Array.prototype.reverse.length !== x) { - $ERROR('#1: x = Array.prototype.reverse.length; Array.prototype.reverse.length = Infinity; Array.prototype.reverse.length === x. Actual: ' + (Array.prototype.reverse.length)); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.4.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.4.js deleted file mode 100644 index 231f9045ee..0000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of reverse is 0 -es5id: 15.4.4.8_A5.4 -description: reverse.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.reverse.length !== 0) { - $ERROR('#1: Array.prototype.reverse.length === 0. Actual: ' + (Array.prototype.reverse.length)); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.js deleted file mode 100644 index 9dd52c52fb..0000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The reverse property of Array has the attribute DontEnum -es5id: 15.4.4.8_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('reverse') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'reverse\') === false. Actual: ' + (Array.propertyIsEnumerable('reverse'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "reverse") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "reverse") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.js b/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.js deleted file mode 100644 index 288babcf01..0000000000 --- a/test/built-ins/Array/prototype/reverse/S15.4.4.8_A5.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The reverse property of Array has not prototype property -es5id: 15.4.4.8_A5.6 -description: Checking Array.prototype.reverse.prototype ----*/ - -//CHECK#1 -if (Array.prototype.reverse.prototype !== undefined) { - $ERROR('#1: Array.prototype.reverse.prototype === undefined. Actual: ' + (Array.prototype.reverse.prototype)); -} diff --git a/test/built-ins/Array/prototype/reverse/length.js b/test/built-ins/Array/prototype/reverse/length.js new file mode 100644 index 0000000000..d969a5ff72 --- /dev/null +++ b/test/built-ins/Array/prototype/reverse/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reverse +description: > + The "length" property of Array.prototype.reverse +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.reverse.length, 0); + +verifyNotEnumerable(Array.prototype.reverse, 'length'); +verifyNotWritable(Array.prototype.reverse, 'length'); +verifyConfigurable(Array.prototype.reverse, 'length'); diff --git a/test/built-ins/Array/prototype/reverse/prop-desc.js b/test/built-ins/Array/prototype/reverse/prop-desc.js new file mode 100644 index 0000000000..c5f0a83480 --- /dev/null +++ b/test/built-ins/Array/prototype/reverse/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.reverse +description: > + "reverse" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.reverse, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "reverse"); +verifyWritable(Array.prototype, "reverse"); +verifyConfigurable(Array.prototype, "reverse"); diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.1.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.1.js deleted file mode 100644 index 38652362ab..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of shift has the attribute DontEnum -es5id: 15.4.4.9_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.shift.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.shift.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.shift.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.shift){ - if (p === "length") { - result = false; -} -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.shift) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.2.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.2.js deleted file mode 100644 index a9e197ce3e..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of shift does not have the attribute DontDelete -es5id: 15.4.4.9_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.shift.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.shift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.shift.hasOwnProperty('length'))); -} - -delete Array.prototype.shift.length; - -//CHECK#2 -if (Array.prototype.shift.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.shift.length; Array.prototype.shift.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.shift.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.shift.length === undefined) { - $ERROR('#3: delete Array.prototype.shift.length; Array.prototype.shift.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js deleted file mode 100644 index a3c2ea971d..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of shift has the attribute ReadOnly -es5id: 15.4.4.9_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.shift.length; -verifyNotWritable(Array.prototype.shift, "length", null, Infinity); -if (Array.prototype.shift.length !== x) { - $ERROR('#1: x = Array.prototype.shift.length; Array.prototype.shift.length = Infinity; Array.prototype.shift.length === x. Actual: ' + (Array.prototype.shift.length)); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.4.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.4.js deleted file mode 100644 index fcc6ab4ef3..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of shift is 0 -es5id: 15.4.4.9_A5.4 -description: shift.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.shift.length !== 0) { - $ERROR('#1: Array.prototype.shift.length === 0. Actual: ' + (Array.prototype.shift.length)); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.js deleted file mode 100644 index b78bd52baa..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The shift property of Array has the attribute DontEnum -es5id: 15.4.4.9_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('shift') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'shift\') === false. Actual: ' + (Array.propertyIsEnumerable('shift'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "shift") { - result = false; -} -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "shift") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.js b/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.js deleted file mode 100644 index 4c4043f92c..0000000000 --- a/test/built-ins/Array/prototype/shift/S15.4.4.9_A5.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The shift property of Array has not prototype property -es5id: 15.4.4.9_A5.6 -description: Checking Array.prototype.shift.prototype ----*/ - -//CHECK#1 -if (Array.prototype.shift.prototype !== undefined) { - $ERROR('#1: Array.prototype.shift.prototype === undefined. Actual: ' + (Array.prototype.shift.prototype)); -} diff --git a/test/built-ins/Array/prototype/shift/length.js b/test/built-ins/Array/prototype/shift/length.js new file mode 100644 index 0000000000..7f8a08a3df --- /dev/null +++ b/test/built-ins/Array/prototype/shift/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.shift +description: > + The "length" property of Array.prototype.shift +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.shift.length, 0); + +verifyNotEnumerable(Array.prototype.shift, 'length'); +verifyNotWritable(Array.prototype.shift, 'length'); +verifyConfigurable(Array.prototype.shift, 'length'); diff --git a/test/built-ins/Array/prototype/shift/prop-desc.js b/test/built-ins/Array/prototype/shift/prop-desc.js new file mode 100644 index 0000000000..5dfe34447d --- /dev/null +++ b/test/built-ins/Array/prototype/shift/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.shift +description: > + "shift" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.shift, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "shift"); +verifyWritable(Array.prototype, "shift"); +verifyConfigurable(Array.prototype, "shift"); diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.1.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.1.js deleted file mode 100644 index a9679ef2bf..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of slice has the attribute DontEnum -es5id: 15.4.4.10_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.slice.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.slice.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.slice.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.slice){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.slice) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.2.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.2.js deleted file mode 100644 index 24f1bafef2..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of slice does not have the attribute DontDelete -es5id: 15.4.4.10_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.slice.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.slice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.slice.hasOwnProperty('length'))); -} - -delete Array.prototype.slice.length; - -//CHECK#2 -if (Array.prototype.slice.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.slice.length; Array.prototype.slice.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.slice.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.slice.length === undefined) { - $ERROR('#3: delete Array.prototype.slice.length; Array.prototype.slice.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js deleted file mode 100644 index f50e5af1eb..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of slice has the attribute ReadOnly -es5id: 15.4.4.10_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.slice.length; -verifyNotWritable(Array.prototype.slice, "length", null, Infinity); -if (Array.prototype.slice.length !== x) { - $ERROR('#1: x = Array.prototype.slice.length; Array.prototype.slice.length = Infinity; Array.prototypeslice.length === x. Actual: ' + (Array.prototypeslice.length)); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.4.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.4.js deleted file mode 100644 index b166d1f5b8..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of slice is 2 -es5id: 15.4.4.10_A5.4 -description: slice.length === 2 ----*/ - -//CHECK#1 -if (Array.prototype.slice.length !== 2) { - $ERROR('#1: Array.prototype.slice.length === 2. Actual: ' + (Array.prototype.slice.length)); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.js deleted file mode 100644 index 631d05cfae..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The slice property of Array has the attribute DontEnum -es5id: 15.4.4.10_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('slice') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'slice\') === false. Actual: ' + (Array.propertyIsEnumerable('slice'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "slice") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "slice") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.js b/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.js deleted file mode 100644 index 529cb789fb..0000000000 --- a/test/built-ins/Array/prototype/slice/S15.4.4.10_A5.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The slice property of Array has not prototype property -es5id: 15.4.4.10_A5.6 -description: Checking Array.prototype.slice.prototype ----*/ - -//CHECK#1 -if (Array.prototype.slice.prototype !== undefined) { - $ERROR('#1: Array.prototype.slice.prototype === undefined. Actual: ' + (Array.prototype.slice.prototype)); -} diff --git a/test/built-ins/Array/prototype/slice/length.js b/test/built-ins/Array/prototype/slice/length.js new file mode 100644 index 0000000000..314fc6964e --- /dev/null +++ b/test/built-ins/Array/prototype/slice/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.slice +description: > + The "length" property of Array.prototype.slice +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.slice.length, 2); + +verifyNotEnumerable(Array.prototype.slice, 'length'); +verifyNotWritable(Array.prototype.slice, 'length'); +verifyConfigurable(Array.prototype.slice, 'length'); diff --git a/test/built-ins/Array/prototype/slice/prop-desc.js b/test/built-ins/Array/prototype/slice/prop-desc.js new file mode 100644 index 0000000000..e587959c3e --- /dev/null +++ b/test/built-ins/Array/prototype/slice/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.slice +description: > + "slice" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.slice, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "slice"); +verifyWritable(Array.prototype, "slice"); +verifyConfigurable(Array.prototype, "slice"); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-0-1.js b/test/built-ins/Array/prototype/some/15.4.4.17-0-1.js deleted file mode 100644 index 5631376e0f..0000000000 --- a/test/built-ins/Array/prototype/some/15.4.4.17-0-1.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.17-0-1 -description: Array.prototype.some must exist as a function ----*/ - - var f = Array.prototype.some; - -assert.sameValue(typeof(f), "function", 'typeof(f)'); diff --git a/test/built-ins/Array/prototype/some/15.4.4.17-0-2.js b/test/built-ins/Array/prototype/some/15.4.4.17-0-2.js deleted file mode 100644 index 6d60a2dc4f..0000000000 --- a/test/built-ins/Array/prototype/some/15.4.4.17-0-2.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 15.4.4.17-0-2 -description: Array.prototype.some.length must be 1 ----*/ - -assert.sameValue(Array.prototype.some.length, 1, 'Array.prototype.some.length'); diff --git a/test/built-ins/Array/prototype/some/length.js b/test/built-ins/Array/prototype/some/length.js new file mode 100644 index 0000000000..e52105a07a --- /dev/null +++ b/test/built-ins/Array/prototype/some/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.some +description: > + The "length" property of Array.prototype.some +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.some.length, 1); + +verifyNotEnumerable(Array.prototype.some, 'length'); +verifyNotWritable(Array.prototype.some, 'length'); +verifyConfigurable(Array.prototype.some, 'length'); diff --git a/test/built-ins/Array/prototype/some/prop-desc.js b/test/built-ins/Array/prototype/some/prop-desc.js new file mode 100644 index 0000000000..421fea30ab --- /dev/null +++ b/test/built-ins/Array/prototype/some/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.some +description: > + "some" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.some, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "some"); +verifyWritable(Array.prototype, "some"); +verifyConfigurable(Array.prototype, "some"); diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.1.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.1.js deleted file mode 100644 index eff900aedf..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of sort has the attribute DontEnum -es5id: 15.4.4.11_A7.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.sort.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.sort.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.sort.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.sort){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.sort) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js deleted file mode 100644 index daa228ead3..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of sort does not have the attribute DontDelete -es5id: 15.4.4.11_A7.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.sort.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.sort.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.sort.hasOwnProperty('length'))); -} - -delete Array.prototype.sort.length; - -//CHECK#2 -if (Array.prototype.sort.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.sort.length; Array.prototype.sort.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.sort.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.sort.length === undefined) { - $ERROR('#3: delete Array.prototype.sort.length; Array.prototype.sort.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js deleted file mode 100644 index a8497cb9a9..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of sort has the attribute ReadOnly -es5id: 15.4.4.11_A7.3 -description: Checking if varying the length fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.sort.length; -verifyNotWritable(Array.prototype.sort, "length", null, Infinity); -if (Array.prototype.sort.length !== x) { - $ERROR('#1: x = Array.prototype.sort.length; Array.prototype.sort.length = Infinity; Array.prototype.sort.length === x. Actual: ' + (Array.prototype.sort.length)); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.4.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.4.js deleted file mode 100644 index fb6fb92fd0..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of sort is 1 -es5id: 15.4.4.11_A7.4 -description: sort.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.sort.length !== 1) { - $ERROR('#1: Array.prototype.sort.length === 1. Actual: ' + (Array.prototype.sort.length)); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.js deleted file mode 100644 index dbe7289dda..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The sort property of Array has the attribute DontEnum -es5id: 15.4.4.11_A7.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('sort') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'sort\') === false. Actual: ' + (Array.propertyIsEnumerable('sort'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "sort") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "sort") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.js b/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.js deleted file mode 100644 index 9d37b15b7a..0000000000 --- a/test/built-ins/Array/prototype/sort/S15.4.4.11_A7.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The sort property of Array has not prototype property -es5id: 15.4.4.11_A7.6 -description: Checking Array.prototype.sort.prototype ----*/ - -//CHECK#1 -if (Array.prototype.sort.prototype !== undefined) { - $ERROR('#1: Array.prototype.sort.prototype === undefined. Actual: ' + (Array.prototype.sort.prototype)); -} diff --git a/test/built-ins/Array/prototype/sort/length.js b/test/built-ins/Array/prototype/sort/length.js new file mode 100644 index 0000000000..6fe160963a --- /dev/null +++ b/test/built-ins/Array/prototype/sort/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + The "length" property of Array.prototype.sort +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.sort.length, 1); + +verifyNotEnumerable(Array.prototype.sort, 'length'); +verifyNotWritable(Array.prototype.sort, 'length'); +verifyConfigurable(Array.prototype.sort, 'length'); diff --git a/test/built-ins/Array/prototype/sort/prop-desc.js b/test/built-ins/Array/prototype/sort/prop-desc.js new file mode 100644 index 0000000000..1e2e6d1f1f --- /dev/null +++ b/test/built-ins/Array/prototype/sort/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + "sort" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.sort, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "sort"); +verifyWritable(Array.prototype, "sort"); +verifyConfigurable(Array.prototype, "sort"); diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.1.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.1.js deleted file mode 100644 index 5a1b9297cc..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of splice has the attribute DontEnum -es5id: 15.4.4.12_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.splice.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.splice.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.splice.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.splice){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.splice) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js deleted file mode 100644 index 741608e432..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of splice does not have the attribute DontDelete -es5id: 15.4.4.12_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.splice.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.splice.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.splice.hasOwnProperty('length'))); -} - -delete Array.prototype.splice.length; - -//CHECK#2 -if (Array.prototype.splice.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.splice.length; Array.prototype.splice.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.splice.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.splice.length === undefined) { - $ERROR('#3: delete Array.prototype.splice.length; Array.prototype.splice.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js deleted file mode 100644 index 8d250f3411..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of splice has the attribute ReadOnly -es5id: 15.4.4.12_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.splice.length; -verifyNotWritable(Array.prototype.splice, "length", null, Infinity); -if (Array.prototype.splice.length !== x) { - $ERROR('#1: x = Array.prototype.splice.length; Array.prototype.splice.length = Infinity; Array.prototype.splice.length === x. Actual: ' + (Array.prototype.splice.length)); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.4.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.4.js deleted file mode 100644 index 43cccec64b..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of splice is 2 -es5id: 15.4.4.12_A5.4 -description: splice.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.splice.length !== 2) { - $ERROR('#1: Array.prototype.splice.length === 2. Actual: ' + (Array.prototype.splice.length)); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.js deleted file mode 100644 index 8249396400..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The splice property of Array has the attribute DontEnum -es5id: 15.4.4.12_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('splice') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'splice\') === false. Actual: ' + (Array.propertyIsEnumerable('splice'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "splice") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "splice") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.js b/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.js deleted file mode 100644 index ba2034ba63..0000000000 --- a/test/built-ins/Array/prototype/splice/S15.4.4.12_A5.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The splice property of Array has not prototype property -es5id: 15.4.4.12_A5.6 -description: Checking Array.prototype.splice.prototype ----*/ - -//CHECK#1 -if (Array.prototype.splice.prototype !== undefined) { - $ERROR('#1: Array.prototype.splice.prototype === undefined. Actual: ' + (Array.prototype.splice.prototype)); -} diff --git a/test/built-ins/Array/prototype/splice/length.js b/test/built-ins/Array/prototype/splice/length.js new file mode 100644 index 0000000000..c77eb7eca4 --- /dev/null +++ b/test/built-ins/Array/prototype/splice/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.splice +description: > + The "length" property of Array.prototype.splice +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.splice.length, 2); + +verifyNotEnumerable(Array.prototype.splice, 'length'); +verifyNotWritable(Array.prototype.splice, 'length'); +verifyConfigurable(Array.prototype.splice, 'length'); diff --git a/test/built-ins/Array/prototype/splice/prop-desc.js b/test/built-ins/Array/prototype/splice/prop-desc.js new file mode 100644 index 0000000000..ca24692efd --- /dev/null +++ b/test/built-ins/Array/prototype/splice/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.splice +description: > + "splice" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.splice, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "splice"); +verifyWritable(Array.prototype, "splice"); +verifyConfigurable(Array.prototype, "splice"); diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.1.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.1.js deleted file mode 100644 index 7683cce5f9..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of toLocaleString has the attribute DontEnum -es5id: 15.4.4.3_A4.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.toLocaleString.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.toLocaleString.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.toLocaleString){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.toLocaleString) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js deleted file mode 100644 index 2bee11f309..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.2.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - The length property of toLocaleString does not have the attribute - DontDelete -es5id: 15.4.4.3_A4.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.toLocaleString.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.toLocaleString.hasOwnProperty('length'))); -} - -delete Array.prototype.toLocaleString.length; - -//CHECK#2 -if (Array.prototype.toLocaleString.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.toLocaleString.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.toLocaleString.length === undefined) { - $ERROR('#3: delete Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js deleted file mode 100644 index e96f635af4..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of toLocaleString has the attribute ReadOnly -es5id: 15.4.4.3_A4.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.toLocaleString.length; -verifyNotWritable(Array.prototype.toLocaleString, "length", null, Infinity); -if (Array.prototype.toLocaleString.length !== x) { - $ERROR('#1: x = Array.prototype.toLocaleString.length; Array.prototype.toLocaleString.length = Infinity; Array.prototype.toLocaleString.length === x. Actual: ' + (Array.prototype.toLocaleString.length)); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.4.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.4.js deleted file mode 100644 index 18d41ff8fb..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of toLocaleString is 0 -es5id: 15.4.4.3_A4.4 -description: toLocaleString.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.length !== 0) { - $ERROR('#1: Array.prototype.toLocaleString.length === 0. Actual: ' + (Array.prototype.toLocaleString.length)); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.js deleted file mode 100644 index 83a66f8d32..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The toLocaleString property of Array has the attribute DontEnum -es5id: 15.4.4.3_A4.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('toLocaleString') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'toLocaleString\') === false. Actual: ' + (Array.propertyIsEnumerable('toLocaleString'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "toLocaleString") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "toLocaleString") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.js b/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.js deleted file mode 100644 index 7e53a3bee6..0000000000 --- a/test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The toLocaleString property of Array has not prototype property -es5id: 15.4.4.3_A4.6 -description: Checking Array.prototype.toLocaleString.prototype ----*/ - -//CHECK#1 -if (Array.prototype.toLocaleString.prototype !== undefined) { - $ERROR('#1: Array.prototype.toLocaleString.prototype === undefined. Actual: ' + (Array.prototype.toLocaleString.prototype)); -} diff --git a/test/built-ins/Array/prototype/toLocaleString/length.js b/test/built-ins/Array/prototype/toLocaleString/length.js new file mode 100644 index 0000000000..c96a608209 --- /dev/null +++ b/test/built-ins/Array/prototype/toLocaleString/length.js @@ -0,0 +1,28 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tolocalestring +description: > + The "length" property of Array.prototype.toLocaleString +info: | + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.toLocaleString.length, 0); + +verifyNotEnumerable(Array.prototype.toLocaleString, 'length'); +verifyNotWritable(Array.prototype.toLocaleString, 'length'); +verifyConfigurable(Array.prototype.toLocaleString, 'length'); diff --git a/test/built-ins/Array/prototype/toLocaleString/prop-desc.js b/test/built-ins/Array/prototype/toLocaleString/prop-desc.js new file mode 100644 index 0000000000..3f33ffda0a --- /dev/null +++ b/test/built-ins/Array/prototype/toLocaleString/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tolocalestring +description: > + "toLocaleString" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.toLocaleString, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "toLocaleString"); +verifyWritable(Array.prototype, "toLocaleString"); +verifyConfigurable(Array.prototype, "toLocaleString"); diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.js deleted file mode 100644 index 678e213f67..0000000000 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The toString property of Array has the attribute DontEnum -es5id: 15.4.4.2_A4.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('toString') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'toString\') === false. Actual: ' + (Array.propertyIsEnumerable('toString'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "toString") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "toString") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.js b/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.js deleted file mode 100644 index 8a97c2ca75..0000000000 --- a/test/built-ins/Array/prototype/toString/S15.4.4.2_A4.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The toString property of Array has not prototype property -es5id: 15.4.4.2_A4.6 -description: Checking Array.prototype.toString.prototype ----*/ - -//CHECK#1 -if (Array.prototype.toString.prototype !== undefined) { - $ERROR('#1: Array.prototype.toString.prototype === undefined. Actual: ' + (Array.prototype.toString.prototype)); -} diff --git a/test/built-ins/Array/prototype/toString/prop-desc.js b/test/built-ins/Array/prototype/toString/prop-desc.js new file mode 100644 index 0000000000..c501356656 --- /dev/null +++ b/test/built-ins/Array/prototype/toString/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.tostring +description: > + "toString" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.toString, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "toString"); +verifyWritable(Array.prototype, "toString"); +verifyConfigurable(Array.prototype, "toString"); diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.1.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.1.js deleted file mode 100644 index c29476b800..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.1.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of unshift has the attribute DontEnum -es5id: 15.4.4.13_A5.1 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.prototype.unshift.propertyIsEnumerable('length') !== false) { - $ERROR('#1: Array.prototype.unshift.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.unshift.propertyIsEnumerable('length'))); -} - -//CHECK#2 -var result = true; -for (var p in Array.prototype.unshift){ - if (p === "length") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array.prototype.unshift) { if (p === "length") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js deleted file mode 100644 index 4d0dc18075..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of unshift does not have the attribute DontDelete -es5id: 15.4.4.13_A5.2 -description: Checking use hasOwnProperty, delete ----*/ - -//CHECK#1 -if (Array.prototype.unshift.hasOwnProperty('length') !== true) { - $ERROR('#1: Array.prototype.unshift.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.unshift.hasOwnProperty('length'))); -} - -delete Array.prototype.unshift.length; - -//CHECK#2 -if (Array.prototype.unshift.hasOwnProperty('length') !== false) { - $ERROR('#2: delete Array.prototype.unshift.length; Array.prototype.unshift.hasOwnProperty(\'length\') === false. Actual: ' + (Array.prototype.unshift.hasOwnProperty('length'))); -} - -//CHECK#3 -if (Array.prototype.unshift.length === undefined) { - $ERROR('#3: delete Array.prototype.unshift.length; Array.prototype.unshift.length !== undefined'); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js deleted file mode 100644 index cc94d11e9e..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.3.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of unshift has the attribute ReadOnly -es5id: 15.4.4.13_A5.3 -description: Checking if varying the length property fails -includes: [propertyHelper.js] ----*/ - -//CHECK#1 -var x = Array.prototype.unshift.length; -verifyNotWritable(Array.prototype.unshift, "length", null, Infinity); -if (Array.prototype.unshift.length !== x) { - $ERROR('#1: x = Array.prototype.unshift.length; Array.prototype.unshift.length = Infinity; Array.prototype.unshift.length === x. Actual: ' + (Array.prototype.unshift.length)); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.4.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.4.js deleted file mode 100644 index 6fd20772b7..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.4.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The length property of unshift is 1 -es5id: 15.4.4.13_A5.4 -description: unshift.length === 1 ----*/ - -//CHECK#1 -if (Array.prototype.unshift.length !== 1) { - $ERROR('#1: Array.prototype.unshift.length === 1. Actual: ' + (Array.prototype.unshift.length)); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.js deleted file mode 100644 index f1897540a5..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.5.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The unshift property of Array has the attribute DontEnum -es5id: 15.4.4.13_A5.5 -description: Checking use propertyIsEnumerable, for-in ----*/ - -//CHECK#1 -if (Array.propertyIsEnumerable('unshift') !== false) { - $ERROR('#1: Array.propertyIsEnumerable(\'unshift\') === false. Actual: ' + (Array.propertyIsEnumerable('unshift'))); -} - -//CHECK#2 -var result = true; -for (var p in Array){ - if (p === "unshift") { - result = false; - } -} - -if (result !== true) { - $ERROR('#2: result = true; for (p in Array) { if (p === "unshift") result = false; } result === true;'); -} diff --git a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.js b/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.js deleted file mode 100644 index 086b283df1..0000000000 --- a/test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.6.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The unshift property of Array has not prototype property -es5id: 15.4.4.13_A5.6 -description: Checking Array.prototype.unshift.prototype ----*/ - -//CHECK#1 -if (Array.prototype.unshift.prototype !== undefined) { - $ERROR('#1: Array.prototype.unshift.prototype === undefined. Actual: ' + (Array.prototype.unshift.prototype)); -} diff --git a/test/built-ins/Array/prototype/unshift/length.js b/test/built-ins/Array/prototype/unshift/length.js new file mode 100644 index 0000000000..05305348ec --- /dev/null +++ b/test/built-ins/Array/prototype/unshift/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.unshift +description: > + The "length" property of Array.prototype.unshift +info: | + 22.1.3.29 Array.prototype.unshift ( ...items ) + + The length property of the unshift method is 1. + + 17 ECMAScript Standard Built-in Objects + + Every built-in function object, including constructors, has a length property + whose value is an integer. Unless otherwise specified, this value is equal to + the largest number of named arguments shown in the subclause headings for the + function description. Optional parameters (which are indicated with brackets: + [ ]) or rest parameters (which are shown using the form «...name») are not + included in the default argument count. + + Unless otherwise specified, the length property of a built-in function object + has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(Array.prototype.unshift.length, 1); + +verifyNotEnumerable(Array.prototype.unshift, 'length'); +verifyNotWritable(Array.prototype.unshift, 'length'); +verifyConfigurable(Array.prototype.unshift, 'length'); diff --git a/test/built-ins/Array/prototype/unshift/prop-desc.js b/test/built-ins/Array/prototype/unshift/prop-desc.js new file mode 100644 index 0000000000..3d6728eed6 --- /dev/null +++ b/test/built-ins/Array/prototype/unshift/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (C) 2017 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.unshift +description: > + "unshift" property of Array.prototype +info: | + 17 ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof Array.prototype.unshift, 'function', 'typeof'); + +verifyNotEnumerable(Array.prototype, "unshift"); +verifyWritable(Array.prototype, "unshift"); +verifyConfigurable(Array.prototype, "unshift"); -- GitLab