From 6900bf538b377237efe15f19d0dfefb7ae76d588 Mon Sep 17 00:00:00 2001 From: David Fugate <dfugate@microsoft.com> Date: Fri, 8 Apr 2011 09:24:19 -0700 Subject: [PATCH] test/suite/ietestcenter is now sync'ed to IE PPB10. --- .../suite/ietestcenter/chapter07/7.3/7.3-1.js | 37 ++++++++++ .../ietestcenter/chapter07/7.3/7.3-10.js | 41 +++++++++++ .../ietestcenter/chapter07/7.3/7.3-11.js | 40 +++++++++++ .../ietestcenter/chapter07/7.3/7.3-12.js | 40 +++++++++++ .../ietestcenter/chapter07/7.3/7.3-13.js | 40 +++++++++++ .../ietestcenter/chapter07/7.3/7.3-14.js | 40 +++++++++++ .../ietestcenter/chapter07/7.3/7.3-15.js | 37 ++++++++++ .../suite/ietestcenter/chapter07/7.3/7.3-2.js | 37 ++++++++++ .../suite/ietestcenter/chapter07/7.3/7.3-3.js | 41 +++++++++++ .../suite/ietestcenter/chapter07/7.3/7.3-4.js | 41 +++++++++++ .../suite/ietestcenter/chapter07/7.3/7.3-7.js | 42 +++++++++++ .../suite/ietestcenter/chapter07/7.3/7.3-8.js | 42 +++++++++++ .../suite/ietestcenter/chapter07/7.3/7.3-9.js | 41 +++++++++++ .../chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js | 44 ++++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js | 44 ++++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js | 39 ++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js | 39 ++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js | 39 ++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js | 39 ++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js | 39 ++++++++++ .../7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js | 39 ++++++++++ .../chapter07/7.8/7.8.3/7.8.3-1-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.3/7.8.3-2-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.3/7.8.3-3-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.3/7.8.3-4-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.3/7.8.3-5-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.3/7.8.3-6-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.3/7.8.3-7-s.js | 42 +++++++++++ .../chapter07/7.8/7.8.4/7.8.4-1-s.js | 48 +++++++++++++ .../chapter08/8.7/8.7.2/8.7.2-1-s.js | 42 +++++++++++ .../chapter08/8.7/8.7.2/8.7.2-2-s.js | 38 ++++++++++ .../chapter08/8.7/8.7.2/8.7.2-3-1-s.js | 37 ++++++++++ .../chapter08/8.7/8.7.2/8.7.2-3-s.js | 47 ++++++++++++ .../chapter08/8.7/8.7.2/8.7.2-4-s.js | 48 +++++++++++++ .../chapter08/8.7/8.7.2/8.7.2-5-s.js | 45 ++++++++++++ .../chapter08/8.7/8.7.2/8.7.2-6-s.js | 44 ++++++++++++ .../chapter08/8.7/8.7.2/8.7.2-7-s.js | 45 ++++++++++++ .../chapter08/8.7/8.7.2/8.7.2-8-s.js | 41 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-1-s.js | 38 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-10-s.js | 38 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-11-s.js | 43 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-12-s.js | 37 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-13-s.js | 37 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-14-s.js | 42 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-15-s.js | 46 ++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-16-s.js | 44 ++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-17-s.js | 50 +++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-18-s.js | 51 +++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-19-s.js | 45 ++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-2-s.js | 43 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-20-s.js | 41 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-21-s.js | 41 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-22-s.js | 44 ++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-23-s.js | 40 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-24-s.js | 40 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-25-s.js | 49 +++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-26-s.js | 52 ++++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-27-s.js | 44 ++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-28-s.js | 48 +++++++++++++ .../chapter10/10.1/10.1.1/10.1.1-29-s.js | 39 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-3-s.js | 39 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-30-s.js | 42 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-31-s.js | 38 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-32-s.js | 38 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-4-s.js | 38 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-5-s.js | 43 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-6-s.js | 39 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-7-s.js | 38 ++++++++++ .../chapter10/10.1/10.1.1/10.1.1-8-s.js | 43 +++++++++++ .../chapter10/10.1/10.1.1/10.1.1-9-s.js | 38 ++++++++++ .../10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js | 44 ++++++++++++ .../10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js | 43 +++++++++++ .../10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js | 45 ++++++++++++ .../10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js | 44 ++++++++++++ .../10.4/10.4.2/10.4.2-2-c-1.js.orig | 31 ++++++++ .../chapter10/10.4/10.4.2/10.4.2-2-s.js | 38 ++++++++++ .../chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js | 43 +++++++++++ .../chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js | 45 ++++++++++++ .../chapter10/10.4/10.4.2/10.4.2.1-2-s.js | 40 +++++++++++ .../chapter10/10.4/10.4.2/10.4.2.1-4-s.js | 39 ++++++++++ .../chapter10/10.4/10.4.3/10.4.3-1-1-s.js | 52 ++++++++++++++ .../chapter10/10.4/10.4.3/10.4.3-1-2-s.js | 52 ++++++++++++++ .../chapter10/10.4/10.4.3/10.4.3-1-3-s.js | 50 +++++++++++++ .../chapter10/10.4/10.4.3/10.4.3-1-4-s.js | 52 ++++++++++++++ .../chapter10/10.4/10.4.3/10.4.3-1-5-s.js | 55 ++++++++++++++ .../ietestcenter/chapter10/10.5/10.5-1-s.js | 45 ++++++++++++ .../chapter10/10.5/10.5-7-b-1-s.js | 44 ++++++++++++ .../chapter10/10.5/10.5-7-b-2-s.js | 44 ++++++++++++ .../chapter10/10.5/10.5-7-b-3-s.js | 44 ++++++++++++ .../chapter10/10.5/10.5-7-b-4-s.js | 45 ++++++++++++ .../chapter10/10.6/10.6-10-c-ii-1-s.js | 47 ++++++++++++ .../chapter10/10.6/10.6-10-c-ii-2-s.js | 48 +++++++++++++ .../chapter10/10.6/10.6-13-b-1-s.js | 47 ++++++++++++ .../chapter10/10.6/10.6-13-b-2-s.js | 42 +++++++++++ .../chapter10/10.6/10.6-13-b-3-s.js | 49 +++++++++++++ .../chapter10/10.6/10.6-13-c-1-s.js | 47 ++++++++++++ .../chapter10/10.6/10.6-13-c-2-s.js | 42 +++++++++++ .../chapter10/10.6/10.6-13-c-3-s.js | 47 ++++++++++++ .../chapter10/10.6/10.6-14-1-s.js | 41 +++++++++++ .../chapter10/10.6/10.6-14-b-1-s.js | 49 +++++++++++++ .../chapter10/10.6/10.6-14-b-4-s.js | 48 +++++++++++++ .../chapter10/10.6/10.6-14-c-1-s.js | 49 +++++++++++++ .../chapter10/10.6/10.6-14-c-4-s.js | 48 +++++++++++++ .../chapter11/11.1/11.1.5/11.1.5-1-s.js | 44 ++++++++++++ .../chapter11/11.1/11.1.5/11.1.5-2-s.js | 44 ++++++++++++ .../chapter11/11.1/11.1.5/11.1.5-3-s.js | 43 +++++++++++ .../chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js | 58 +++++++++++++++ .../chapter11/11.1/11.1.5/11.1.5-4-s.js | 43 +++++++++++ .../chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js | 52 ++++++++++++++ .../chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js | 51 +++++++++++++ .../chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js | 53 ++++++++++++++ .../chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js | 52 ++++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-1-6-s.js | 50 +++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-1-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-2-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-3-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-4-14-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-4-27-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-4-28-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-4-29-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-4-3-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.1/11.13.1-4-6-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-1-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-10-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-11-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-12-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-13-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-14-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-15-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-16-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-17-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-18-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-19-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-2-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-20-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-21-s.js | 40 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-22-s.js | 41 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-23-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-24-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-25-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-26-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-27-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-28-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-29-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-3-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-30-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-31-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-32-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-33-s.js | 51 +++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-34-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-35-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-36-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-37-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-38-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-39-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-4-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-40-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-41-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-42-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-43-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-44-s.js | 53 ++++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-45-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-46-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-47-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-48-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-49-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-5-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-50-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-51-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-52-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-53-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-54-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-55-s.js | 46 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-1-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-10-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-11-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-12-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-13-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-14-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-15-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-16-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-17-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-18-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-19-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-2-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-20-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-21-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-22-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-3-s.js | 45 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-4-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-5-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-6-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-7-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-8-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-9-s.js | 44 ++++++++++++ .../chapter11/11.13/11.13.2/11.13.2-6-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-7-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-8-s.js | 43 +++++++++++ .../chapter11/11.13/11.13.2/11.13.2-9-s.js | 43 +++++++++++ .../chapter11/11.3/11.3.1/11.3.1-2-1-s.js | 44 ++++++++++++ .../chapter11/11.3/11.3.1/11.3.1-2-2-s.js | 44 ++++++++++++ .../chapter11/11.3/11.3.2/11.3.2-2-1-s.js | 44 ++++++++++++ .../chapter11/11.3/11.3.2/11.3.2-2-2-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js | 49 +++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js | 51 +++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js | 47 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js | 56 +++++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js | 53 ++++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js | 52 ++++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js | 48 +++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js | 47 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js | 45 ++++++++++++ .../chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js | 56 +++++++++++++++ .../chapter11/11.4/11.4.4/11.4.4-2-1-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.4/11.4.4-2-2-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.5/11.4.5-2-1-s.js | 44 ++++++++++++ .../chapter11/11.4/11.4.5/11.4.5-2-2-s.js | 44 ++++++++++++ .../ietestcenter/chapter12/12.1/12.1-1.js | 41 +++++++++++ .../ietestcenter/chapter12/12.1/12.1-2.js | 41 +++++++++++ .../ietestcenter/chapter12/12.1/12.1-3.js | 41 +++++++++++ .../ietestcenter/chapter12/12.1/12.1-4.js | 41 +++++++++++ .../ietestcenter/chapter12/12.1/12.1-5.js | 41 +++++++++++ .../ietestcenter/chapter12/12.1/12.1-6.js | 41 +++++++++++ .../ietestcenter/chapter12/12.1/12.1-7.js | 41 +++++++++++ .../chapter12/12.10/12.10.1/12.10.1-1-s.js | 54 ++++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-10-s.js | 53 ++++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-11-s.js | 44 ++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-12-s.js | 49 +++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-13-s.js | 40 +++++++++++ .../chapter12/12.10/12.10.1/12.10.1-14-s.js | 45 ++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-15-s.js | 44 ++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-16-s.js | 44 ++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-2-s.js | 55 ++++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-3-s.js | 55 ++++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-4-s.js | 50 +++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-5-s.js | 42 +++++++++++ .../chapter12/12.10/12.10.1/12.10.1-7-s.js | 51 +++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-8-s.js | 51 +++++++++++++ .../chapter12/12.10/12.10.1/12.10.1-9-s.js | 51 +++++++++++++ .../chapter12/12.14/12.14.1/12.14.1-1-s.js | 46 ++++++++++++ .../chapter12/12.14/12.14.1/12.14.1-2-s.js | 46 ++++++++++++ .../chapter12/12.14/12.14.1/12.14.1-3-s.js | 54 ++++++++++++++ .../chapter12/12.14/12.14.1/12.14.1-4-s.js | 44 ++++++++++++ .../chapter12/12.14/12.14.1/12.14.1-5-s.js | 44 ++++++++++++ .../chapter12/12.14/12.14.1/12.14.1-6-s.js | 44 ++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-1-s.js | 48 +++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-10-s.js | 41 +++++++++++ .../chapter12/12.2/12.2.1/12.2.1-12-s.js | 46 ++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-13-s.js | 56 +++++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-2-s.js | 48 +++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-3-s.js | 48 +++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-4-s.js | 48 +++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-5-s.js | 40 +++++++++++ .../chapter12/12.2/12.2.1/12.2.1-6-s.js | 42 +++++++++++ .../chapter12/12.2/12.2.1/12.2.1-7-s.js | 48 +++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-8-s.js | 48 +++++++++++++ .../chapter12/12.2/12.2.1/12.2.1-9-s.js | 41 +++++++++++ .../ietestcenter/chapter13/13.0/13.0-1.js | 41 +++++++++++ .../ietestcenter/chapter13/13.0/13.0-10-s.js | 55 ++++++++++++++ .../ietestcenter/chapter13/13.0/13.0-11-s.js | 55 ++++++++++++++ .../ietestcenter/chapter13/13.0/13.0-12-s.js | 47 ++++++++++++ .../ietestcenter/chapter13/13.0/13.0-13-s.js | 48 +++++++++++++ .../ietestcenter/chapter13/13.0/13.0-14-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.0/13.0-15-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.0/13.0-16-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.0/13.0-17-s.js | 44 ++++++++++++ .../ietestcenter/chapter13/13.0/13.0-2.js | 41 +++++++++++ .../ietestcenter/chapter13/13.0/13.0-3.js | 42 +++++++++++ .../ietestcenter/chapter13/13.0/13.0-4.js | 43 +++++++++++ .../ietestcenter/chapter13/13.0/13.0-7-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.0/13.0-8-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.0/13.0-9-s.js | 53 ++++++++++++++ .../ietestcenter/chapter13/13.1/13.1-1-1.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-1-2.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-1-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-10-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-11-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-12-s.js | 45 ++++++++++++ .../ietestcenter/chapter13/13.1/13.1-13-s.js | 44 ++++++++++++ .../ietestcenter/chapter13/13.1/13.1-14-s.js | 45 ++++++++++++ .../ietestcenter/chapter13/13.1/13.1-15-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-16-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-17-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-18-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-19-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-2-1.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-2-2.js | 34 +++++++++ .../ietestcenter/chapter13/13.1/13.1-2-5.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-2-6.js | 34 +++++++++ .../ietestcenter/chapter13/13.1/13.1-2-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-20-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-21-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-22-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-23-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-24-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-25-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-26-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-27-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-28-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-29-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-3-1.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-3-2.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-3-7.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-3-8.js | 38 ++++++++++ .../ietestcenter/chapter13/13.1/13.1-3-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-30-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-31-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-32-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-33-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-34-s.js | 49 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-35-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-36-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-37-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-38-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-39-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-4-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-40-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-41-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-42-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.1/13.1-5-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-6-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-7-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-8-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.1/13.1-9-s.js | 50 +++++++++++++ .../ietestcenter/chapter13/13.2/13.2-1-s.js | 42 +++++++++++ .../ietestcenter/chapter13/13.2/13.2-2-s.js | 43 +++++++++++ .../ietestcenter/chapter13/13.2/13.2-3-s.js | 41 +++++++++++ .../ietestcenter/chapter13/13.2/13.2-4-s.js | 43 +++++++++++ .../ietestcenter/chapter14/14.1/14.1-1-s.js | 46 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-10-s.js | 47 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-11-s.js | 49 +++++++++++++ .../ietestcenter/chapter14/14.1/14.1-12-s.js | 47 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-13-s.js | 46 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-14-s.js | 47 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-15-s.js | 52 ++++++++++++++ .../ietestcenter/chapter14/14.1/14.1-16-s.js | 45 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-17-s.js | 46 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-2-s.js | 46 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-3-s.js | 45 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-4-s.js | 46 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-5-s.js | 45 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-6-s.js | 45 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-7-s.js | 45 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-8-s.js | 47 ++++++++++++ .../ietestcenter/chapter14/14.1/14.1-9-s.js | 47 ++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js | 48 +++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js | 47 ++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js | 48 +++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js | 50 +++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js | 46 ++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js | 48 +++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js | 48 +++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js | 57 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js | 59 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js | 58 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js | 60 ++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js | 52 ++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js | 55 ++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js | 57 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js | 58 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js | 55 ++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js | 57 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js | 58 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js | 56 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js | 58 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js | 60 ++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js | 52 ++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js | 54 ++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js | 56 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js | 61 ++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js | 63 ++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js | 65 +++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js | 61 ++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js | 63 ++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js | 65 +++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js | 4 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js | 59 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js | 71 +++++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js | 57 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js | 59 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js | 57 +++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js | 65 +++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js | 67 +++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js | 65 +++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js | 67 +++++++++++++++++ .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js | 3 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js | 2 +- .../15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js | 2 +- .../15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js | 65 +++++++++++++++++ .../15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js | 65 +++++++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js | 46 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js | 46 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js | 47 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js | 46 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js | 47 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js | 47 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js | 46 ++++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js | 41 +++++++++++ .../15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js | 38 ++++++++++ .../15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js | 42 +++++++++++ .../15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js | 41 +++++++++++ .../15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js | 41 +++++++++++ .../15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js | 40 +++++++++++ .../15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js | 41 +++++++++++ .../15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js | 41 +++++++++++ .../15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js | 47 ++++++++++++ .../15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js | 47 ++++++++++++ .../15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js | 47 ++++++++++++ .../15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js | 47 ++++++++++++ .../15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js | 47 ++++++++++++ .../15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js | 48 +++++++++++++ .../15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js | 46 ++++++++++++ .../15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js | 2 +- .../15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js | 2 +- 457 files changed, 20106 insertions(+), 25 deletions(-) create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-1.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-10.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-11.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-12.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-13.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-14.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-15.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-2.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-3.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-4.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-7.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-8.js create mode 100644 test/suite/ietestcenter/chapter07/7.3/7.3-9.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.js create mode 100644 test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.js create mode 100644 test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.5/10.5-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js create mode 100644 test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js create mode 100644 test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-1.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-2.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-3.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-4.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-5.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-6.js create mode 100644 test/suite/ietestcenter/chapter12/12.1/12.1-7.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.js create mode 100644 test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-1.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-12-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-13-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-2.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-3.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-4.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-8-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.0/13.0-9-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-1-1.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-1-2.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-10-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-11-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-12-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-14-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-2-1.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-2-5.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-28-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-3-1.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-3-2.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-3-7.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-3-8.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-35-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-36-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-37-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-38-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-39-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-40-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-41-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-42-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-5-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-6-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-7-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-8-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.1/13.1-9-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.2/13.2-1-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.2/13.2-2-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.2/13.2-3-s.js create mode 100644 test/suite/ietestcenter/chapter13/13.2/13.2-4-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-1-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-10-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-12-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-13-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-14-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-15-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-16-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-17-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-2-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-3-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-4-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-5-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-6-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-7-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-8-s.js create mode 100644 test/suite/ietestcenter/chapter14/14.1/14.1-9-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js create mode 100644 test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js create mode 100644 test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-1.js b/test/suite/ietestcenter/chapter07/7.3/7.3-1.js new file mode 100644 index 0000000000..07eda84cfd --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-1.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-1", + + path: "TestCases/chapter07/7.3/7.3-1.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as line terminators when parsing statements", + + test: function testcase() { + eval("var test\u2028prop = 66;"); + return prop === 66 && !this.hasOwnProperty("test") && typeof test === "undefined"; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-10.js b/test/suite/ietestcenter/chapter07/7.3/7.3-10.js new file mode 100644 index 0000000000..1d4d8d654c --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-10.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-10", + + path: "TestCases/chapter07/7.3/7.3-10.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as a NonEscapeCharacter", + + test: function testcase() { + try { + eval("var prop = \\u2029;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-11.js b/test/suite/ietestcenter/chapter07/7.3/7.3-11.js new file mode 100644 index 0000000000..c677731042 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-11.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-11", + + path: "TestCases/chapter07/7.3/7.3-11.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <LS> (\\u2028) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u2028 var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-12.js b/test/suite/ietestcenter/chapter07/7.3/7.3-12.js new file mode 100644 index 0000000000..c25b01e966 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-12.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-12", + + path: "TestCases/chapter07/7.3/7.3-12.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <PS> (\\u2029) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u2029 var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-13.js b/test/suite/ietestcenter/chapter07/7.3/7.3-13.js new file mode 100644 index 0000000000..1a854a47e2 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-13.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-13", + + path: "TestCases/chapter07/7.3/7.3-13.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <CR> (\\u000D) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u000D var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-14.js b/test/suite/ietestcenter/chapter07/7.3/7.3-14.js new file mode 100644 index 0000000000..0ad3409802 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-14.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-14", + + path: "TestCases/chapter07/7.3/7.3-14.js", + + description: "7.3 - ES5 specifies that a multiline comment that contains a line terminator character <LF> (\\u000A) must be treated as a single line terminator for the purposes of semicolon insertion", + + test: function testcase() { + /*MultiLine + Comments + \u000A var = ; + */ + return true; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-15.js b/test/suite/ietestcenter/chapter07/7.3/7.3-15.js new file mode 100644 index 0000000000..51b76d3231 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-15.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-15", + + path: "TestCases/chapter07/7.3/7.3-15.js", + + description: "7.3 - ES5 recognize <BOM> (\\uFFFF) as a whitespace character", + + test: function testcase() { + var prop = "a\uFFFFa"; + return prop.length === 3 && prop !== "aa" && prop[1] === "\uFFFF"; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-2.js b/test/suite/ietestcenter/chapter07/7.3/7.3-2.js new file mode 100644 index 0000000000..e91bcddf5b --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-2.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-2", + + path: "TestCases/chapter07/7.3/7.3-2.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as line terminators when parsing statements", + + test: function testcase() { + eval("var test\u2029prop = 66;"); + return prop === 66 && !this.hasOwnProperty("test") && typeof test === "undefined"; + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-3.js b/test/suite/ietestcenter/chapter07/7.3/7.3-3.js new file mode 100644 index 0000000000..a11eafefda --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-3.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-3", + + path: "TestCases/chapter07/7.3/7.3-3.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as terminating SingleLineComments", + + test: function testcase() { + try { + eval("//Single Line Comments\u2028 var =;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-4.js b/test/suite/ietestcenter/chapter07/7.3/7.3-4.js new file mode 100644 index 0000000000..fe20a7ae79 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-4", + + path: "TestCases/chapter07/7.3/7.3-4.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as terminating SingleLineComments", + + test: function testcase() { + try { + eval("//Single Line Comments\u2029 var =;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-7.js b/test/suite/ietestcenter/chapter07/7.3/7.3-7.js new file mode 100644 index 0000000000..bc36e67fa4 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-7.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-7", + + path: "TestCases/chapter07/7.3/7.3-7.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as terminating regular expression literals", + + test: function testcase() { + try { + eval("var regExp = /[\u2028]/"); + regExp.test(""); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-8.js b/test/suite/ietestcenter/chapter07/7.3/7.3-8.js new file mode 100644 index 0000000000..1f47cdfca5 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-8.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-8", + + path: "TestCases/chapter07/7.3/7.3-8.js", + + description: "7.3 - ES5 recognizes the character <PS> (\\u2029) as terminating regular expression literals", + + test: function testcase() { + try { + eval("var regExp = /[\u2029]/"); + regExp.test(""); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.3/7.3-9.js b/test/suite/ietestcenter/chapter07/7.3/7.3-9.js new file mode 100644 index 0000000000..b868894740 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.3/7.3-9.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.3-9", + + path: "TestCases/chapter07/7.3/7.3-9.js", + + description: "7.3 - ES5 recognizes the character <LS> (\\u2028) as a NonEscapeCharacter", + + test: function testcase() { + try { + eval("var prop = \\u2028;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js new file mode 100644 index 0000000000..0e67923fda --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1-17-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1-17-s.js", + + description: "7.6 - SyntaxError expected: reserved words used as Identifier Names in UTF8: \u0069mplements (implements)", + strict:1, + + test: function testcase() { + "use strict"; + + try { + eval("var \u0069mplements = 123;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js new file mode 100644 index 0000000000..5b7891f48b --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-1-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when FutureReservedWord 'implements' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + + try { + eval("var implements = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js new file mode 100644 index 0000000000..9ed998da4a --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-10-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-10-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'IMPLEMENTS' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var IMPLEMENTS = 1; + return IMPLEMENTS === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js new file mode 100644 index 0000000000..669e6cdedd --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-11-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-11-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'Implements' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var Implements = 1; + return Implements === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js new file mode 100644 index 0000000000..98a16691c6 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-12-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-12-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'implement' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var implement = 1; + return implement === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js new file mode 100644 index 0000000000..0e6020ebc2 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-13-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-13-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'implementss' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var implementss = 1; + return implementss === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js new file mode 100644 index 0000000000..ef875f4217 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-14-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-14-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when 'implements0' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var implements0 = 1; + return implements0 === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js new file mode 100644 index 0000000000..c1aedb5e5a --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "7.6.1.2-16-s", + + path: "TestCases/chapter07/7.6/7.6.1/7.6.1.2/7.6.1.2-16-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when '_implements' occurs in strict mode code", + strict:1, + + test: function testcase() { + "use strict"; + var _implements = 1; + return _implements === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.js new file mode 100644 index 0000000000..f5276e6149 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-1-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-1-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-1-s.js", + + description: "Strict Mode - octal extension (010) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_1 = 010;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_1 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.js new file mode 100644 index 0000000000..7002752703 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-2-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-2-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-2-s.js", + + description: "Strict Mode - octal extension (00) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_2 = 00;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_2 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.js new file mode 100644 index 0000000000..6d8743ebcd --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-3-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-3-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-3-s.js", + + description: "Strict Mode - octal extension (01) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_3 = 01;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_3 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.js new file mode 100644 index 0000000000..d45f8776fd --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-4-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-4-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-4-s.js", + + description: "Strict Mode - octal extension (06) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_4 = 06;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_4 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.js new file mode 100644 index 0000000000..5ad7f6c682 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-5-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-5-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-5-s.js", + + description: "Strict Mode - octal extension (07) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_5 = 07;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_5 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.js new file mode 100644 index 0000000000..18192da415 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-6-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-6-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-6-s.js", + + description: "Strict Mode - octal extension (000) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_6 = 000;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_6 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.js new file mode 100644 index 0000000000..1b02225e98 --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.3/7.8.3-7-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "7.8.3-7-s", + + path: "TestCases/chapter07/7.8/7.8.3/7.8.3-7-s.js", + + description: "Strict Mode - octal extension (005) is forbidden in strict mode", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var _7_8_3_7 = 005;"); + return false; + } catch (e) { + return e instanceof SyntaxError && typeof _7_8_3_7 === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.js b/test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.js new file mode 100644 index 0000000000..d41df644cc --- /dev/null +++ b/test/suite/ietestcenter/chapter07/7.8/7.8.4/7.8.4-1-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "7.8.4-1-s", + +path: "TestCases/chapter07/7.8/7.8.4/7.8.4-1-s.js", + +description: "A directive preceeding an 'use strict' directive may not contain an OctalEscapeSequence", + +test: function testcase() +{ + try + { + eval(' "asterisk: \\052" /* octal escape sequences forbidden in strict mode*/ ; "use strict";'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.js new file mode 100644 index 0000000000..76a7f9b8de --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-1-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-1-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-1-s.js", + + description: "Strict Mode - ReferenceError is thrown if LeftHandSide evaluates to an unresolvable Reference", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("_8_7_2_1 = 11;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.js new file mode 100644 index 0000000000..9c49400cdb --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-2-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-2-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-2-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if LeftHandSide evaluates to a resolvable Reference", + strict:1, + + test: function testcase() { + "use strict"; + var b = 11; + return b === 11; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js new file mode 100644 index 0000000000..6f17bf8cde --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-1-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "8.7.2-3-1-s", + +path: "TestCases/chapter08/8.7/8.7.2/8.7.2-3-1-s.js", + +description: "eval - a property named 'eval' is permitted", + +test: function testcase() { + 'use strict'; + + var o = { eval: 42}; + return true; + }, + +strict:1, +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.js new file mode 100644 index 0000000000..7219032f10 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-3-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-3-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-3-s.js", + + description: "Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-writable data property", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_3 = {}; + Object.defineProperty(_8_7_2_3, "b", { + writable: false + }); + + try { + _8_7_2_3.b = 11; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.js new file mode 100644 index 0000000000..9ed6f00802 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-4-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-4-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-4-s.js", + + description: "Strict Mode - TypeError is thrown if LeftHandSide is a reference to an accessor property with no setter", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_4 = {}; + var _8_7_2_4_bValue = 1; + Object.defineProperty(_8_7_2_4, "b", { + get: function () { return _8_7_2_4_bValue; } + }); + + try { + _8_7_2_4.b = 11; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.js new file mode 100644 index 0000000000..090e04ec91 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-5-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-5-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-5-s.js", + + description: "Strict Mode - TypeError is thrown if LeftHandSide is a reference to a non-existent property of an non-extensible object", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_5 = {}; + Object.preventExtensions(_8_7_2_5); + + try { + _8_7_2_5.b = 11; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.preventExtensions) && fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js new file mode 100644 index 0000000000..e84f321b93 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-6-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-6-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-6-s.js", + + description: "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a writable data property", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_6 = {}; + Object.defineProperty(_8_7_2_6, "b", { + writable: true + }); + + _8_7_2_6.b = 11; + + return _8_7_2_6.b === 11; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.js new file mode 100644 index 0000000000..943121f22e --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-7-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-7-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-7-s.js", + + description: "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to an accessor property with setter", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_7 = {}; + var _8_7_2_7_bValue = 1; + Object.defineProperty(_8_7_2_7, "b", { + get: function () { return _8_7_2_7_bValue; }, + set: function (value) { _8_7_2_7_bValue = value; } + }); + + _8_7_2_7.b = 11; + return _8_7_2_7.b === 11; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.js b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.js new file mode 100644 index 0000000000..1e464128f7 --- /dev/null +++ b/test/suite/ietestcenter/chapter08/8.7/8.7.2/8.7.2-8-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "8.7.2-8-s", + + path: "TestCases/chapter08/8.7/8.7.2/8.7.2-8-s.js", + + description: "Strict Mode - TypeError isn't thrown if LeftHandSide is a reference to a property of an extensible object", + strict:1, + + test: function testcase() { + "use strict"; + var _8_7_2_8 = {}; + + _8_7_2_8.b = 11; + + return _8_7_2_8.b === 11; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.js new file mode 100644 index 0000000000..e51df5a6ed --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-1-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-1-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-1-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is 'use strict'; which contains two space between 'use' and 'strict'", + strict:1, + + test: function testcase() { + "use strict"; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.js new file mode 100644 index 0000000000..5698d5d30c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-10-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-10-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-10-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''USE STRICT';' in which all characters are uppercase", + strict:1, + + test: function testcase() { + "USE STRICT"; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.js new file mode 100644 index 0000000000..eed8c3bdb3 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-11-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-11-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-11-s.js", + + description: "Strict Mode - Eval code is strict code with a Use Strict Directive at the beginning of the block", + strict:1, + + test: function testcase() { + try { + eval("'use strict'; var public = 1; var anotherVariableNotReserveWord = 2;"); + + return false; + } catch (e) { + return e instanceof SyntaxError && typeof public === "undefined" && + typeof anotherVariableNotReserveWord === "undefined"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js new file mode 100644 index 0000000000..6de26593ea --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-12-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-12-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-12-s.js", + + description: "Strict Mode - Eval code is strict eval code with a Use Strict Directive in the middle of the block", + strict:1, + + test: function testcase() { + eval("var public = 1; 'use strict'; var anotherVariableNotReserveWord = 2;"); + return public === 1 && anotherVariableNotReserveWord === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js new file mode 100644 index 0000000000..50f4687220 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-13-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-13-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-13-s.js", + + description: "Strict Mode - Eval code is strict eval code with a Use Strict Directive at the end of the block", + strict:1, + + test: function testcase() { + eval("var public = 1; var anotherVariableNotReserveWord = 2; 'use strict';"); + return public === 1 && anotherVariableNotReserveWord === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.js new file mode 100644 index 0000000000..525ab2d45b --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-14-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-14-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-14-s.js", + + description: "Strict Mode - The call to eval function is contained in a Strict Mode block", + strict:1, + + test: function testcase() { + 'use strict'; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return true; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.js new file mode 100644 index 0000000000..2fe7a04fe7 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-15-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-15-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-15-s.js", + + description: "Strict Mode - Function code that is part of a FunctionDeclaration is strict function code if FunctionDeclaration is contained in use strict", + strict:1, + + test: function testcase() { + "use strict"; + function fun() { + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } + + return fun(); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js new file mode 100644 index 0000000000..63431b397a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-16-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-16-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-16-s.js", + + description: "Strict Mode - Function code that is part of a FunctionExpression is strict function code if FunctionExpression is contained in use strict", + strict:1, + + test: function testcase() { + "use strict"; + return function () { + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } (); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.js new file mode 100644 index 0000000000..2c6249c8da --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-17-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-17-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-17-s.js", + + description: "Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(getter)", + strict:1, + + test: function testcase() { + "use strict"; + try { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + get: function () { + eval("public = 1;"); + return 11; + } + }); + + var temp = obj.accProperty === 11; + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js new file mode 100644 index 0000000000..11e6cdf4c6 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-18-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-18-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-18-s.js", + + description: "Strict Mode - Function code that is part of a Accessor PropertyAssignment is in Strict Mode if Accessor PropertyAssignment is contained in use strict(setter)", + strict:1, + + test: function testcase() { + "use strict"; + try { + var obj = {}; + var data = "data"; + Object.defineProperty(obj, "accProperty", { + set: function (value) { + eval("var public = 1;"); + data = value; + } + }); + + obj.accProperty = "overrideData"; + return false; + } catch (e) { + return e instanceof SyntaxError && data === "data"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.js new file mode 100644 index 0000000000..4fcba21502 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-19-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-19-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-19-s.js", + + description: "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the start of the block", + strict:1, + + test: function testcase() { + function fun() { + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } + return fun(); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.js new file mode 100644 index 0000000000..bfa176c6d7 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-2-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-2-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-2-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict'' which lost the last character ';'", + strict:1, + + test: function testcase() { + "use strict" + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.js new file mode 100644 index 0000000000..4827a49a41 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-20-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-20-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-20-s.js", + + description: "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears in the middle of the block", + strict:1, + + test: function testcase() { + function fun() { + eval("var public = 1;"); + "use strict"; + return public === 1; + } + return fun(); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.js new file mode 100644 index 0000000000..58e56005fb --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-21-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-21-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-21-s.js", + + description: "Strict Mode - Function code of a FunctionDeclaration contains Use Strict Directive which appears at the end of the block", + strict:1, + + test: function testcase() { + function fun() { + eval("var public = 1;"); + return public === 1; + "use strict"; + } + return fun(); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js new file mode 100644 index 0000000000..72045fa8eb --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-22-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-22-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-22-s.js", + + description: "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the start of the block", + strict:1, + + test: function testcase() { + return function () { + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + } (); + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.js new file mode 100644 index 0000000000..4437c54618 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-23-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-23-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-23-s.js", + + description: "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears in the middle of the block", + strict:1, + + test: function testcase() { + return function () { + eval("var public = 1;"); + return public === 1; + "use strict"; + } (); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.js new file mode 100644 index 0000000000..d1cdda5e1a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-24-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-24-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-24-s.js", + + description: "Strict Mode - Function code of a FunctionExpression contains Use Strict Directive which appears at the end of the block", + strict:1, + + test: function testcase() { + return function () { + eval("var public = 1;"); + "use strict"; + return public === 1; + } (); + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js new file mode 100644 index 0000000000..991c1adf19 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-25-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-25-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-25-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(getter)", + strict:1, + + test: function testcase() { + try { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + get: function () { + "use strict"; + eval("var public = 1;"); + return 11; + } + }); + var temp = obj.accProperty === 11; + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.js new file mode 100644 index 0000000000..66d3d981f4 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-26-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-26-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-26-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the start of the block(setter)", + strict:1, + + test: function testcase() { + try { + var obj = {}; + var data = "data"; + Object.defineProperty(obj, "accProperty", { + set: function (value) { + "use strict"; + eval("var public = 1;"); + data = value; + } + }); + + obj.accProperty = "overrideData"; + + return false; + } catch (e) { + return e instanceof SyntaxError && data === "data"; + } + }, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js new file mode 100644 index 0000000000..71bb36237f --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-27-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-27-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-27-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears in the middle of the block(getter)", + strict:1, + + test: function testcase() { + var obj = {}; + Object.defineProperty(obj, "accProperty", { + get: function () { + eval("public = 1;"); + "use strict"; + return 11; + } + }); + return obj.accProperty === 11 && public === 1; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.js new file mode 100644 index 0000000000..fb253f6e3f --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-28-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-28-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-28-s.js", + + description: "Strict Mode - Function code of Accessor PropertyAssignment contains Use Strict Directive which appears at the end of the block(setter)", + strict:1, + + + test: function testcase() { + var obj = {}; + var data; + + Object.defineProperty(obj, "accProperty", { + set: function (value) { + var _10_1_1_28_s = {a:1, a:2}; + data = value; + "use strict"; + } + }); + obj.accProperty = "overrideData"; + return data==="overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js new file mode 100644 index 0000000000..01b468245c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-29-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-29-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-29-s.js", + + description: "Strict Mode - The built-in Function constructor is contained in use strict code", + strict:1, + + test: function testcase() { + "use strict"; + var funObj = new Function("a", "eval('public = 1;');"); + funObj(); + return true; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js new file mode 100644 index 0000000000..b9cd7941d3 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-3-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-3-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-3-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is '' use strict';' which the first character is space", + strict:1, + + test: function testcase() { + " use strict"; + var public = 1; + + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.js new file mode 100644 index 0000000000..3d9344ea99 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-30-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-30-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-30-s.js", + + description: "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the start of the block", + strict:1, + + test: function testcase() { + try { + var funObj = new Function("a", "'use strict'; eval('public = 1;');"); + funObj(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.js new file mode 100644 index 0000000000..f775d49b34 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-31-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-31-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-31-s.js", + + description: "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears in the middle of the block", + strict:1, + + test: function testcase() { + var funObj = new Function("a", "eval('public = 1;'); 'use strict'; anotherVariable = 2;"); + funObj(); + return public === 1 && anotherVariable === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.js new file mode 100644 index 0000000000..2ba93cf10a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-32-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-32-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-32-s.js", + + description: "Strict Mode - Function code of built-in Function constructor contains Use Strict Directive which appears at the end of the block", + strict:1, + + test: function testcase() { + var funObj = new Function("a", "eval('public = 1;'); anotherVariable = 2; 'use strict';"); + funObj(); + return public === 1 && anotherVariable === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.js new file mode 100644 index 0000000000..45bbb5f4e3 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-4-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-4-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-4-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict ';' which the last character is space", + strict:1, + + test: function testcase() { + "use strict "; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.js new file mode 100644 index 0000000000..067804f3e6 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-5-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-5-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-5-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the beginning of the block", + strict:1, + + test: function testcase() { + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js new file mode 100644 index 0000000000..3b703bf89d --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-6-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-6-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-6-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears in the middle of the block", + strict:1, + + test: function testcase() { + var interface = 2; + "use strict"; + var public = 1; + return public === 1 && interface === 2; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.js new file mode 100644 index 0000000000..6218f26822 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-7-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-7-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-7-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears at the end of the block", + strict:1, + + test: function testcase() { + var public = 1; + return public === 1; + "use strict"; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.js new file mode 100644 index 0000000000..31e523ea13 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-8-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-8-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-8-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''use strict';' which appears twice in the directive prologue", + strict:1, + + test: function testcase() { + "use strict"; + "use strict"; + try { + eval("var public = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.js b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.js new file mode 100644 index 0000000000..2b5dc95dbd --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.1/10.1.1/10.1.1-9-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.1.1-9-s", + + path: "TestCases/chapter10/10.1/10.1.1/10.1.1-9-s.js", + + description: "Strict Mode - Use Strict Directive Prologue is ''Use strict';' in which the first character is uppercase", + strict:1, + + test: function testcase() { + "Use strict"; + var public = 1; + return public === 1; + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js new file mode 100644 index 0000000000..491d075569 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.2.1.1.3-4-16-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-16-s.js", + + description: "Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (NaN)", + strict:1, + + + test: function testcase() { + "use strict"; + + try { + NaN = 12; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js new file mode 100644 index 0000000000..d66c0b9ba0 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.2.1.1.3-4-18-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-18-s.js", + + description: "Strict Mode - TypeError is thrown when changing the value of a Value Property of the Global Object under strict mode (undefined)", + strict:1, + + + test: function testcase() { + "use strict"; + try { + undefined = 12; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js new file mode 100644 index 0000000000..071e9a6791 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.2.1.1.3-4-22-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-22-s.js", + + description: "Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Object)", + strict:1, + + + test: function testcase() { + "use strict"; + var objBak = Object; + + try { + Object = 12; + return true; + } finally { + Object = objBak; + } + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js new file mode 100644 index 0000000000..bf8c9fd368 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.2.1.1.3-4-27-s", + + path: "TestCases/chapter10/10.2/10.2.1/10.2.1.1/10.2.1.1.3/10.2.1.1.3-4-27-s.js", + + description: "Strict Mode - TypeError is not thrown when changing the value of the Constructor Properties of the Global Object under strict mode (Number)", + strict:1, + + test: function testcase() { + "use strict"; + + var numBak = Number; + try { + Number = 12; + return true; + } finally { + Number = numBak; + } + }, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig new file mode 100644 index 0000000000..03cc991045 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-c-1.js.orig @@ -0,0 +1,31 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { + id: "10.4.2-2-c-1", + path: "TestCases/chapter10/10.4/10.4.2/10.4.2-2-c-1.js", + description: "Direct val code in non-strict mode - can instantiate variable in calling context", + test: function testcase() { + � var x = 0; +� function inner() {eval("var x=1");return x===1;} + return inner(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.js new file mode 100644 index 0000000000..fa99ee32e8 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-2-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.4.2-2-s", + + path: "TestCases/chapter10/10.4/10.4.2/10.4.2-2-s.js", + + description: "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval", + + test: function testcase() { + "use strict"; + eval("(function fun(x){ return x })(10)"); + return typeof (fun) === "undefined"; + }, + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js new file mode 100644 index 0000000000..95a330d7d1 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.2-3-c-1-s", + +path: "TestCases/chapter10/10.4/10.4.2/10.4.2-3-c-1-s.js", + +description: "Direct eval code in strict mode - cannot instantiate variable in the variable environment of the calling context", +strict:1, + +test: function testcase() { + var _10_4_2_3_c_1_s = 0; + function _10_4_2_3_c_1_sFunc() { + eval("'use strict';var _10_4_2_3_c_1_s = 1"); + return _10_4_2_3_c_1_s===0; + } + return _10_4_2_3_c_1_sFunc(); + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js new file mode 100644 index 0000000000..811bbb33f1 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.2-3-c-2-s", + +path: "TestCases/chapter10/10.4/10.4.2/10.4.2-3-c-2-s.js", + +description: "Calling code in strict mode - eval cannot instantiate variable in the variable environment of the calling context", + +test: function testcase() { + var _10_4_2_3_c_2_s = 0; + function _10_4_2_3_c_2_sFunc() { + 'use strict'; + eval("var _10_4_2_3_c_2_s = 1"); + return _10_4_2_3_c_2_s===0; + } + return _10_4_2_3_c_2_sFunc(); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.js new file mode 100644 index 0000000000..163267397b --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-2-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.4.2.1-2-s", + + path: "TestCases/chapter10/10.4/10.4.2/10.4.2.1-2-s.js", + + description: "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval", + + test: function testcase() { + "use strict"; + + eval("function _10_4_2_1_2_fun(){}"); + return typeof _10_4_2_1_2_fun === "undefined"; + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js new file mode 100644 index 0000000000..c44ec799b7 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.2/10.4.2.1-4-s.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.4.2.1-4-s", + + path: "TestCases/chapter10/10.4/10.4.2/10.4.2.1-4-s.js", + + description: "Strict Mode - Strict mode eval code cannot instantiate functions in the variable environment of the caller to eval which is contained in strict mode code", + + test: function testcase() { + + eval("'use strict'; function _10_4_2_1_4_fun(){}"); + return typeof _10_4_2_1_4_fun === "undefined"; + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.js new file mode 100644 index 0000000000..c1d641a83a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-1-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.3-1-1-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-1-s.js", + +description: "this is not coerced to an object in strict mode (Number)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + + return foo.call(1) === 'number' && bar.call(1) === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.js new file mode 100644 index 0000000000..50dc43f100 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-2-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.3-1-2-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-2-s.js", + +description: "this is not coerced to an object in strict mode (string)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + + return foo.call('1') === 'string' && bar.call('1') === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.js new file mode 100644 index 0000000000..97f254c6b3 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-3-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.3-1-3-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-3-s.js", + +description: "this is not coerced to an object in strict mode (undefined)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + return foo.call(undefined) === 'undefined' && bar.call() === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.js new file mode 100644 index 0000000000..0c9e3d904c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-4-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.3-1-4-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-4-s.js", + +description: "this is not coerced to an object in strict mode (boolean)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + + return foo.call(true) === 'boolean' && bar.call(true) === 'object'; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js new file mode 100644 index 0000000000..8e7b18dc76 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.4/10.4.3/10.4.3-1-5-s.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.4.3-1-5-s", + +path: "TestCases/chapter10/10.4/10.4.3/10.4.3-1-5-s.js", + +description: "this is not coerced to an object in strict mode (function)", + +test: function testcase() { + + function foo() + { + 'use strict'; + return typeof(this); + } + + function bar() + { + return typeof(this); + } + + function foobar() + { + } + + return foo.call(foobar) === 'function' && bar.call(foobar) === 'function'; + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-1-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-1-s.js new file mode 100644 index 0000000000..60f118009f --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-1-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.5-1-s", + + path: "TestCases/chapter10/10.5/10.5-1-s.js", + + description: "Strict Mode - arguments object is immutable", + strict:1, + + + test: function testcase() { + "use strict"; + try { + (function fun() { + eval("arguments = 10"); + })(30); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js new file mode 100644 index 0000000000..9f9b7dcbc2 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.5-7-b-1-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-1-s.js", + + description: "Strict Mode - arguments object is immutable in eval'ed functions", + + test: function testcase() { + "use strict"; + + try { + eval("(function _10_5_7_b_1_fun() { arguments = 10;} ());"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js new file mode 100644 index 0000000000..f8aa78b189 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.5-7-b-2-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-2-s.js", + + description: "Strict Mode - arguments object index assignment is disallowed", + + test: function testcase() { + "use strict"; + + function _10_5_7_b_2_fun() { + arguments[7] = 12; + return arguments[7] === 12; + }; + + return _10_5_7_b_2_fun(30); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js new file mode 100644 index 0000000000..f874f2a33c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-3-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.5-7-b-3-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-3-s.js", + + description: "Strict Mode - Adding property to the arguments object successful under strict mode ", + + test: function testcase() { + "use strict"; + + function _10_5_7_b_3_fun() { + arguments[1] = 12; + return arguments[0] = 30 && arguments[1] === 12; + }; + + return _10_5_7_b_3_fun(30); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.js b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.js new file mode 100644 index 0000000000..d09685f69a --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.5/10.5-7-b-4-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.5-7-b-4-s", + + path: "TestCases/chapter10/10.5/10.5-7-b-4-s.js", + + description: "Strict Mode - Deleting property of the arguments object successful under strict mode", + + test: function testcase() { + "use strict"; + + function _10_5_7_b_4_fun() { + var _10_5_7_b_4_1 = arguments[0] === 30 && arguments[1] === 12; + delete arguments[1]; + var _10_5_7_b_4_2 = arguments[0] === 30 && typeof arguments[1] === "undefined"; + return _10_5_7_b_4_1 && _10_5_7_b_4_2; + }; + return _10_5_7_b_4_fun(30, 12); + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.js new file mode 100644 index 0000000000..a306ec7cec --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-10-c-ii-1-s", + +path: "TestCases/chapter10/10.6/10.6-10-c-ii-1-s.js", + +description: "arguments[i] remains same after changing actual parameters in strict mode", + +test: function testcase() { + function foo(a,b,c) + { + 'use strict'; + a = 1; b = 'str'; c = 2.1; + return (arguments[0] === 10 && arguments[1] === 'sss' && arguments[2] === 1); + } + return foo(10, 'sss', 1); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.js new file mode 100644 index 0000000000..ce4090815c --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-10-c-ii-2-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-10-c-ii-2-s", + +path: "TestCases/chapter10/10.6/10.6-10-c-ii-2-s.js", + +description: "arguments[i] doesn't map to actual parameters in strict mode", + +test: function testcase() { + + function foo(a,b,c) + { + 'use strict'; + arguments[0] = 1; arguments[1] = 'str'; arguments[2] = 2.1; + return 10 === a && 'sss' === b && 1 === c; + } + return foo(10,'sss',1); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.js new file mode 100644 index 0000000000..15f8d6ce5f --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-13-b-1-s", + +path: "TestCases/chapter10/10.6/10.6-13-b-1-s.js", + +description: "Accessing caller property of Arguments object throws TypeError in strict mode", + +test: function testcase() { + 'use strict'; + try + { + arguments.caller; + } + catch (e) { + if(e instanceof TypeError) + return true; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.js new file mode 100644 index 0000000000..6be2a936b1 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-2-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-13-b-2-s", + +path: "TestCases/chapter10/10.6/10.6-13-b-2-s.js", + +description: "arguments.caller exists in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"caller"); + return desc!== undefined; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js new file mode 100644 index 0000000000..e11948de61 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-b-3-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-13-b-3-s", + +path: "TestCases/chapter10/10.6/10.6-13-b-3-s.js", + +description: "arguments.caller is non-configurable in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"caller"); + + return (desc.configurable === false && + desc.enumerable === false && + desc.hasOwnProperty('value') == false && + desc.hasOwnProperty('writable') == false && + desc.hasOwnProperty('get') == true && + desc.hasOwnProperty('set') == true); + + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.js new file mode 100644 index 0000000000..aad6c7dbbe --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-13-c-1-s", + +path: "TestCases/chapter10/10.6/10.6-13-c-1-s.js", + +description: "Accessing callee property of Arguments object throws TypeError in strict mode", + +test: function testcase() { + 'use strict'; + try + { + arguments.callee; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.js new file mode 100644 index 0000000000..5680283c44 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-2-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-13-c-2-s", + +path: "TestCases/chapter10/10.6/10.6-13-c-2-s.js", + +description: "arguments.callee is exists in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"callee"); + return desc !== undefined; + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.js new file mode 100644 index 0000000000..541e514ec2 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-13-c-3-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "10.6-13-c-3-s", + +path: "TestCases/chapter10/10.6/10.6-13-c-3-s.js", + +description: "arguments.callee is non-configurable in strict mode", + +test: function testcase() { + + 'use strict'; + var desc = Object.getOwnPropertyDescriptor(arguments,"callee"); + return (desc.configurable === false && + desc.enumerable === false && + desc.hasOwnProperty('value') == false && + desc.hasOwnProperty('writable') == false && + desc.hasOwnProperty('get') == true && + desc.hasOwnProperty('set') == true); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.js new file mode 100644 index 0000000000..74ad073bb1 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-1-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.6-14-1-s", + + path: "TestCases/chapter10/10.6/10.6-14-1-s.js", + + description: "Strict Mode - 'callee' exists and 'caller' exists under strict mode", + + test: function testcase() { + "use strict"; + var argObj = function () { + return arguments; + } (); + return argObj.hasOwnProperty("callee") && argObj.hasOwnProperty("caller"); + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js new file mode 100644 index 0000000000..4dc40ff412 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-1-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.6-14-b-1-s", + + path: "TestCases/chapter10/10.6/10.6-14-b-1-s.js", + + description: "Strict Mode - [[Enumerable]] attribute value in 'caller' is false under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + var verifyEnumerable = false; + for (var _10_6_14_b_1 in argObj) { + if (argObj.hasOwnProperty(_10_6_14_b_1) && _10_6_14_b_1 === "caller") { + verifyEnumerable = true; + } + } + return !verifyEnumerable && argObj.hasOwnProperty("caller"); + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.js new file mode 100644 index 0000000000..6754d57a32 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-b-4-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.6-14-b-4-s", + + path: "TestCases/chapter10/10.6/10.6-14-b-4-s.js", + + description: "Strict Mode - TypeError is thrown when accessing the [[Set]] attribute in 'caller' under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + try { + argObj.caller = {}; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js new file mode 100644 index 0000000000..5f1a6609d4 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-1-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.6-14-c-1-s", + + path: "TestCases/chapter10/10.6/10.6-14-c-1-s.js", + + description: "Strict Mode - [[Enumerable]] attribute value in 'callee' is false under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + var verifyEnumerable = false; + for (var _10_6_14_c_1 in argObj) { + if (argObj.hasOwnProperty(_10_6_14_c_1) && _10_6_14_c_1 === "callee") { + verifyEnumerable = true; + } + } + return !verifyEnumerable && argObj.hasOwnProperty("callee"); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.js b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.js new file mode 100644 index 0000000000..6a3cc78424 --- /dev/null +++ b/test/suite/ietestcenter/chapter10/10.6/10.6-14-c-4-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "10.6-14-c-4-s", + + path: "TestCases/chapter10/10.6/10.6-14-c-4-s.js", + + description: "Strict Mode - TypeError is thrown when accessing the [[Set]] attribute in 'callee' under strict mode", + + test: function testcase() { + "use strict"; + + var argObj = function () { + return arguments; + } (); + + try { + argObj.callee = {}; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js new file mode 100644 index 0000000000..248a309aa0 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.1.5-1-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'eval' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {set _11_1_5_1_fun(eval) {}};"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js new file mode 100644 index 0000000000..1b0561988d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.1.5-2-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'arguments' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {set _11_1_5_2_fun(arguments) {} };"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.js new file mode 100644 index 0000000000..4335fd0560 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-3-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.1.5-3-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-3-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'evals' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment if its FunctionBody is strict code", + + test: function testcase() { + + try { + eval("var obj = {set _11_1_5_3_fun(eval) { \"use strict\"; }};"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js new file mode 100644 index 0000000000..530f3cdac8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js @@ -0,0 +1,58 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +/* + Refer 11.1.5; + The production + PropertyNameAndValueList : PropertyNameAndValueList , PropertyAssignment + 4. If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true + a. This production is contained in strict code and IsDataDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true +*/ + +ES5Harness.registerTest( { +id: "11.1.5-4-4-a-1-s", + +path: "TestCases/chapter11/11.1/11.1.5/11.1.5-4-4-a-1-s.js", + +description: "Object literal - SyntaxError for duplicate date property name in strict mode", + +test: function testcase() { + + try + { + eval("'use strict'; ({foo:0,foo:1});"); + return false; + } + catch(e) + { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + + +}); diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.js new file mode 100644 index 0000000000..29d76d9791 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5-4-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.1.5-4-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5-4-s.js", + + description: "Strict Mode - SyntaxError is thrown when 'arguments' occurs as the Identifier in a PropertySetParameterList of a PropertyAssignment if its FunctionBody is strict code", + + test: function testcase() { + + try { + eval("var obj = {set _11_1_5_4_fun(arguments) {\"use strict\";}};"); + return false; + } catch (e) { + return (e instanceof SyntaxError); + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js new file mode 100644 index 0000000000..56eb7c88f1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "11.1.5_6-2-1-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_6-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word or a future reserved word is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {\ + get _11_1_5_6_2_1() {\ + public = 42;\ + return public;\ + }\ + };"); + + var _11_1_5_6_2_1 = obj._11_1_5_6_2_1; + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js new file mode 100644 index 0000000000..5f381c886a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "11.1.5_6-2-2-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_6-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word or a future reserved word is made inside a strict mode FunctionBody of a PropertyAssignment", + + test: function testcase() { + + try { + eval("var obj = {\ + get _11_1_5_6_2_2() {\ + \"use strict\";\ + public = 42;\ + return public;\ + }\ + };\ + var _11_1_5_6_2_2 = obj._11_1_5_6_2_2;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js new file mode 100644 index 0000000000..6549de96a3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +ES5Harness.registerTest({ + id: "11.1.5_7-2-1-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_7-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word is contained in strict code", + + test: function testcase() { + "use strict"; + + try { + eval("var data = \"data\";\ + var obj = {\ + set _11_1_5_7_2_1(value) {\ + public = 42;\ + data = value;\ + }\ + };\ + obj._11_1_5_7_2_1 = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js new file mode 100644 index 0000000000..a19ab33042 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "11.1.5_7-2-2-s", + + path: "TestCases/chapter11/11.1/11.1.5/11.1.5_7-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when an assignment to a reserved word is made in a strict FunctionBody of a PropertyAssignment", + + test: function testcase() { + "use strict"; + + try { + eval("var data = \"data\";\ + var obj = {\ + set _11_1_5_7_2_2(value) {\ + public = 42;\ + data = value;\ + }\ + };\ + obj._11_1_5_7_2_2 = 1;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.js new file mode 100644 index 0000000000..569040673e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-6-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +PutValue operates only on references (see step 3.a). +*/ + + +ES5Harness.registerTest( { +id: "11.13.1-1-6-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-1-6-s.js", + +description: "simple assignment throws ReferenceError if LeftHandSide is an unresolvable reference in strict mode (base obj undefined)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + __ES3_1_test_suite_test_11_13_1_unique_id_0__.x = 42; + return false; + } + catch (e) { + return (e instanceof ReferenceError); + } + }, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js new file mode 100644 index 0000000000..5afcb5fc17 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-1-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.1-1-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-1-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a data property with the attribute value {[[Writable]]:false} under strict mode", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop = 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.js new file mode 100644 index 0000000000..5cdafb838d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-2-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.1-2-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-2-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to an accessor property with the attribute value {[[Set]]:undefined} under strict mode", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop = 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.js new file mode 100644 index 0000000000..5a60e11ae1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-3-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.1-3-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-3-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide is a reference to a non-existent property of an object whose [[Extensible]] internal property has the value false under strict mode", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len = 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.js new file mode 100644 index 0000000000..b734960cee --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-14-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "11.13.1-4-14-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-14-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Number.MAX_VALUE)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + Number.MAX_VALUE = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.js new file mode 100644 index 0000000000..665621dd0c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-27-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "11.13.1-4-27-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-27-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.undefined)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + fnGlobalObject().undefined = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js new file mode 100644 index 0000000000..e7f39fefbd --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-28-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.1-4-28-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-28-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears as the LeftHandSideExpression of simple assignment(=) under strict mode", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("var eval = 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js new file mode 100644 index 0000000000..a6d241be41 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-29-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.1-4-29-s", + + path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-29-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears as the LeftHandSideExpression of simple assignment(=) under strict mode", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("var arguments = 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.js new file mode 100644 index 0000000000..1303e6b318 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-3-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "11.13.1-4-3-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-3-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.Infinity)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + fnGlobalObject().Infinity = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.js new file mode 100644 index 0000000000..257bab00b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.1/11.13.1-4-6-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "11.13.1-4-6-s", + +path: "TestCases/chapter11/11.13/11.13.1/11.13.1-4-6-s.js", + +description: "simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Function.length)", + strict:1, + +test: function testcase() { + 'use strict'; + + try { + Function.length = 42; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js new file mode 100644 index 0000000000..2b0137f6ea --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-1-s.js @@ -0,0 +1,44 @@ + +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-1-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-1-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(*=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_1 *= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.js new file mode 100644 index 0000000000..d8fd78e09e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-10-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-10-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-10-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(^=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_10 ^= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.js new file mode 100644 index 0000000000..54114d1fa3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-11-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-11-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-11-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(|=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_11 |= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.js new file mode 100644 index 0000000000..c5177e2ea9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-12-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-12-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-12-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(*=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_12 = 5 + _11_13_2_12 *= 2; + return _11_13_2_12 === 10; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.js new file mode 100644 index 0000000000..ed55d2914c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-13-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-13-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-13-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(/=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_13 = 6 + _11_13_2_13 /= 2; + return _11_13_2_13 === 3; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.js new file mode 100644 index 0000000000..f594f0fbe5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-14-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-14-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-14-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(%=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_14 = 5 + _11_13_2_14 %= 2; + return _11_13_2_14 === 1; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.js new file mode 100644 index 0000000000..94d24120f9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-15-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-15-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-15-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(>>>=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_15 = 8 + _11_13_2_15 >>>= 2; + return _11_13_2_15 === 2; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.js new file mode 100644 index 0000000000..b14cd2dbf3 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-16-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-16-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-16-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(-=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_16 = 5 + _11_13_2_16 -= 2; + return _11_13_2_16 === 3; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.js new file mode 100644 index 0000000000..0a11d72431 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-17-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-17-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-17-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(<<=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_17 = 1; + _11_13_2_17 <<= 2; + return _11_13_2_17 === 4; + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.js new file mode 100644 index 0000000000..e6c36482a5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-18-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-18-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-18-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(>>=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_18 = 4 + _11_13_2_18 >>= 2; + return _11_13_2_18 === 1; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.js new file mode 100644 index 0000000000..e0259a6a2a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-19-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-19-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-19-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(+=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_19 = -1 + _11_13_2_19 += 10; + return _11_13_2_19 === 9; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.js new file mode 100644 index 0000000000..30980809a4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-2-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-2-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-2-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(/=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_2 /= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.js new file mode 100644 index 0000000000..f25dafaf57 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-20-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-20-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-20-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(&=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_20 = 5 + _11_13_2_20 &= 3; + return _11_13_2_20 === 1; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.js new file mode 100644 index 0000000000..54c9131f82 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-21-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-21-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-21-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(^=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_21 = 5 + _11_13_2_21 ^= 3; + return _11_13_2_21 === 6; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.js new file mode 100644 index 0000000000..fc86b842ba --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-22-s.js @@ -0,0 +1,41 @@ + +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-22-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-22-s.js", + + description: "Strict Mode - ReferenceError isn't thrown if the LeftHandSideExpression of a Compound Assignment operator(|=) evaluates to a resolvable reference", + + test: function testcase() { + "use strict"; + var _11_13_2_22 = 5 + _11_13_2_22 |= 2; + return _11_13_2_22 === 7; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js new file mode 100644 index 0000000000..e30345367b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-23-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-23-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-23-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop *= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js new file mode 100644 index 0000000000..a8d2f98e75 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-24-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-24-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-24-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop /= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js new file mode 100644 index 0000000000..8ad888fba6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-25-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-25-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-25-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop %= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js new file mode 100644 index 0000000000..7a51eb820b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-26-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-26-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-26-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop += 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js new file mode 100644 index 0000000000..6924f1670a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-27-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-27-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-27-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop -= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js new file mode 100644 index 0000000000..9ce84c1c6c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-28-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-28-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-28-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop <<= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js new file mode 100644 index 0000000000..8385b3ee35 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-29-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-29-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-29-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.js new file mode 100644 index 0000000000..020693b962 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-3-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-3-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-3-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(%=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_3 %= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js new file mode 100644 index 0000000000..026dfd7f8e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-30-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-30-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-30-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js new file mode 100644 index 0000000000..3040d1a109 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-31-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-31-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-31-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop &= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js new file mode 100644 index 0000000000..28ce527642 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-32-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-32-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-32-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop ^= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js new file mode 100644 index 0000000000..0c1813d970 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-33-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-33-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-33-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference to a data property with the attribute value {[[Writable]]:false}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: 10, + writable: false, + enumerable: true, + configurable: true + }); + + try { + obj.prop |= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 10; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.js new file mode 100644 index 0000000000..8635e9bbf6 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-34-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-34-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-34-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop *= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.js new file mode 100644 index 0000000000..d7fa1b08ac --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-35-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-35-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-35-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop /= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.js new file mode 100644 index 0000000000..4618953b6c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-36-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-36-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-36-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop %= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.js new file mode 100644 index 0000000000..685e6aefa9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-37-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-37-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-37-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop += 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.js new file mode 100644 index 0000000000..6d7e6aacd1 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-38-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-38-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-38-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop -= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.js new file mode 100644 index 0000000000..02afcbb551 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-39-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-39-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-39-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop <<= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.js new file mode 100644 index 0000000000..1d282c1cd7 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-4-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-4-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-4-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(+=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_4 += 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.js new file mode 100644 index 0000000000..a1551d679e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-40-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-40-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-40-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.js new file mode 100644 index 0000000000..43be65ccbf --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-41-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-41-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-41-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop >>>= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.js new file mode 100644 index 0000000000..7a089c2786 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-42-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-42-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-42-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop &= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.js new file mode 100644 index 0000000000..7df7543aee --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-43-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-43-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-43-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop ^= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.js new file mode 100644 index 0000000000..a1332df24b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-44-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-44-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-44-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference of to an accessor property with the attribute value {[[Set]]:undefined}", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return 11; + }, + set: undefined, + enumerable: true, + configurable: true + }); + + try { + obj.prop |= 20; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === 11; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.js new file mode 100644 index 0000000000..b6a2859a97 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-45-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-45-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-45-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(*=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len *= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.js new file mode 100644 index 0000000000..007647ceec --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-46-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-46-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-46-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(/=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len /= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.js new file mode 100644 index 0000000000..3effb2a31c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-47-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-47-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-47-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(%=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len %= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.js new file mode 100644 index 0000000000..0c6a29a7ca --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-48-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-48-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-48-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(+=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len += 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.js new file mode 100644 index 0000000000..82706615fb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-49-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-49-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-49-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(-=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len -= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.js new file mode 100644 index 0000000000..3d6d994ca2 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-5-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-5-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-5-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(-=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_5 -= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.js new file mode 100644 index 0000000000..54781470c9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-50-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-50-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-50-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(<<=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len <<= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.js new file mode 100644 index 0000000000..ff1db76135 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-51-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-51-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-51-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len >>= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.js new file mode 100644 index 0000000000..f497bc8421 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-52-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-52-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-52-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(>>>=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len >>>= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.js new file mode 100644 index 0000000000..fb249a9ba9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-53-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-53-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-53-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(&=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len &= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.js new file mode 100644 index 0000000000..97365b282d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-54-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-54-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-54-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(^=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len ^= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.js new file mode 100644 index 0000000000..a2fade7046 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-55-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-55-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-55-s.js", + + description: "Strict Mode - TypeError is thrown if The LeftHandSide of a Compound Assignment operator(|=) is a reference to a non-existent property of an object whose [[Extensible]] internal property if false", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.preventExtensions(obj); + + try { + obj.len |= 10; + return false; + } catch (e) { + return e instanceof TypeError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.preventExtensions); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js new file mode 100644 index 0000000000..608e1342d5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-1-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(*=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval *= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js new file mode 100644 index 0000000000..7766922e60 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-10-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-10-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-10-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(^=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval ^= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js new file mode 100644 index 0000000000..5287145edc --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-11-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-11-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-11-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(|=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval |= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js new file mode 100644 index 0000000000..75f12b1c82 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-12-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-12-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-12-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(*=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments *= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js new file mode 100644 index 0000000000..892fd46aa5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-13-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-13-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-13-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(/=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments /= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js new file mode 100644 index 0000000000..61e4b88f45 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-14-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-14-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-14-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(%=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments %= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js new file mode 100644 index 0000000000..ad7517c181 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-15-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-15-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-15-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(+=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments += 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js new file mode 100644 index 0000000000..e8b7d90097 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-16-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-16-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-16-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(-=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments -= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js new file mode 100644 index 0000000000..4eaa3cb2a8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-17-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-17-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-17-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(<<=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments <<= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js new file mode 100644 index 0000000000..e7e72720fe --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-18-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-18-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-18-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(>>=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments >>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js new file mode 100644 index 0000000000..27c643d876 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-19-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-19-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-19-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(>>>=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments >>>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js new file mode 100644 index 0000000000..f2fbb1276a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-2-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(/=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval /= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js new file mode 100644 index 0000000000..148f599b74 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-20-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-20-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-20-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(&=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments &= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js new file mode 100644 index 0000000000..91c1e44a39 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-21-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-21-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-21-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(^=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments ^= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js new file mode 100644 index 0000000000..49f76b81e2 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-22-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-22-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-22-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier arguments appear as the LeftHandSideExpression of a Compound Assignment operator(|=)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments |= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.js new file mode 100644 index 0000000000..eda0e6d376 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-3-s.js @@ -0,0 +1,45 @@ + +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-3-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-3-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(%=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval %= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js new file mode 100644 index 0000000000..a87b939022 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-4-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-4-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-4-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(+=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval += 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js new file mode 100644 index 0000000000..7731c0f743 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-5-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-5-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-5-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(-=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval -= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js new file mode 100644 index 0000000000..21c2f2b40f --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-6-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-6-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-6-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(<<=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval <<= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js new file mode 100644 index 0000000000..76d331f02c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-7-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-7-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-7-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(>>=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval >>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js new file mode 100644 index 0000000000..4582a33aaf --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-8-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-8-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-8-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(>>>=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval >>>= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js new file mode 100644 index 0000000000..c31280d19e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-9-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-9-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-9-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier eval appear as the LeftHandSideExpression of a Compound Assignment operator(&=)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval &= 20;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.js new file mode 100644 index 0000000000..e6722804d5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-6-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-6-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-6-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(<<=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_6 <<= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.js new file mode 100644 index 0000000000..5db0abb162 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-7-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-7-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-7-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(>>=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_7 >>= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.js new file mode 100644 index 0000000000..c711cc6397 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-8-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-8-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-8-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(>>>=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_8 >>>= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.js b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.js new file mode 100644 index 0000000000..a9dd6444de --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.13/11.13.2/11.13.2-9-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.13.2-9-s", + + path: "TestCases/chapter11/11.13/11.13.2/11.13.2-9-s.js", + + description: "Strict Mode - ReferenceError is thrown if the LeftHandSideExpression of a Compound Assignment operator(&=) evaluates to an unresolvable reference", + + test: function testcase() { + "use strict"; + try { + eval("_11_13_2_9 &= 1;"); + return false; + } catch (e) { + return e instanceof ReferenceError; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js new file mode 100644 index 0000000000..0f96d54f70 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.3.1-2-1-s", + + path: "TestCases/chapter11/11.3/11.3.1/11.3.1-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments++)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments++;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js new file mode 100644 index 0000000000..a0eb613877 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.1/11.3.1-2-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.3.1-2-2-s", + + path: "TestCases/chapter11/11.3/11.3.1/11.3.1-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval++)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval++;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js new file mode 100644 index 0000000000..43dc58d01e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.3.2-2-1-s", + + path: "TestCases/chapter11/11.3/11.3.2/11.3.2-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments--)", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("arguments--;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js new file mode 100644 index 0000000000..9f59edd0f8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.3/11.3.2/11.3.2-2-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.3.2-2-2-s", + + path: "TestCases/chapter11/11.3/11.3.2/11.3.2-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval--)", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("eval--;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js new file mode 100644 index 0000000000..4d8e9884f4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-3-a-1-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-3-a-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting an un-resolvable reference", + + test: function testcase() { + "use strict"; + + try { + eval("delete obj"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js new file mode 100644 index 0000000000..e96ecf3141 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-4-a-1-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-1-s.js", + + description: "Strict Mode - TypeError is thrown when deleting non-configurable data property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: "abc", + configurable: false + }); + + try { + delete obj.prop; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === "abc"; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js new file mode 100644 index 0000000000..83e54b8a30 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-4-a-2-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-2-s.js", + + description: "Strict Mode - TypeError is thrown when deleting non-configurable accessor property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return "abc"; + }, + configurable: false + }); + + try { + delete obj.prop; + return false; + } catch (e) { + return e instanceof TypeError && obj.prop === "abc"; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js new file mode 100644 index 0000000000..136ae2990d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-4-a-3-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-3-s.js", + + description: "Strict Mode - TypeError isn't thrown when deleting configurable data property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + value: "abc", + configurable: true + }); + + delete obj.prop; + return !obj.hasOwnProperty("prop"); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js new file mode 100644 index 0000000000..c4c7bd46c9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-4-a-4-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4-a-4-s.js", + + description: "Strict Mode - TypeError isn't thrown when deleting configurable accessor property", + + test: function testcase() { + "use strict"; + var obj = {}; + Object.defineProperty(obj, "prop", { + get: function () { + return "abc"; + }, + configurable: true + }); + + delete obj.prop; + return !obj.hasOwnProperty("prop"); + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js new file mode 100644 index 0000000000..d7cced6cb9 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.1-4.a-3-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-3-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property in strict mode", + +test: function testcase() { + 'use strict'; + + var o = {}; + var desc = { value : 1 }; // all other attributes default to false + Object.defineProperty(o, "foo", desc); + + // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false. + try { + delete o.foo; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js new file mode 100644 index 0000000000..5f3dd9e1ee --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.1-4.a-8-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-8-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property in strict mode", + +test: function testcase() { + 'use strict'; + + // NaN (15.1.1.1) has [[Configurable]] set to false. + try { + delete fnGlobalObject().NaN; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js new file mode 100644 index 0000000000..fa08e12db8 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.1-4.a-9-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.1-4.a-9-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property (Math.LN2) in strict mode ", + +test: function testcase() { + 'use strict'; + + try { + delete Math.LN2; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js new file mode 100644 index 0000000000..8c1962be29 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-1-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-1-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive value type (number)", + + test: function testcase() { + "use strict"; + var _11_4_1_5 = 5; + + try { + eval("delete _11_4_1_5;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js new file mode 100644 index 0000000000..d48f53fa96 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-10-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-10-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Array", + + test: function testcase() { + "use strict"; + var arrObj = [1,2,3]; + + try { + eval("delete arrObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js new file mode 100644 index 0000000000..85d8bb7648 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-11-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-11-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type String", + + test: function testcase() { + "use strict"; + var strObj = new String("abc"); + + try { + eval("delete strObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js new file mode 100644 index 0000000000..e39eee1b22 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-12-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-12-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Boolean", + + test: function testcase() { + "use strict"; + var boolObj = new Boolean(false); + + try { + eval("delete boolObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js new file mode 100644 index 0000000000..63676ceb80 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-13-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-13-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Number", + + test: function testcase() { + "use strict"; + var numObj = new Number(0); + + try { + eval("delete numObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js new file mode 100644 index 0000000000..8e23412461 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-14-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-14-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Date", + + test: function testcase() { + "use strict"; + var dateObj = new Date(); + + try { + eval("delete dateObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js new file mode 100644 index 0000000000..612c477c8b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-15-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-15-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type RegExp", + + test: function testcase() { + "use strict"; + var regObj = new RegExp(); + + try { + eval("delete regObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js new file mode 100644 index 0000000000..cca5236943 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-16-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-16-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Error", + + test: function testcase() { + "use strict"; + var errObj = new Error(); + + try { + eval("delete errObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js new file mode 100644 index 0000000000..60c87c0984 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-17-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-17-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Arguments", + + test: function testcase() { + "use strict"; + try { + eval("var argObj = (function (a, b) { delete arguments; }(1, 2));"); + + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js new file mode 100644 index 0000000000..76e31c2225 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-18-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-18-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Object)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Object;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js new file mode 100644 index 0000000000..abeb17b87d --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-19-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-19-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Function)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Function;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js new file mode 100644 index 0000000000..d15770081b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-2-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-2-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function parameter", + + test: function testcase() { + "use strict"; + function funObj(x) { + eval("delete x;"); + } + + try { + funObj(1); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js new file mode 100644 index 0000000000..656fcd8b4a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-20-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-20-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Array)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Array;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js new file mode 100644 index 0000000000..01149eb26b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-21-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-21-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (String)", + + test: function testcase() { + "use strict"; + + try { + eval("delete String;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js new file mode 100644 index 0000000000..481412e165 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-22-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-22-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Boolean)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Boolean;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js new file mode 100644 index 0000000000..f4e9966c05 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-23-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-23-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Number)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Number;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js new file mode 100644 index 0000000000..18835e9d6c --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-24-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-24-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Date)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Date;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js new file mode 100644 index 0000000000..bdc5f74580 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-25-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-25-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (RegExp)", + + test: function testcase() { + "use strict"; + + try { + eval("delete RegExp;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js new file mode 100644 index 0000000000..cc5ec0c24a --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-26-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-26-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a built-in (Error)", + + test: function testcase() { + "use strict"; + + try { + eval("delete Error;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js new file mode 100644 index 0000000000..31da03acb4 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-3-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-3-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function name", + + test: function testcase() { + "use strict"; + function funObj () { } + + try { + eval("delete funObj"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js new file mode 100644 index 0000000000..dcfa9c2b37 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-4-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-4-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function parameter", + + test: function testcase() { + "use strict"; + function funObj(x, y, z) { + eval("delete y;"); + } + + try { + funObj(1); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js new file mode 100644 index 0000000000..160f67d6cb --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-5-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-5-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (boolean)", + + test: function testcase() { + "use strict"; + var _11_4_1_5 = true; + + try { + eval("delete _11_4_1_5;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js new file mode 100644 index 0000000000..56c08ad5ca --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-6-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-6-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable which is a primitive type (string)", + + test: function testcase() { + "use strict"; + var _11_4_1_5 = "abc"; + + try { + eval("delete _11_4_1_5;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js new file mode 100644 index 0000000000..7130d243d5 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-7-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-7-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type Object", + + test: function testcase() { + "use strict"; + var obj = new Object(); + + try { + eval("delete obj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js new file mode 100644 index 0000000000..ed0e3d0163 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-8-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-8-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a function object", + + test: function testcase() { + "use strict"; + var funObj = function () { }; + + try { + eval("delete funObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js new file mode 100644 index 0000000000..0b8e185d31 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.1-5-a-9-s", + + path: "TestCases/chapter11/11.4/11.4.1/11.4.1-5-a-9-s.js", + + description: "Strict Mode - SyntaxError is thrown when deleting a variable of type function (declaration)", + + test: function testcase() { + "use strict"; + function funObj () { }; + + try { + eval("delete funObj;"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js new file mode 100644 index 0000000000..f415225d7b --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +This test is actually testing the [[Delete]] internal method (8.12.8). Since the +language provides no way to directly exercise [[Delete]], the tests are placed here. +*/ + +ES5Harness.registerTest( { +id: "11.4.4-4.a-3-s", + +path: "TestCases/chapter11/11.4/11.4.1/11.4.4-4.a-3-s.js", + +description: "delete operator throws TypeError when deleting a non-configurable data property in strict mode", + +test: function testcase() { + 'use strict'; + + var o = {}; + var desc = { value : 1 }; // all other attributes default to false + Object.defineProperty(o, "foo", desc); + + // Now, deleting o.foo should throw TypeError because [[Configurable]] on foo is false. + try { + delete o.foo; + return false; + } + catch (e) { + return (e instanceof TypeError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Object.defineProperty); + } + +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js new file mode 100644 index 0000000000..f7ad6e1100 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.4-2-1-s", + + path: "TestCases/chapter11/11.4/11.4.4/11.4.4-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown for ++eval", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("++eval;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js new file mode 100644 index 0000000000..d2a27a281e --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.4/11.4.4-2-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.4-2-2-s", + + path: "TestCases/chapter11/11.4/11.4.4/11.4.4-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown for ++arguments", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("++arguments;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js new file mode 100644 index 0000000000..be6314bf88 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-1-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.5-2-1-s", + + path: "TestCases/chapter11/11.4/11.4.5/11.4.5-2-1-s.js", + + description: "Strict Mode - SyntaxError is thrown for --eval", + + test: function testcase() { + "use strict"; + var blah = eval; + try { + eval("--eval;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === eval; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js new file mode 100644 index 0000000000..a3dde1fd06 --- /dev/null +++ b/test/suite/ietestcenter/chapter11/11.4/11.4.5/11.4.5-2-2-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "11.4.5-2-2-s", + + path: "TestCases/chapter11/11.4/11.4.5/11.4.5-2-2-s.js", + + description: "Strict Mode - SyntaxError is thrown for --arguments", + + test: function testcase() { + "use strict"; + var blah = arguments; + try { + eval("--arguments;"); + return false; + } catch (e) { + return e instanceof SyntaxError && blah === arguments; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-1.js b/test/suite/ietestcenter/chapter12/12.1/12.1-1.js new file mode 100644 index 0000000000..327ecfa352 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-1.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-1", + + path: "TestCases/chapter12/12.1/12.1-1.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: try-catch", + + test: function testcase() { + try { + eval("try{};catch(){}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-2.js b/test/suite/ietestcenter/chapter12/12.1/12.1-2.js new file mode 100644 index 0000000000..639535c229 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-2", + + path: "TestCases/chapter12/12.1/12.1-2.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: try-catch-finally", + + test: function testcase() { + try { + eval("try{};catch{};finally{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-3.js b/test/suite/ietestcenter/chapter12/12.1/12.1-3.js new file mode 100644 index 0000000000..ecddb4e26f --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-3.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-3", + + path: "TestCases/chapter12/12.1/12.1-3.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: try-finally", + + test: function testcase() { + try { + eval("try{};finally{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-4.js b/test/suite/ietestcenter/chapter12/12.1/12.1-4.js new file mode 100644 index 0000000000..eba8682f01 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-4", + + path: "TestCases/chapter12/12.1/12.1-4.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: if-else", + + test: function testcase() { + try { + eval("if{};else{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-5.js b/test/suite/ietestcenter/chapter12/12.1/12.1-5.js new file mode 100644 index 0000000000..720eaaa28f --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-5.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-5", + + path: "TestCases/chapter12/12.1/12.1-5.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: if-else-if", + + test: function testcase() { + try { + eval("if{};else if{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-6.js b/test/suite/ietestcenter/chapter12/12.1/12.1-6.js new file mode 100644 index 0000000000..d5dd8d9b81 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-6.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-6", + + path: "TestCases/chapter12/12.1/12.1-6.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: if-else-if-else", + + test: function testcase() { + try { + eval("if{};else if{};else{}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.1/12.1-7.js b/test/suite/ietestcenter/chapter12/12.1/12.1-7.js new file mode 100644 index 0000000000..8915c1ff20 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.1/12.1-7.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.1-7", + + path: "TestCases/chapter12/12.1/12.1-7.js", + + description: "12.1 - block '{ StatementListopt };' is not allowed: do-while", + + test: function testcase() { + try { + eval("do{};while()"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.js new file mode 100644 index 0000000000..7dc6afdd3b --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-1-s.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-1-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-1-s.js", + +description: "with statement in strict mode throws SyntaxError (strict function)", + +test: function testcase() { + + try { + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. + eval("\ + function f() {\ + \'use strict\';\ + var o = {}; \ + with (o) {};\ + }\ + "); + return false; + } + catch (e) { + return(e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.js new file mode 100644 index 0000000000..03506fd3d5 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-10-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-10-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-10-s.js", + +description: "with statement in strict mode throws SyntaxError (eval, where the container function is strict)", + +test: function testcase() { + 'use strict'; + + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. Note that eval + // inherits the strictness of its calling context. + try { + eval("\ + var o = {};\ + with (o) {}\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js new file mode 100644 index 0000000000..75c0097ead --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-11-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.10.1-11-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-11-s.js", + + description: "Strict Mode - SyntaxError is thrown when using WithStatement in strict mode code", + + test: function testcase() { + "use strict"; + try { + eval("with ({}) { throw new Error();}"); + + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js new file mode 100644 index 0000000000..1101f1e24f --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-12-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-12-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-12-s.js", + +description: "with statement in strict mode throws SyntaxError (strict eval)", + +test: function testcase() { + try { + eval("\ + 'use strict'; \ + var o = {}; \ + with (o) {}\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError) ; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.js new file mode 100644 index 0000000000..91cdf703ff --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-13-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.10.1-13-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-13-s.js", + + description: "Strict Mode - SyntaxError isn't thrown when WithStatement body is in strict mode code", + + test: function testcase() { + with ({}) { + "use strict"; + } + return true; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.js new file mode 100644 index 0000000000..4277ff4963 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-14-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.10.1-14-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-14-s.js", + + description: "Strict Mode - SyntaxError is thrown when the getter of a literal object utilizes WithStatement", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = { get: function (a) { with(a){} } }; "); + + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js new file mode 100644 index 0000000000..961a58f2e0 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-15-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.10.1-15-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-15-s.js", + + description: "Strict Mode - SyntaxError is thrown when the RHS of a dot property assignment utilizes WithStatement", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {}; obj.get = function (a) { with(a){} }; "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js new file mode 100644 index 0000000000..bfc0a402ea --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-16-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.10.1-16-s", + + path: "TestCases/chapter12/12.10/12.10.1/12.10.1-16-s.js", + + description: "Strict Mode - SyntaxError is thrown when the RHS of an object indexer assignment utilizes WithStatement", + + test: function testcase() { + "use strict"; + + try { + eval("var obj = {}; obj['get'] = function (a) { with(a){} }; "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js new file mode 100644 index 0000000000..c4369f5e0a --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-2-s.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-2-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-2-s.js", + +description: "with statement in strict mode throws SyntaxError (nested function where container is strict)", + +test: function testcase() { + try { + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. + eval("\ + function foo() {\ + \'use strict\'; \ + function f() {\ + var o = {}; \ + with (o) {};\ + }\ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js new file mode 100644 index 0000000000..969dae88ee --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-3-s.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-3-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-3-s.js", + +description: "with statement in strict mode throws SyntaxError (nested strict function)", + +test: function testcase() { + try { + // wrapping it in eval since this needs to be a syntax error. The + // exception thrown must be a SyntaxError exception. + eval("\ + function foo() {\ + function f() {\ + \'use strict\'; \ + var o = {}; \ + with (o) {};\ + }\ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.js new file mode 100644 index 0000000000..990b2bbf5f --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-4-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-4-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-4-s.js", + +description: "with statement in strict mode throws SyntaxError (strict Function)", + +test: function testcase() { + try { + var f = Function("\ + \'use strict\'; \ + var o = {}; \ + with (o) {};\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.js new file mode 100644 index 0000000000..c1e9f1ef19 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-5-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-5-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-5-s.js", + +description: "with statement allowed in nested Function even if its container Function is strict)", + +test: function testcase() { + + Function("\'use strict\'; var f1 = Function( \"var o = {}; with (o) {};\")"); + return true; + + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js new file mode 100644 index 0000000000..36814d00c1 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-7-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-7-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-7-s.js", + +description: "with statement in strict mode throws SyntaxError (function expression, where the container function is directly evaled from strict code)", + +test: function testcase() { + 'use strict'; + + try { + eval("var f = function () {\ + var o = {}; \ + with (o) {}; \ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js new file mode 100644 index 0000000000..cc0b62b7a7 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-8-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-8-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-8-s.js", + +description: "with statement in strict mode throws SyntaxError (function expression, where the container Function is strict)", + +test: function testcase() { + try { + Function("\ + \'use strict\'; \ + var f1 = function () {\ + var o = {}; \ + with (o) {}; \ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js new file mode 100644 index 0000000000..8ed8c9b022 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.10/12.10.1/12.10.1-9-s.js @@ -0,0 +1,51 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.10.1-9-s", + +path: "TestCases/chapter12/12.10/12.10.1/12.10.1-9-s.js", + +description: "with statement in strict mode throws SyntaxError (strict function expression)", + +test: function testcase() { + try { + eval("\ + var f = function () {\ + \'use strict\';\ + var o = {}; \ + with (o) {}; \ + }\ + "); + return false; + } + catch (e) { + return (e instanceof SyntaxError) ; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.js new file mode 100644 index 0000000000..64cac0ce15 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-1-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.14.1-1-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is eval", + + test: function testcase() { + "use strict"; + + try { + eval("\ + try {} catch (eval) { }\ + "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.js new file mode 100644 index 0000000000..89226a8078 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-2-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.14.1-2-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is arguments", + + test: function testcase() { + "use strict"; + + try { + eval("\ + try {} catch (arguments) { }\ + "); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.js new file mode 100644 index 0000000000..39dbb88ca9 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-3-s.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.14.1-3-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-3-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL but throws SyntaxError if it is eval", + + test: function testcase() { + "use strict"; + + try{ eval(" try { \ + throw new Error(\"...\");\ + return false;\ + } catch (EVAL) {\ + try\ + {\ + throw new Error(\"...\");\ + }catch(eval)\ + {\ + return EVAL instanceof Error;\ + }\ + }"); + return false; + } catch(e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js new file mode 100644 index 0000000000..eb3ca3b539 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-4-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.14.1-4-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-4-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL", + + test: function testcase() { + "use strict"; + + try { + throw new Error("..."); + return false; + } catch (EVAL) { + return EVAL instanceof Error; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js new file mode 100644 index 0000000000..e7820de9f2 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-5-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.14.1-5-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-5-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is Arguments", + + test: function testcase() { + "use strict"; + + try { + throw new Error("..."); + return false; + } catch (Arguments) { + return Arguments instanceof Error; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js new file mode 100644 index 0000000000..bf3e5039f8 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.14/12.14.1/12.14.1-6-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "12.14.1-6-s", + + path: "TestCases/chapter12/12.14/12.14.1/12.14.1-6-s.js", + + description: "Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is ARGUMENTS", + + test: function testcase() { + "use strict"; + + try { + throw new Error("..."); + return false; + } catch (ARGUMENTS) { + return ARGUMENTS instanceof Error; + } + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.js new file mode 100644 index 0000000000..6431b852bd --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-1-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-1-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-1-s.js", + +description: "eval - a function declaring a var named 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('function foo() { var eval; }'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.js new file mode 100644 index 0000000000..1b06b6b29b --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-10-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-10-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-10-s.js", + +description: "Strict Mode: an indirect eval assigning into 'eval' does not throw", + +test: function testcase() { + 'use strict'; + var s = eval; + s('eval = 42;'); + return true; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.js new file mode 100644 index 0000000000..8eefc136dd --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-12-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-12-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-12-s.js", + +description: "arguments as local var identifier throws SyntaxError in strict mode", + +test: function testcase() { + + try { + eval("(function (){'use strict'; var arguments;});"); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.js new file mode 100644 index 0000000000..e2b77b649d --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-13-s.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-13-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-13-s.js", + +description: "arguments as global var identifier throws SyntaxError in strict mode", + +test: function testcase() { + + var indirectEval = eval; + + try { + indirectEval("'use strict'; var arguments;"); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function () { + //indirect eval must be globally scoped + var localVar = "12.2.1-13-s"; + var indirectEval = eval; + try { + if (indirectEval("localVar;")==="12.2.1-13-s" ) + return false; + } catch (e) { + } + return fnSupportsStrict(); +} + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.js new file mode 100644 index 0000000000..e1fcc0ff80 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-2-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-2-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-2-s.js", + +description: "eval - a function assigning into 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('function foo() { eval = 42; }; foo()'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.js new file mode 100644 index 0000000000..8f7e265984 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-3-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-3-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-3-s.js", + +description: "eval - a function expr declaring a var named 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('(function () { var eval; })'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.js new file mode 100644 index 0000000000..eafe3a676c --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-4-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-4-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-4-s.js", + +description: "eval - a function expr assigning into 'eval' throws a SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('(function () { eval = 42; })()'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.js new file mode 100644 index 0000000000..674e5883a5 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-5-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "12.2.1-5-s", + + path: "TestCases/chapter12/12.2/12.2.1/12.2.1-5-s.js", + + description: "Strict Mode - a Function declaring var named 'eval' does not throw SyntaxError", + + test: function testcase() { + 'use strict'; + Function('var eval;'); + return true; + }, + + strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.js new file mode 100644 index 0000000000..04d635406a --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-6-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-6-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-6-s.js", + +description: "eval - a Function assigning into 'eval' will not throw any error if contained within strict mode and its body does not start with strict mode", + +test: function testcase() { + 'use strict'; + + var f = Function('eval = 42;'); + f(); + return true; + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.js new file mode 100644 index 0000000000..35af90bfec --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-7-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-7-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-7-s.js", + +description: "eval - a direct eval declaring a var named 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('var eval;'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.js new file mode 100644 index 0000000000..960ad8a902 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-8-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-8-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-8-s.js", + +description: "eval - a direct eval assigning into 'eval' throws SyntaxError in strict mode", + +test: function testcase() { + 'use strict'; + + try { + eval('eval = 42;'); + return false; + } + catch (e) { + return (e instanceof SyntaxError) ; + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + + +}); diff --git a/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.js b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.js new file mode 100644 index 0000000000..bf259e9c60 --- /dev/null +++ b/test/suite/ietestcenter/chapter12/12.2/12.2.1/12.2.1-9-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "12.2.1-9-s", + +path: "TestCases/chapter12/12.2/12.2.1/12.2.1-9-s.js", + +description: "Strict Mode: an indirect eval declaring a var named 'eval' does not throw", + +test: function testcase() { + 'use strict'; + var s = eval; + s('var eval;'); + return true; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-1.js b/test/suite/ietestcenter/chapter13/13.0/13.0-1.js new file mode 100644 index 0000000000..c67b310eee --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-1.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "13.0-1", + + path: "TestCases/chapter13/13.0/13.0-1.js", + + description: "13.0 - multiple names in one function declaration is not allowed, two function names", + + test: function testcase() { + try { + eval("function x, y() {}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js new file mode 100644 index 0000000000..73b951c4b4 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-10-s.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-10-s", + + path: "TestCases/chapter13/13.0/13.0-10-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionBody with an inner function contains a Use Strict Directive", + + test: function testcase() { + + function _13_0_10_fun() { + function _13_0_10_inner() { + "use strict"; + eval("eval = 42;"); + } + _13_0_10_inner(); + }; + try { + _13_0_10_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js new file mode 100644 index 0000000000..c674487e40 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-11-s.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-11-s", + + path: "TestCases/chapter13/13.0/13.0-11-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionBody with an inner function which is in strict mode", + + test: function testcase() { + + function _13_0_11_fun() { + "use strict"; + function _13_0_11_inner() { + eval("eval = 42;"); + } + _13_0_11_inner(); + }; + try { + _13_0_11_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-12-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-12-s.js new file mode 100644 index 0000000000..605cb09762 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-12-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-12-s", + + path: "TestCases/chapter13/13.0/13.0-12-s.js", + + description: "Strict Mode - SourceElements is not evaluated as strict mode code when a Function constructor is contained in strict mode code and the function constructor body is not strict", + + test: function testcase() { + "use strict"; + + var _13_0_12_fun = new Function(" ","eval = 42;"); + _13_0_12_fun(); + return true; + + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-13-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-13-s.js new file mode 100644 index 0000000000..d1b605c752 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-13-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-13-s", + + path: "TestCases/chapter13/13.0/13.0-13-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the function body of a Function constructor begins with a Strict Directive", + + test: function testcase() { + + try { + eval("var _13_0_13_fun = new Function(\" \", \"'use strict'; eval = 42;\"); _13_0_13_fun();"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js new file mode 100644 index 0000000000..2ef9de83d4 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-14-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-14-s", + + path: "TestCases/chapter13/13.0/13.0-14-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the function body of a Function constructor contains a Strict Directive", + + test: function testcase() { + + try { + var _13_0_14_fun = new Function(" ", "'use strict'; eval = 42; "); + _13_0_14_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js new file mode 100644 index 0000000000..48216777f0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-15-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-15-s", + + path: "TestCases/chapter13/13.0/13.0-15-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration is contained in strict mode code within eval code", + + test: function testcase() { + + try { + eval("'use strict'; function _13_0_15_fun() {eval = 42;};"); + _13_0_15_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js new file mode 100644 index 0000000000..f60d362119 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-16-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-16-s", + + path: "TestCases/chapter13/13.0/13.0-16-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when a FunctionExpression is contained in strict mode code within eval code", + + test: function testcase() { + + try { + eval("'use strict'; var _13_0_16_fun = function () {eval = 42;};"); + _13_0_16_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js new file mode 100644 index 0000000000..e098644be1 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-17-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-17-s", + + path: "TestCases/chapter13/13.0/13.0-17-s.js", + + description: "Strict Mode - SourceElements is not evaluated as strict mode code when a Function constructor is contained in strict mode code within eval code", + + test: function testcase() { + + eval("'use strict'; var _13_0_17_fun = new Function('eval = 42;'); _13_0_17_fun();"); + return true; + }, + + strict: 1, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-2.js b/test/suite/ietestcenter/chapter13/13.0/13.0-2.js new file mode 100644 index 0000000000..a91ae2014f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "13.0-2", + + path: "TestCases/chapter13/13.0/13.0-2.js", + + description: "13.0 - multiple names in one function declaration is not allowed, three function names", + + test: function testcase() { + try { + eval("function x,y,z(){}"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-3.js b/test/suite/ietestcenter/chapter13/13.0/13.0-3.js new file mode 100644 index 0000000000..c327e664f2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-3.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "13.0-3", + + path: "TestCases/chapter13/13.0/13.0-3.js", + + description: "13.0 - property names in function definition is not allowed, add a new property into object", + + test: function testcase() { + var obj = {}; + try { + eval("function obj.tt() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-4.js b/test/suite/ietestcenter/chapter13/13.0/13.0-4.js new file mode 100644 index 0000000000..54aac59387 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-4.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest({ + id: "13.0-4", + + path: "TestCases/chapter13/13.0/13.0-4.js", + + description: "13.0 - multiple names in one function declaration is not allowed, add a new property into a property which is a object", + + test: function testcase() { + var obj = {}; + obj.tt = { len: 10 }; + try { + eval("function obj.tt.ss() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + precondition: function prereq() { + return true; + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js new file mode 100644 index 0000000000..14f2316789 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-7-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-7-s", + + path: "TestCases/chapter13/13.0/13.0-7-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionDeclaration is contained in non-strict mode but the call to eval is a direct call in strict mode code", + + test: function testcase() { + + try { + eval("'use strict'; function _13_0_7_fun() {eval = 42;};"); + _13_0_7_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-8-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-8-s.js new file mode 100644 index 0000000000..32f48b85f3 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-8-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-8-s", + + path: "TestCases/chapter13/13.0/13.0-8-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionExpression is contained in non-strict mode but the call to eval is a direct call in strict mode code", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_0_8_fun = function () {eval = 42;};"); + _13_0_8_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.0/13.0-9-s.js b/test/suite/ietestcenter/chapter13/13.0/13.0-9-s.js new file mode 100644 index 0000000000..8ad46c8ac6 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.0/13.0-9-s.js @@ -0,0 +1,53 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13; +The production FunctionBody : SourceElementsopt is evaluated as follows: +*/ + +ES5Harness.registerTest({ + id: "13.0-9-s", + + path: "TestCases/chapter13/13.0/13.0-9-s.js", + + description: "Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration that is contained in strict mode code has an inner function", + + test: function testcase() { + "use strict"; + + var _13_0_9_fun = function () { + function _13_0_9_inner() { eval("eval = 42;"); } + _13_0_9_inner(); + }; + try { + _13_0_9_fun(); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-1-1.js b/test/suite/ietestcenter/chapter13/13.1/13.1-1-1.js new file mode 100644 index 0000000000..4e30988288 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-1-1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-1-1", + +path: "TestCases/chapter13/13.1/13.1-1-1.js", + +description: "Duplicate identifier allowed in non-strict function declaration parameter list", + +test: function testcase() +{ + try + { + eval('function foo(a,a){}'); + return true; + } + catch (e) { return false } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-1-2.js b/test/suite/ietestcenter/chapter13/13.1/13.1-1-2.js new file mode 100644 index 0000000000..f83c65b46d --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-1-2.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-1-2", + +path: "TestCases/chapter13/13.1/13.1-1-2.js", + +description: "Duplicate identifier allowed in non-strict function expression parameter list", + +test: function testcase() +{ + try + { + eval('(function foo(a,a){})'); + return true; + } + catch (e) { return false } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-1-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-1-s.js new file mode 100644 index 0000000000..e924402a64 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-1-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-1-s", + + path: "TestCases/chapter13/13.1/13.1-1-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_1_fun(eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-10-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-10-s.js new file mode 100644 index 0000000000..45ab396beb --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-10-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-10-s", + + path: "TestCases/chapter13/13.1/13.1-10-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has three identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_10_fun = function (param, param, param) { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-11-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-11-s.js new file mode 100644 index 0000000000..12827e7081 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-11-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-11-s", + + path: "TestCases/chapter13/13.1/13.1-11-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration in strict mode", + + test: function testcase() { + "use strict"; + try { + eval("function eval() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-12-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-12-s.js new file mode 100644 index 0000000000..f992c4319b --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-12-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-12-s", + + path: "TestCases/chapter13/13.1/13.1-12-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression in strict mode", + + test: function testcase() { + "use strict"; + var _13_1_12_s = {}; + + try { + eval("_13_1_12_s.x = function eval() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js new file mode 100644 index 0000000000..8c116f00ff --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-13-s.js @@ -0,0 +1,44 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-13-s", + + path: "TestCases/chapter13/13.1/13.1-13-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the function name of a FunctionDeclaration in strict mode", + + test: function testcase() { + "use strict"; + + try { + eval("function arguments() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-14-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-14-s.js new file mode 100644 index 0000000000..4a88437788 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-14-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-14-s", + + path: "TestCases/chapter13/13.1/13.1-14-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression in strict mode", + + test: function testcase() { + "use strict"; + var _13_1_14_s = {}; + + try { + eval("_13_1_14_s.x = function arguments() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js new file mode 100644 index 0000000000..9345878562 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-15-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-15-s", + + path: "TestCases/chapter13/13.1/13.1-15-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict';function _13_1_15_fun(eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js new file mode 100644 index 0000000000..c4b5e59ac8 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-16-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-16-s", + + path: "TestCases/chapter13/13.1/13.1-16-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("function _13_1_16_fun(eval) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js new file mode 100644 index 0000000000..fc9d0b69f2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-17-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-17-s", + + path: "TestCases/chapter13/13.1/13.1-17-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_17_fun = function (eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js new file mode 100644 index 0000000000..fac3888b28 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-18-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-18-s", + + path: "TestCases/chapter13/13.1/13.1-18-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("var _13_1_18_fun = function (eval) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js new file mode 100644 index 0000000000..d1cdf2f8f7 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-19-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-19-s", + + path: "TestCases/chapter13/13.1/13.1-19-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict';function _13_1_19_fun(arguments) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-1.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-1.js new file mode 100644 index 0000000000..aeedc030a2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-2-1", + +path: "TestCases/chapter13/13.1/13.1-2-1.js", + +description: "eval allowed as formal parameter name of a non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function foo(eval){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js new file mode 100644 index 0000000000..127526bac1 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-2.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-2-2", + +path: "TestCases/chapter13/13.1/13.1-2-2.js", + +description: "eval allowed as formal parameter name of a non-strict function expression", + +test: function testcase() +{ + eval("(function foo(eval){});"); + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-5.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-5.js new file mode 100644 index 0000000000..005d8384b0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-5.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-2-5", + +path: "TestCases/chapter13/13.1/13.1-2-5.js", + +description: "arguments allowed as formal parameter name of a non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function foo(arguments){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js new file mode 100644 index 0000000000..292a78032f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-6.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-2-6", + +path: "TestCases/chapter13/13.1/13.1-2-6.js", + +description: "arguments allowed as formal parameter name of a non-strict function expression", + +test: function testcase() +{ + eval("(function foo(arguments){});"); + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-2-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-2-s.js new file mode 100644 index 0000000000..851720d7db --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-2-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-2-s", + + path: "TestCases/chapter13/13.1/13.1-2-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_2_fun = function (eval) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js new file mode 100644 index 0000000000..d1fbf24d82 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-20-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-20-s", + + path: "TestCases/chapter13/13.1/13.1-20-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("function _13_1_20_fun(arguments) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js new file mode 100644 index 0000000000..851d5bcb36 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-21-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-21-s", + + path: "TestCases/chapter13/13.1/13.1-21-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionExpression in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_21_fun = function (arguments) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js new file mode 100644 index 0000000000..b38c1a0e82 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-22-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-22-s", + + path: "TestCases/chapter13/13.1/13.1-22-s.js", + + description: "StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionExpression when FuctionBody is strict code", + + test: function testcase() { + + try { + eval("var _13_1_22_fun = function (arguments) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js new file mode 100644 index 0000000000..3b6f4445d9 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-23-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-23-s", + + path: "TestCases/chapter13/13.1/13.1-23-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration that is contained in eval strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; function _13_1_23_fun(param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js new file mode 100644 index 0000000000..6bfb3115af --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-24-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-24-s", + + path: "TestCases/chapter13/13.1/13.1-24-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("function _13_1_24_fun(param, param) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js new file mode 100644 index 0000000000..31f82c5c59 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-25-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-25-s", + + path: "TestCases/chapter13/13.1/13.1-25-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration that is contained in eval strict code and the function has two identical parameters which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("'use strict'; function _13_1_25_fun(param1, param2, param1) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js new file mode 100644 index 0000000000..bd092d8e0c --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-26-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-26-s", + + path: "TestCases/chapter13/13.1/13.1-26-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has two identical parameters which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("function _13_1_26_fun(param1, param2, param1) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js new file mode 100644 index 0000000000..0fbfc25b43 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-27-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-27-s", + + path: "TestCases/chapter13/13.1/13.1-27-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration that is contained in eval strict code and the function has three identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; function _13_1_27_fun(param, param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-28-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-28-s.js new file mode 100644 index 0000000000..ffe9b1418e --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-28-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-28-s", + + path: "TestCases/chapter13/13.1/13.1-28-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has three identical parameters", + + test: function testcase() { + + + try { + eval("function _13_1_28_fun(param, param, param) { 'use strict'; }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js new file mode 100644 index 0000000000..2eb7e33dab --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-29-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-29-s", + + path: "TestCases/chapter13/13.1/13.1-29-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression that is contained in eval strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_29_fun = function (param, param) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-1.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-1.js new file mode 100644 index 0000000000..d9aebdacf0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-3-1", + +path: "TestCases/chapter13/13.1/13.1-3-1.js", + +description: "eval allowed as function identifier in non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function eval(){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-2.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-2.js new file mode 100644 index 0000000000..368317610c --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-2.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-3-2", + +path: "TestCases/chapter13/13.1/13.1-3-2.js", + +description: "eval allowed as function identifier in non-strict function expression", + +test: function testcase() +{ + try + { + eval("(function eval(){});"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-7.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-7.js new file mode 100644 index 0000000000..3f0754ea00 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-7.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-3-7", + +path: "TestCases/chapter13/13.1/13.1-3-7.js", + +description: "arguments allowed as function identifier in non-strict function declaration", + +test: function testcase() +{ + try + { + eval("function arguments (){};"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-8.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-8.js new file mode 100644 index 0000000000..2940cdb826 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-8.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "13.1-3-8", + +path: "TestCases/chapter13/13.1/13.1-3-8.js", + +description: "arguments allowed as function identifier in non-strict function expression", + +test: function testcase() +{ + try + { + eval("(function arguments (){});"); + return true; + } + catch (e) { } + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-3-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-3-s.js new file mode 100644 index 0000000000..e828891dc4 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-3-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-3-s", + + path: "TestCases/chapter13/13.1/13.1-3-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_3_fun(arguments) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js new file mode 100644 index 0000000000..18a6e4c908 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-30-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-30-s", + + path: "TestCases/chapter13/13.1/13.1-30-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression whose FunctionBody is contained in strict code and the function has two identical parameters", + + test: function testcase() { + + try { + eval("var _13_1_30_fun = function (param, param) { 'use strict'; };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js new file mode 100644 index 0000000000..784784e6a8 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-31-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-31-s", + + path: "TestCases/chapter13/13.1/13.1-31-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression that is contained in eval strict code and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_31_fun = function (param1, param2, param1) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js new file mode 100644 index 0000000000..b189bd8657 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-32-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-32-s", + + path: "TestCases/chapter13/13.1/13.1-32-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression whose FunctionBody is strict and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + + try { + eval("var _13_1_32_fun = function (param1, param2, param1) { 'use strict'; };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js new file mode 100644 index 0000000000..e27291b209 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-33-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-33-s", + + path: "TestCases/chapter13/13.1/13.1-33-s.js", + + description: "Strict Mode - SyntaxError is thrown if function is created using a FunctionExpression that is contained in eval strict code and the function has three identical parameters", + + test: function testcase() { + + try { + eval("'use strict'; var _13_1_33_fun = function (param, param, param) { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js new file mode 100644 index 0000000000..1d59ee4797 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-34-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-34-s", + + path: "TestCases/chapter13/13.1/13.1-34-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function declaration has three identical parameters with a strict mode body", + + test: function testcase() { + + try { + eval("var _13_1_34_fun = function (param, param, param) { 'use strict'; };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-35-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-35-s.js new file mode 100644 index 0000000000..119297abb5 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-35-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-35-s", + + path: "TestCases/chapter13/13.1/13.1-35-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; function eval() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-36-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-36-s.js new file mode 100644 index 0000000000..3bd19c17fb --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-36-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-36-s", + + path: "TestCases/chapter13/13.1/13.1-36-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration whose FunctionBody is in strict mode", + + test: function testcase() { + + try { + eval("function eval() { 'use strict'; };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-37-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-37-s.js new file mode 100644 index 0000000000..5d74adc0b0 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-37-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-37-s", + + path: "TestCases/chapter13/13.1/13.1-37-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression in strict eval code", + + test: function testcase() { + var _13_1_37_s = {}; + try { + eval("'use strict'; _13_1_37_s.x = function eval() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-38-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-38-s.js new file mode 100644 index 0000000000..a60de745e9 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-38-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-38-s", + + path: "TestCases/chapter13/13.1/13.1-38-s.js", + + description: "StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression whose FunctionBody is contained in strict code", + + test: function testcase() { + var _13_1_38_s = {}; + try { + eval("_13_1_38_s.x = function eval() {'use strict'; };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-39-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-39-s.js new file mode 100644 index 0000000000..bb4e2cf040 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-39-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-39-s", + + path: "TestCases/chapter13/13.1/13.1-39-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the function name of a FunctionDeclaration in strict eval code", + + test: function testcase() { + + try { + eval("'use strict'; function arguments() { };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-4-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-4-s.js new file mode 100644 index 0000000000..ac6b92bf3e --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-4-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs within a FormalParameterList +of a strict mode FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-4-s", + + path: "TestCases/chapter13/13.1/13.1-4-s.js", + + description: "Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionExpression", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_4_fun = function (arguments) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-40-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-40-s.js new file mode 100644 index 0000000000..b042436174 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-40-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-40-s", + + path: "TestCases/chapter13/13.1/13.1-40-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionDeclaration whose FunctionBody is contained in strict code", + + test: function testcase() { + + try { + eval("function arguments() { 'use strict'; };") + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-41-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-41-s.js new file mode 100644 index 0000000000..ba7ebdd80f --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-41-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-41-s", + + path: "TestCases/chapter13/13.1/13.1-41-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression in strict eval code", + + test: function testcase() { + var _13_1_41_s = {}; + try { + eval("'use strict'; _13_1_41_s.x = function arguments() {};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-42-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-42-s.js new file mode 100644 index 0000000000..edc0375305 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-42-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.1-42-s", + + path: "TestCases/chapter13/13.1/13.1-42-s.js", + + description: "StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression whose FunctionBody is contained in strict code", + + test: function testcase() { + var _13_1_42_s = {}; + try { + eval("_13_1_42_s.x = function arguments() {'use strict';};"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-5-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-5-s.js new file mode 100644 index 0000000000..3ba4999f6e --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-5-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-5-s", + + path: "TestCases/chapter13/13.1/13.1-5-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is declared in 'strict mode' using a FunctionDeclaration and the function has two identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_5_fun(param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-6-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-6-s.js new file mode 100644 index 0000000000..92011f6e24 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-6-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-6-s", + + path: "TestCases/chapter13/13.1/13.1-6-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionDeclaration and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_6_fun(param1, param2, param1) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-7-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-7-s.js new file mode 100644 index 0000000000..b981d87489 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-7-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-7-s", + + path: "TestCases/chapter13/13.1/13.1-7-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionDeclaration and the function has three identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("function _13_1_7_fun(param, param, param) { }"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-8-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-8-s.js new file mode 100644 index 0000000000..e250ff39d8 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-8-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-8-s", + + path: "TestCases/chapter13/13.1/13.1-8-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has two identical parameters", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_8_fun = function (param, param) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.1/13.1-9-s.js b/test/suite/ietestcenter/chapter13/13.1/13.1-9-s.js new file mode 100644 index 0000000000..a36126cfa2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.1/13.1-9-s.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* +Refer 13.1; +It is a SyntaxError if any Identifier value occurs more than once within a FormalParameterList of a strict mode +FunctionDeclaration or FunctionExpression. +*/ + +ES5Harness.registerTest({ + id: "13.1-9-s", + + path: "TestCases/chapter13/13.1/13.1-9-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has two identical parameters, which are separated by a unique parameter name", + + test: function testcase() { + "use strict"; + + try { + eval("var _13_1_9_fun = function (param1, param2, param1) { };"); + return false; + } catch (e) { + return e instanceof SyntaxError; + } + }, + + strict: 1, + + precondition: function prereq() { + return fnSupportsStrict(); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-1-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-1-s.js new file mode 100644 index 0000000000..86e3f0daa2 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-1-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.2-1-s", + + path: "TestCases/chapter13/13.2/13.2-1-s.js", + + description: "StrictMode - Writing or reading from a property named 'caller' of function objects is allowed under both strict and normal modes.", + + test: function testcase() { + "use strict"; + + var foo = function () { + this.caller = 12; + } + var obj = new foo(); + return obj.caller === 12; + }, + + strict : 1, + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-2-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-2-s.js new file mode 100644 index 0000000000..0176995d59 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-2-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.2-2-s", + + path: "TestCases/chapter13/13.2/13.2-2-s.js", + + description: "StrictMode - A TypeError is thrown when a strict mode code writes to properties named 'caller' of function instances.", + + test: function testcase() { + "use strict"; + try { + var foo = function () { + } + foo.caller = 20; + return false; + } catch (ex) { + return ex instanceof TypeError; + } + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-3-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-3-s.js new file mode 100644 index 0000000000..6cf5cbaf82 --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-3-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.2-3-s", + + path: "TestCases/chapter13/13.2/13.2-3-s.js", + + description: "StrictMode - Writing or reading from a property named 'arguments' of function objects is allowed under both strict and normal modes.", + + test: function testcase() { + "use strict"; + + var foo = function () { + this.arguments = 12; + } + var obj = new foo(); + return obj.arguments === 12; + }, + strict : 1, + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter13/13.2/13.2-4-s.js b/test/suite/ietestcenter/chapter13/13.2/13.2-4-s.js new file mode 100644 index 0000000000..975a74360c --- /dev/null +++ b/test/suite/ietestcenter/chapter13/13.2/13.2-4-s.js @@ -0,0 +1,43 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "13.2-4-s", + + path: "TestCases/chapter13/13.2/13.2-4-s.js", + + description: "StrictMode - A TypeError is thrown when a code in strict mode tries to write to 'arguments' of function instances.", + + test: function testcase() { + "use strict"; + try { + var foo = function () { + } + foo.arguments = 20; + return false; + } catch (ex) { + return ex instanceof TypeError; + } + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-1-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-1-s.js new file mode 100644 index 0000000000..30848fc739 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-1-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-1-s", + +path: "TestCases/chapter14/14.1/14.1-1-s.js", + +description: "'use strict' directive - correct usage", + +test: function testcase() { + + function foo() + { + 'use strict'; + return(this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-10-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-10-s.js new file mode 100644 index 0000000000..ceb82dfb2f --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-10-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-10-s", + +path: "TestCases/chapter14/14.1/14.1-10-s.js", + +description: "other directives - may follow 'use strict' directive ", + +test: function testcase() { + + function foo() + { + "use strict"; + "bogus directive"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js new file mode 100644 index 0000000000..0d3aa7083a --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-11-s.js @@ -0,0 +1,49 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-11-s", + +path: "TestCases/chapter14/14.1/14.1-11-s.js", + +description: "comments may preceed 'use strict' directive ", + +test: function testcase() { + + function foo() + { + // comment + /* comment */ "use strict"; + + return(this === undefined); + + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-12-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-12-s.js new file mode 100644 index 0000000000..62e5809ed6 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-12-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-12-s", + +path: "TestCases/chapter14/14.1/14.1-12-s.js", + +description: "comments may follow 'use strict' directive ", + +test: function testcase() { + + function foo() + { + "use strict"; /* comment */ // comment + + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-13-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-13-s.js new file mode 100644 index 0000000000..4b160e7e5a --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-13-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-13-s", + +path: "TestCases/chapter14/14.1/14.1-13-s.js", + +description: "semicolon insertion works for'use strict' directive ", + +test: function testcase() { + + function foo() + { + "use strict" + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-14-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-14-s.js new file mode 100644 index 0000000000..9b14573003 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-14-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-14-s", + +path: "TestCases/chapter14/14.1/14.1-14-s.js", + +description: "semicolon insertion may come before 'use strict' directive ", + +test: function testcase() { + + function foo() + { + "another directive" + "use strict" ; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-15-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-15-s.js new file mode 100644 index 0000000000..c4e47ca562 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-15-s.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-15-s", + +path: "TestCases/chapter14/14.1/14.1-15-s.js", + +description: "blank lines may come before 'use strict' directive ", + +test: function testcase() { + + function foo() + { + + + + + + + "use strict" ; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-16-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-16-s.js new file mode 100644 index 0000000000..05d50056a7 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-16-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-16-s", + +path: "TestCases/chapter14/14.1/14.1-16-s.js", + +description: "'use strict' directive - not recognized if it follow an empty statement", + +test: function testcase() { + + function foo() + { + ; 'use strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-17-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-17-s.js new file mode 100644 index 0000000000..e924e42a3e --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-17-s.js @@ -0,0 +1,46 @@ + /// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-17-s", + +path: "TestCases/chapter14/14.1/14.1-17-s.js", + +description: "'use strict' directive - not recognized if it follow some other statment empty statement", + +test: function testcase() { + + function foo() + { + var x; + 'use strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-2-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-2-s.js new file mode 100644 index 0000000000..4b223c8982 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-2-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-2-s", + +path: "TestCases/chapter14/14.1/14.1-2-s.js", + +description: '"use strict" directive - correct usage double quotes', + +test: function testcase() { + + function foo() + { + "use strict"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-3-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-3-s.js new file mode 100644 index 0000000000..b2152b8ccf --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-3-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-3-s", + +path: "TestCases/chapter14/14.1/14.1-3-s.js", + +description: "'use strict' directive - not recognized if it contains extra whitespace", + +test: function testcase() { + + function foo() + { + ' use strict '; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-4-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-4-s.js new file mode 100644 index 0000000000..cfba044eca --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-4-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-4-s", + +path: "TestCases/chapter14/14.1/14.1-4-s.js", + +description: "'use strict' directive - not recognized if contains Line Continuation", + +test: function testcase() { + + function foo() + { + 'use str\ +ict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-5-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-5-s.js new file mode 100644 index 0000000000..e61fe4e100 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-5-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-5-s", + +path: "TestCases/chapter14/14.1/14.1-5-s.js", + +description: "'use strict' directive - not recognized if contains a EscapeSequence", + +test: function testcase() { + + function foo() + { + 'use\u0020strict'; + return(this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-6-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-6-s.js new file mode 100644 index 0000000000..73671ff243 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-6-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-6-s", + +path: "TestCases/chapter14/14.1/14.1-6-s.js", + +description: "'use strict' directive - not recognized if contains a <TAB> instead of a space", + +test: function testcase() { + + function foo() + { + 'use strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-7-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-7-s.js new file mode 100644 index 0000000000..d227de1c9c --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-7-s.js @@ -0,0 +1,45 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-7-s", + +path: "TestCases/chapter14/14.1/14.1-7-s.js", + +description: "'use strict' directive - not recognized if upper case", + +test: function testcase() { + + function foo() + { + 'Use Strict'; + return (this !== undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-8-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-8-s.js new file mode 100644 index 0000000000..63ab764267 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-8-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-8-s", + +path: "TestCases/chapter14/14.1/14.1-8-s.js", + +description: "'use strict' directive - may follow other directives", + +test: function testcase() { + + function foo() + { + "bogus directive"; + "use strict"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter14/14.1/14.1-9-s.js b/test/suite/ietestcenter/chapter14/14.1/14.1-9-s.js new file mode 100644 index 0000000000..0535a57284 --- /dev/null +++ b/test/suite/ietestcenter/chapter14/14.1/14.1-9-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "14.1-9-s", + +path: "TestCases/chapter14/14.1/14.1-9-s.js", + +description: "'use strict' directive - may occur multiple times", + +test: function testcase() { + + function foo() + { + 'use strict'; + "use strict"; + return (this === undefined); + } + + return foo.call(undefined); + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js new file mode 100644 index 0000000000..8b8217e581 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-1.js", + + description: "Object.defineProperty will update [[Value]] attribute of named property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'O' is an Object object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "property", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "property", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "property", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js new file mode 100644 index 0000000000..639b4cf93b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-11", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-11.js", + + description: "ES5 Attributes - indexed property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false is writable using simple assignment, 'O' is an Arguments object", + + test: function testcase() { + var obj = (function (x) { + return arguments; + }(1001)); + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var verifyValue = (obj[0] === 2010); + + return verifyValue; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js new file mode 100644 index 0000000000..fa54c03681 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-2.js", + + description: "Object.defineProperty will update [[Value]] attribute of indexed property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'A' is an Array object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = []; + + Object.defineProperty(obj, "0", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "0", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "0", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js new file mode 100644 index 0000000000..5212bfa8b2 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js @@ -0,0 +1,50 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-3.js", + + description: "Object.defineProperty will update [[Value]] attribute of named property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'O' is an Arguments object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "property", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "property", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "property", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js new file mode 100644 index 0000000000..72c7c286c0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-4.js", + + description: "Indexed property 'P' with attributes [[Writable]]: true, [[Enumerable]]:true, [[Configurable]]:false is writable using simple assignment, 'A' is an Array Object", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var verifyValue = (obj[0] === 2010); + obj[0] = 1001; + + return verifyValue && obj[0] === 1001; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js new file mode 100644 index 0000000000..7273d1e19b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-6.js", + + description: "Object.defineProperty will update [[Value]] attribute of indexed property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'O' is an Object object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "0", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "0", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "0", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js new file mode 100644 index 0000000000..56dc4c808b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-333-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-333-7.js", + + description: "Object.defineProperty will update [[Value]] attribute of named property 'P' successfully when [[Configurable]] attribute is false, [[Writable]] attribute is true and 'A' is an Array object (8.12.9 - step 10)", + + test: function testcase() { + + var obj = []; + + Object.defineProperty(obj, "prop", { + value: 1001, + writable: true, + configurable: false + }); + + Object.defineProperty(obj, "prop", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "prop", 1002, true, false, false); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js new file mode 100644 index 0000000000..eee5f803f8 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js @@ -0,0 +1,57 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-339-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-1.js", + + description: "Object.defineProperty - Updating indexed data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'A' is an Array object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "0", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + return propertyDefineCorrect && desc1.value === 2010 && obj[0] === 2010 && typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js new file mode 100644 index 0000000000..984f76d0d6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-339-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-2.js", + + description: "Object.defineProperty - Updating named data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'O' is an Arguments object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "prop", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + return propertyDefineCorrect && desc1.value === 2010 && obj.prop === 2010 && typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js new file mode 100644 index 0000000000..ec4b0e4a6f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js @@ -0,0 +1,58 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-339-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-3.js", + + description: "Object.defineProperty - Updating named data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'A' is an Array object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "prop", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + return propertyDefineCorrect && desc1.value === 2010 && obj.prop === 2010 && + typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js new file mode 100644 index 0000000000..605d2e707f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-339-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-339-4.js", + + description: "Object.defineProperty - Updating indexed data property 'P' with attributes [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false to an accessor property does not succeed, 'O' is an Arguments object (8.12.9 - step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "0", { + value: 2010, + writable: true, + enumerable: true, + configurable: false + }); + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + try { + Object.defineProperty(obj, "0", { + get: getFunc + }); + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + return propertyDefineCorrect && desc1.value === 2010 && obj[0] === 2010 && + typeof desc2.get === "undefined" && e instanceof TypeError; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js index 72c1bc8764..9b57c9853d 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-341.js", - description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js index 53289a1b67..7b7dab4c6a 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-348.js", - description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is true, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js new file mode 100644 index 0000000000..157f04515f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-354-13", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-354-13.js", + + description: "Object.defineProperty will update [[Value]] attribute of indexed property successfully when [[Configurable]] attribute is true and [[Writable]] attribute is false, 'O' is the global object (8.12.9 - step Note)", + + test: function testcase() { + + var obj = fnGlobalObject(); + + try { + Object.defineProperty(obj, "0", { + value: 1001, + writable: false, + configurable: true + }); + + Object.defineProperty(obj, "0", { + value: 1002 + }); + + return dataPropertyAttributesAreCorrect(obj, "0", 1002, false, false, true); + } finally { + delete obj[0]; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js new file mode 100644 index 0000000000..1d3296df7e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-360-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-1.js", + + description: "ES5 Attributes - Updating indexed data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'A' is an Array object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "0", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "0", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj[0] === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js new file mode 100644 index 0000000000..140ebea9c4 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js @@ -0,0 +1,57 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-360-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-2.js", + + description: "ES5 Attributes - Updating data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is an Arguments object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "prop", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj.prop === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js new file mode 100644 index 0000000000..463a0dd657 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js @@ -0,0 +1,58 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-360-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-3.js", + + description: "ES5 Attributes - Updating data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is the global object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + Object.defineProperty(obj, "prop", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "prop", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj.prop === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + } finally { + delete obj.prop; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js new file mode 100644 index 0000000000..075057213e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-360-5", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-5.js", + + description: "ES5 Attributes - Updating named data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'A' is an Array object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = []; + + Object.defineProperty(obj, "prop", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "prop", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj.prop === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js new file mode 100644 index 0000000000..3ad474c6dd --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js @@ -0,0 +1,57 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-360-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-6.js", + + description: "ES5 Attributes - Updating indexed data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is an Arguments object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + Object.defineProperty(obj, "0", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "0", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj[0] === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js new file mode 100644 index 0000000000..da37a11708 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js @@ -0,0 +1,58 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-360-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-360-7.js", + + description: "ES5 Attributes - Updating indexed data property 'P' whose attributes are [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: true to an accessor property, 'O' is the global object (8.12.9 - step 9.b.i)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + Object.defineProperty(obj, "0", { + value: 2010, + writable: false, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + function getFunc() { + return 20; + } + Object.defineProperty(obj, "0", { + get: getFunc + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("value") && desc2.hasOwnProperty("get") && + desc2.enumerable === true && desc2.configurable === true && + obj[0] === 20 && typeof desc2.set === "undefined" && desc2.get === getFunc; + } finally { + delete obj[0]; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js index df4a8b5724..db0ede8012 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-369.js", - description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js index 190907db9f..ee67c2d893 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-376.js", - description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Writable]] is false, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js index 23e14d2bb4..6794bbe670 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-403.js @@ -33,7 +33,7 @@ ES5Harness.registerTest({ enumerable: true, configurable: true }); - var arrObj = new Array(); + var arrObj = []; arrObj.prop = 1002; return arrObj.hasOwnProperty("prop") && arrObj.prop === 1002; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js index 63e10751b8..5104a90147 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-406.js", - description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is unenumerable (Function instance)", + description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function instance)", test: function testcase() { try { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js index 5edb035c23..cdbffb857e 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-411.js", - description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is unenumerable (Math)", + description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Math)", test: function testcase() { try { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js index 6305722d83..0c9e2de5b1 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-416.js", - description: "ES5 Attributes - Inherited properties whose [[Enumerable]] attribute is set to false is unenumerable (Object.create)", + description: "ES5 Attributes - Inherited properties whose [[Enumerable]] attribute is set to false is non-enumerable (Object.create)", test: function testcase() { var appointment = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js index 64afa0a7ed..e108590afb 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-421.js", - description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is unenumerable (Function.prototype.bind)", + description: "ES5 Attributes - Inherited property whose [[Enumerable]] attribute is set to false is non-enumerable (Function.prototype.bind)", test: function testcase() { var foo = function () { }; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js index fc13071f4f..28464b07d4 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-442.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js index b8f42f52cc..a9f7b61452 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-451.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js index cf41b73a0e..d0d43b07c9 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-478.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js index 0301374c36..17ab81abd0 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-487.js", - description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is undefined, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js index e35fe56c76..a4b9be08dd 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-514.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js index d5e379d7e7..2f8424aeab 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-523.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js new file mode 100644 index 0000000000..072620840b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-531-15", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-15.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' using simple assignment is successful, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + var verifySetFunc = "data"; + var setFunc = function (value) { + verifySetFunc = value; + }; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && desc.set === setFunc && obj.prop === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js new file mode 100644 index 0000000000..efbda9c6ca --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js @@ -0,0 +1,58 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-531-16", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-16.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + var verifySetFunc = "data"; + var setFunc = function (value) { + verifySetFunc = value; + }; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj[0] === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js new file mode 100644 index 0000000000..955e6469cf --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js @@ -0,0 +1,60 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-531-17", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-17.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'O' is the global object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + obj.verifySetFunc = "data"; + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + var getFunc = function () { + return obj.verifySetFunc; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj[0] === "overrideData"; + } finally { + delete obj[0]; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js new file mode 100644 index 0000000000..772994438d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js @@ -0,0 +1,52 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-531-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-6.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' without [[Set]] using simple assignment is failed, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + var verifySetFunc = "data"; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + enumerable: true, + configurable: true + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && typeof desc.set === "undefined" && obj[0] === "data"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js new file mode 100644 index 0000000000..ebe7a6fa80 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-531-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-7.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' without [[Set]] using simple assignment is failed, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + var verifySetFunc = "data"; + var getFunc = function () { + return verifySetFunc; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + enumerable: true, + configurable: true + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && typeof desc.set === "undefined" && obj.prop === "data"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js new file mode 100644 index 0000000000..f7ff6f379a --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js @@ -0,0 +1,56 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-531-8", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-531-8.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' without [[Set]] using simple assignment is failed, 'O' is the global object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = fnGlobalObject(); + try { + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + enumerable: true, + configurable: true + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && typeof desc.set === "undefined" && obj.prop === "data"; + } finally { + delete obj.prop; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js new file mode 100644 index 0000000000..ada12a8b31 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js @@ -0,0 +1,61 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-538-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-1.js", + + description: "ES5 Attributes - Updating an indexed 'P' whose [[Configurable]] attribute is true to a data property is successful, 'A' is an Array object (8.12.9 - step 9.c.i)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + Object.defineProperty(obj, "0", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js new file mode 100644 index 0000000000..d572875c18 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js @@ -0,0 +1,63 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-538-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-2.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is an Arguments object", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + Object.defineProperty(obj, "prop", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js new file mode 100644 index 0000000000..f9ed5be391 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-538-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-3.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is the global object", + + test: function testcase() { + var obj = fnGlobalObject(); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + try { + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + Object.defineProperty(obj, "prop", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); + } finally { + delete obj.prop; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js new file mode 100644 index 0000000000..a09eeca93c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js @@ -0,0 +1,61 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-538-5", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-5.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'A' is an Array object (8.12.9 - step 9.c.i)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + Object.defineProperty(obj, "prop", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js new file mode 100644 index 0000000000..c52e60bf7f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js @@ -0,0 +1,63 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-538-6", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-6.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is an Arguments object", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + Object.defineProperty(obj, "0", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, true, true); + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js new file mode 100644 index 0000000000..d7906f0a7b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-538-7", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538-7.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is true to a data property is successful, 'O' is the global object", + + test: function testcase() { + var obj = fnGlobalObject(); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + try { + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: true + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + Object.defineProperty(obj, "0", { + value: 1001 + }); + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, true, true); + } finally { + delete obj[0]; + delete obj.verifySetFunc; + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js index 66c510462b..a5932c76aa 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-538.js @@ -50,7 +50,9 @@ ES5Harness.registerTest({ }); var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); - return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value"); + return desc1.hasOwnProperty("get") && desc2.hasOwnProperty("value") && + typeof desc2.get === "undefined" && typeof desc2.get === "undefined" && + dataPropertyAttributesAreCorrect(obj, "prop", 1001, false, true, true); }, precondition: function prereq() { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js new file mode 100644 index 0000000000..db67ec4e6d --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-540-10", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-10.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js new file mode 100644 index 0000000000..a9095c5274 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js @@ -0,0 +1,71 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-540-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-2.js", + + description: "Object.defineProperty fails to update [[Get]] and [[Set]] attributes of an indexed property 'P' whose [[Configurable]] attribute is false and throws TypeError exception, 'A' is an Array object (8.12.9 step 11.a)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunction = "data"; + var getFunc = function () { + return obj.verifySetFunction; + }; + var setFunc = function (value) { + obj.verifySetFunction = value; + }; + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + configurable: false + }); + + var result = false; + try { + Object.defineProperty(obj, "0", { + get: function () { + return 100; + } + }); + } catch (e) { + result = e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunction", false, false); + } + + try { + Object.defineProperty(obj, "0", { + set: function (value) { + obj.verifySetFunction1 = value; + } + }); + } catch (e1) { + return result && e1 instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunction", false, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js new file mode 100644 index 0000000000..67982d8e97 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js @@ -0,0 +1,57 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-540-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-4.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' using simple assignment is successful, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj[0] = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("0"); + var desc = Object.getOwnPropertyDescriptor(obj, "0"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js new file mode 100644 index 0000000000..23d8e2ee23 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-540-5", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-5.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' using simple assignment is successful, 'O' is an Arguments object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js new file mode 100644 index 0000000000..ad9cc37533 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js @@ -0,0 +1,57 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-540-9", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-540-9.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' using simple assignment is successful, 'A' is an Array object (8.12.5 step 5.b)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + + obj.prop = "overrideData"; + var propertyDefineCorrect = obj.hasOwnProperty("prop"); + var desc = Object.getOwnPropertyDescriptor(obj, "prop"); + + return propertyDefineCorrect && desc.set === setFunc && obj.verifySetFunc === "overrideData"; + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js new file mode 100644 index 0000000000..139036155c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-547-1", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-1.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Array object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + try { + Object.defineProperty(obj, "0", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js new file mode 100644 index 0000000000..a8b71040c0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js @@ -0,0 +1,67 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-547-2", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-2.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Arguments object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + try { + Object.defineProperty(obj, "prop", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "prop", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js new file mode 100644 index 0000000000..bb69df065b --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-547-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-3.js", + + description: "ES5 Attributes - Updating a named accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Array object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = []; + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "prop", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); + + try { + Object.defineProperty(obj, "prop", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "prop", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js new file mode 100644 index 0000000000..0e49fa9bfc --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js @@ -0,0 +1,67 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.6-4-547-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-547-4.js", + + description: "ES5 Attributes - Updating an indexed accessor property 'P' whose [[Configurable]] attribute is false to a data property does not succeed, 'A' is an Arguments object (8.12.9 step 9.a)", + + test: function testcase() { + var obj = (function () { + return arguments; + }()); + + obj.verifySetFunc = "data"; + var getFunc = function () { + return obj.verifySetFunc; + }; + + var setFunc = function (value) { + obj.verifySetFunc = value; + }; + + Object.defineProperty(obj, "0", { + get: getFunc, + set: setFunc, + enumerable: true, + configurable: false + }); + var desc1 = Object.getOwnPropertyDescriptor(obj, "0"); + + try { + Object.defineProperty(obj, "0", { + value: 1001 + }); + + return false; + } catch (e) { + var desc2 = Object.getOwnPropertyDescriptor(obj, "0"); + + return desc1.hasOwnProperty("get") && !desc2.hasOwnProperty("value") && e instanceof TypeError && + accessorPropertyAttributesAreCorrect(obj, "0", getFunc, setFunc, "verifySetFunc", true, false); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperty) && fnExists(Object.getOwnPropertyDescriptor); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js index 6e3b17a43d..cb051cf1b8 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-550.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is true) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js index 9bc3af19c8..56588175d6 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-559.js", - description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is unenumerable", + description: "ES5 Attributes - property ([[Get]] is a Function, [[Set]] is a Function, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable", test: function testcase() { var obj = {}; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js index 09a036c467..23f0badb71 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-570.js @@ -37,9 +37,8 @@ ES5Harness.registerTest({ }); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); - var tempVariable = obj.prop; - return obj.hasOwnProperty("prop") && desc.get === getFunc && verifyExecute && typeof obj.prop === "undefined"; + return obj.hasOwnProperty("prop") && desc.get === getFunc && typeof obj.prop === "undefined" && verifyExecute; }, precondition: function prereq() { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js index d9a5f80450..82904485bf 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-579.js @@ -38,7 +38,7 @@ ES5Harness.registerTest({ enumerable: true, configurable: true }); - var arrObj = new Array(); + var arrObj = []; arrObj.prop = "myOwnProperty"; return !arrObj.hasOwnProperty("prop") && arrObj.prop === "myOwnProperty" && data === "myOwnProperty"; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js index 56df4d8eef..0a4be3492b 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-587.js", - description: "ES5 Attributes - Inherited property is unenumerable (Math)", + description: "ES5 Attributes - Inherited property is non-enumerable (Math)", test: function testcase() { var data = "data"; diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js index fd1d73e519..cb3c388637 100644 --- a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js @@ -23,7 +23,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-99.js", - description: "Object.defineProperty will throw TypeError when name.configurable = false, name.[[Get]] is undefined, desc.[[Get]] refers to an objcet (8.12.9 step 11.a.ii)", + description: "Object.defineProperty will throw TypeError when name.configurable = false, name.[[Get]] is undefined, desc.[[Get]] refers to an object (8.12.9 step 11.a.ii)", test: function testcase() { diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js new file mode 100644 index 0000000000..9bd6cdfef6 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.7-6-a-93-3", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-3.js", + + description: "Object.defineProperties will fail to update [[Value]] attribute of named data property 'P' when [[Configurable]] attribute of first updating property is false (8.12.9 - step Note & 10.a.ii.1)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "property", { + value: 1001, + writable: false, + configurable: false + }); + + Object.defineProperty(obj, "property1", { + value: 1003, + writable: false, + configurable: true + }); + + try { + Object.defineProperties(obj, { + property: { + value: 1002 + }, + property1: { + value: 1004 + } + }); + + return false; + } catch (e) { + return e instanceof TypeError && + dataPropertyAttributesAreCorrect(obj, "property", 1001, false, false, false) && + dataPropertyAttributesAreCorrect(obj, "property1", 1003, false, false, true); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperties) && fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js new file mode 100644 index 0000000000..8eaad4f3b1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js @@ -0,0 +1,65 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.2.3.7-6-a-93-4", + + path: "TestCases/chapter15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-93-4.js", + + description: "Object.defineProperties will fail to update [[Value]] attribute of indexed data property 'P' when [[Configurable]] attribute of first updating property are false (8.12.9 - step Note & 10.a.ii.1)", + + test: function testcase() { + + var obj = {}; + + Object.defineProperty(obj, "0", { + value: 1001, + writable: false, + configurable: false + }); + + Object.defineProperty(obj, "1", { + value: 1003, + writable: false, + configurable: true + }); + + try { + Object.defineProperties(obj, { + 0: { + value: 1002 + }, + 1: { + value: 1004 + } + }); + + return false; + } catch (e) { + return e instanceof TypeError && + dataPropertyAttributesAreCorrect(obj, "0", 1001, false, false, false) && + dataPropertyAttributesAreCorrect(obj, "1", 1003, false, false, true); + } + }, + + precondition: function prereq() { + return fnExists(Object.defineProperties) && fnExists(Object.defineProperty); + } +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js new file mode 100644 index 0000000000..de0084a59e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-1-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-1-s.js", + +description: "Duplicate seperate parameter name in Function constructor throws SyntaxError in strict mode", + +test: function testcase() { + try { + Function('a','a','"use strict";'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js new file mode 100644 index 0000000000..96acd84605 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-2-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-2-s.js", + +description: "Duplicate seperate parameter name in Function constructor called from strict mode allowed if body not strict", + +test: function testcase() +{ + "use strict"; + try { + Function('a','a','return;'); + return true; + } catch (e) { + return false; + } + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js new file mode 100644 index 0000000000..bac05b2b0e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-3-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-3-s.js", + +description: "Function constructor having a formal parameter named 'eval' throws SyntaxError if function body is strict mode", + +test: function testcase() { + + + try { + Function('eval', '"use strict";'); + return false; + } + catch (e) { + return (e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js new file mode 100644 index 0000000000..91945989e5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-4-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-4-s.js", + +description: "Function constructor call from strict code with formal parameter named 'eval' does not throws SyntaxError if function body is not strict mode", + +test: function testcase() { + "use strict"; + try { + Function('eval', 'return;'); + return true; + } catch (e) { + return false; + } + + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js new file mode 100644 index 0000000000..a916e358f7 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-5-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-5-s.js", + +description: "Duplicate combined parameter name in Function constructor throws SyntaxError in strict mode", + +test: function testcase() +{ + try + { + Function('a,a','"use strict";'); + return false; + } + catch (e) { + return(e instanceof SyntaxError); + } + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js new file mode 100644 index 0000000000..b6a09dbae2 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-6-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-6-s.js", + +description: "Duplicate combined parameter name allowed in Function constructor called in strict mode if body not strict", + +test: function testcase() +{ + "use strict"; + try { + Function('a,a','return a;'); + return true; + } catch (e) { + return false; + } + + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js new file mode 100644 index 0000000000..140e5db5aa --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.3.2.1-11-7-s", + +path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-7-s.js", + +description: "Function constructor call from strict code with formal parameter named arguments does not throws SyntaxError if function body is not strict mode", + +test: function testcase() { + "use strict"; + try { + Function('arguments', 'return;'); + return true; + + } catch (e) { + return false; + } + }, + +strict:1, + +precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js new file mode 100644 index 0000000000..56ff76c4fb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.2.1-11-8-s", + + path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-8-s.js", + + description: "Strict Mode - SyntaxError is not thrown if a function is created using a Function constructor that has two identical parameters, which are separated by a unique parameter name and there is no explicit 'use strict' in the function constructor's body", + + test: function testcase() { + "use strict"; + + var foo = new Function("baz", "qux", "baz", "return 0;"); + return true; + + }, + + strict : 1, + precondition: function prereq() { + return true; + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js new file mode 100644 index 0000000000..f47ecedac0 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.2.1-11-9-s", + + path: "TestCases/chapter15/15.3/15.3.2/15.3.2.1/15.3.2.1-11-9-s.js", + + description: "Strict Mode - SyntaxError is thrown if a function is created using the Function constructor that has three identical parameters and there is no explicit 'use strict' in the function constructor's body", + + test: function testcase() { + "use strict"; + + var foo = new Function("baz", "baz", "baz", "return 0;"); + return true; + }, + strict : 1, + precondition: function prereq() { + return true; + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js new file mode 100644 index 0000000000..b49459a5aa --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.4.3-1-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-1-s.js", + + description: "Strict Mode - 'this' value is a string which cannot be converted to wrapper objects when the function is called with an array of arguments", + + test: function testcase() { + "use strict"; + + function fun() { + return (this instanceof String); + } + return !fun.apply("", Array); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js new file mode 100644 index 0000000000..6be263632c --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.4.3-2-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-2-s.js", + + description: "Strict Mode - 'this' value is a number which cannot be converted to wrapper objects when the function is called with an array of arguments", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof Number); + } + return !fun.apply(-12, Array); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js new file mode 100644 index 0000000000..d405aa4097 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.4.3-3-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.3/15.3.4.3-3-s.js", + + description: "Strict Mode - 'this' value is a boolean which cannot be converted to wrapper objects when the function is called with an array of arguments", + + test: function testcase() { + "use strict"; + + function fun() { + return (this instanceof Boolean); + } + return !fun.apply(false, Array); + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js new file mode 100644 index 0000000000..bb762230bb --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.4.4-1-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-1-s.js", + + description: "Strict Mode - 'this' value is a string which cannot be converted to wrapper objects when the function is called without an array of arguments", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof String); + } + return !fun.call(""); + }, + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js new file mode 100644 index 0000000000..bc0fa8b112 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.4.4-2-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-2-s.js", + + description: "Strict Mode - 'this' value is a number which cannot be converted to wrapper objects when the function is called without an array argument", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof Number); + } + return !fun.call(-12); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js new file mode 100644 index 0000000000..41834e85ff --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ES5Harness.registerTest({ + id: "15.3.4.4-3-s", + + path: "TestCases/chapter15/15.3/15.3.4/15.3.4.4/15.3.4.4-3-s.js", + + description: "Strict Mode - 'this' value is a boolean which cannot be converted to wrapper objects when the function is called without an array of arguments", + + test: function testcase() { + "use strict"; + function fun() { + return (this instanceof Boolean); + } + return !fun.call(false); + }, + + strict : 1, + precondition: function prereq() { + return fnSupportsStrict(); + } + +}); \ No newline at end of file diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js new file mode 100644 index 0000000000..d055607638 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.16/15.4.4.16-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.4.4.16-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.16-5-1-s.js", + +description: "Array.prototype.every - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].every(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.every); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js new file mode 100644 index 0000000000..29b3b0dd74 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.17/15.4.4.17-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.4.4.17-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.17-5-1-s.js", + +description: "Array.prototype.some - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].some(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.some); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js new file mode 100644 index 0000000000..3ba069e2d1 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.18/15.4.4.18-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.4.4.18-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.18-5-1-s.js", + +description: "Array.prototype.forEach - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].forEach(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.forEach); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js new file mode 100644 index 0000000000..535598579e --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.19/15.4.4.19-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.4.4.19-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.19-5-1-s.js", + +description: "Array.prototype.map - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].map(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.map); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js new file mode 100644 index 0000000000..56eb00e258 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-5-1-s.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.4.4.20-5-1-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.20-5-1-s.js", + +description: "Array.prototype.filter - thisArg not passed to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + + function callbackfn(val, idx, obj) { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + + [1].filter(callbackfn); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.filter); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js new file mode 100644 index 0000000000..72fc8ab3a5 --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.21/15.4.4.21-9-c-ii-4-s.js @@ -0,0 +1,48 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +ES5Harness.registerTest( { +id: "15.4.4.21-9-c-ii-4-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.21-9-c-ii-4-s.js", + +description: "Array.prototype.reduce - undefined passed as thisValue to strict callbackfn", +//ES5 Errata, undefined in step 9.c.ii as thisValue is supposed to be undefined + +test: function testcase() { + var innerThisCorrect = false; + function callbackfn(prevVal, curVal, idx, obj) + { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + [0].reduce(callbackfn,true); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.reduce); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js new file mode 100644 index 0000000000..978888414f --- /dev/null +++ b/test/suite/ietestcenter/chapter15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2010 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +ES5Harness.registerTest( { +id: "15.4.4.22-9-c-ii-4-s", + +path: "TestCases/chapter15/15.4/15.4.4/15.4.4.22-9-c-ii-4-s.js", + +description: "Array.prototype.reduceRight - undefined passed as thisValue to strict callbackfn", + +test: function testcase() { + var innerThisCorrect = false; + function callbackfn(prevVal, curVal, idx, obj) + { + "use strict"; + innerThisCorrect = this===undefined; + return true; + } + [0].reduceRight(callbackfn,true); + return innerThisCorrect; + }, + +strict:1, + +precondition: function prereq() { + return fnSupportsStrict() && fnExists(Array.prototype.reduceRight); + } +}); diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js index 5deefd392a..0375e483f7 100644 --- a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js @@ -24,7 +24,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-10.js", - description: "String.prototype.trim - 'S' is a string with null character ('\u0000')", + description: "String.prototype.trim - 'S' is a string with null character ('\\u0000')", test: function testcase() { return "\u0000".trim() === "\u0000"; diff --git a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js index 385bfd330e..7026ea1a7a 100644 --- a/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js +++ b/test/suite/ietestcenter/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js @@ -24,7 +24,7 @@ ES5Harness.registerTest({ path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-3-9.js", - description: "String.prototype.trim - 'S' is a string with null character ('\0')", + description: "String.prototype.trim - 'S' is a string with null character ('\\0')", test: function testcase() { return "\0".trim() === "\0"; -- GitLab