From 4fb5071cd44559b1f4f1bb06c4067a68a059994b Mon Sep 17 00:00:00 2001 From: David Fugate <dfugate@microsoft.com> Date: Mon, 27 Feb 2012 15:46:23 -0800 Subject: [PATCH] Migrated latest external\contributions\Microsoft\ietcLatest changes over to test\suite\*. --- test/harness/helper.js | 2 - test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js | 32 ++++++++++ test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js | 30 ++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js | 32 ++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js | 32 ++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js | 32 ++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js | 32 ++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js | 32 ++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js | 33 +++++++++++ test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js | 34 +++++++++++ test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js | 41 +++++++++++++ test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js | 55 +++++++++++++++++ test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js | 59 +++++++++++++++++++ test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js | 54 +++++++++++++++++ test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js | 38 ++++++++++++ test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js | 40 +++++++++++++ test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js | 38 ++++++++++++ test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js | 40 +++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js | 38 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js | 37 ++++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js | 36 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js | 35 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js | 33 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js | 34 +++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js | 32 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js | 30 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js | 31 ++++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js | 29 +++++++++ test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js | 32 ++++++++++ test/suite/ch10/10.6/10.6-13-a-2.js | 46 +++++++++++++++ test/suite/ch10/10.6/10.6-13-a-3.js | 47 +++++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js | 39 ++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js | 39 ++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js | 39 ++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js | 41 +++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js | 39 ++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js | 38 ++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js | 38 ++++++++++++ test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js | 42 +++++++++++++ .../suite/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js | 40 +++++++++++++ .../suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js | 38 ++++++++++++ test/suite/ch13/13.0/13_4-17gs.js | 3 +- test/suite/ch13/13.0/13_4-5gs.js | 3 +- test/suite/ch13/13.2/13.2-10-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-11-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-12-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-13-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-14-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-15-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-16-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-17-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-18-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-19-b-3gs.js | 29 +++++++++ test/suite/ch13/13.2/13.2-19-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-20-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-21-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-22-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-23-s.js | 38 ++++++++++++ test/suite/ch13/13.2/13.2-24-s.js | 41 +++++++++++++ test/suite/ch13/13.2/13.2-25-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-26-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-27-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-28-s.js | 41 +++++++++++++ test/suite/ch13/13.2/13.2-29-s.js | 34 +++++++++++ test/suite/ch13/13.2/13.2-30-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-31-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-32-s.js | 34 +++++++++++ test/suite/ch13/13.2/13.2-33-s.js | 34 +++++++++++ test/suite/ch13/13.2/13.2-34-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-35-s.js | 33 +++++++++++ test/suite/ch13/13.2/13.2-36-s.js | 34 +++++++++++ test/suite/ch13/13.2/13.2-6-s.js | 39 ++++++++++++ test/suite/ch13/13.2/13.2-9-s.js | 39 ++++++++++++ .../15.10.4/{ => 15.10.4.1}/15.10.4.1-1.js | 2 +- .../15.10.4/{ => 15.10.4.1}/15.10.4.1-2.js | 2 +- .../15.10.4/{ => 15.10.4.1}/15.10.4.1-3.js | 2 +- .../15.10.4/{ => 15.10.4.1}/15.10.4.1-4.js | 2 +- .../15.10/15.10.4/15.10.4.1/15.10.4.1-5.js | 31 ++++++++++ .../ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js | 30 ++++++++++ .../ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js | 30 ++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js | 34 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js | 38 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js | 38 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js | 40 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js | 40 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js | 42 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js | 41 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js | 40 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js | 38 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js | 38 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js | 38 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js | 38 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js | 37 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js | 35 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js | 36 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js | 34 +++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js | 39 ++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js | 40 +++++++++++++ .../15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js | 37 ++++++++++++ .../ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js | 36 +++++++++++ tools/packaging/packagerConfig.py | 2 - 397 files changed, 13503 insertions(+), 10 deletions(-) create mode 100644 test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js create mode 100644 test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js create mode 100644 test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js create mode 100644 test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js create mode 100644 test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js create mode 100644 test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js create mode 100644 test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js create mode 100644 test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js create mode 100644 test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js create mode 100644 test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js create mode 100644 test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js create mode 100644 test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js create mode 100644 test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js create mode 100644 test/suite/ch10/10.6/10.6-13-a-2.js create mode 100644 test/suite/ch10/10.6/10.6-13-a-3.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js create mode 100644 test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js create mode 100644 test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js create mode 100644 test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js create mode 100644 test/suite/ch13/13.2/13.2-10-s.js create mode 100644 test/suite/ch13/13.2/13.2-11-s.js create mode 100644 test/suite/ch13/13.2/13.2-12-s.js create mode 100644 test/suite/ch13/13.2/13.2-13-s.js create mode 100644 test/suite/ch13/13.2/13.2-14-s.js create mode 100644 test/suite/ch13/13.2/13.2-15-s.js create mode 100644 test/suite/ch13/13.2/13.2-16-s.js create mode 100644 test/suite/ch13/13.2/13.2-17-s.js create mode 100644 test/suite/ch13/13.2/13.2-18-s.js create mode 100644 test/suite/ch13/13.2/13.2-19-b-3gs.js create mode 100644 test/suite/ch13/13.2/13.2-19-s.js create mode 100644 test/suite/ch13/13.2/13.2-20-s.js create mode 100644 test/suite/ch13/13.2/13.2-21-s.js create mode 100644 test/suite/ch13/13.2/13.2-22-s.js create mode 100644 test/suite/ch13/13.2/13.2-23-s.js create mode 100644 test/suite/ch13/13.2/13.2-24-s.js create mode 100644 test/suite/ch13/13.2/13.2-25-s.js create mode 100644 test/suite/ch13/13.2/13.2-26-s.js create mode 100644 test/suite/ch13/13.2/13.2-27-s.js create mode 100644 test/suite/ch13/13.2/13.2-28-s.js create mode 100644 test/suite/ch13/13.2/13.2-29-s.js create mode 100644 test/suite/ch13/13.2/13.2-30-s.js create mode 100644 test/suite/ch13/13.2/13.2-31-s.js create mode 100644 test/suite/ch13/13.2/13.2-32-s.js create mode 100644 test/suite/ch13/13.2/13.2-33-s.js create mode 100644 test/suite/ch13/13.2/13.2-34-s.js create mode 100644 test/suite/ch13/13.2/13.2-35-s.js create mode 100644 test/suite/ch13/13.2/13.2-36-s.js create mode 100644 test/suite/ch13/13.2/13.2-6-s.js create mode 100644 test/suite/ch13/13.2/13.2-9-s.js rename test/suite/ch15/15.10/15.10.4/{ => 15.10.4.1}/15.10.4.1-1.js (95%) rename test/suite/ch15/15.10/15.10.4/{ => 15.10.4.1}/15.10.4.1-2.js (95%) rename test/suite/ch15/15.10/15.10.4/{ => 15.10.4.1}/15.10.4.1-3.js (95%) rename test/suite/ch15/15.10/15.10.4/{ => 15.10.4.1}/15.10.4.1-4.js (95%) create mode 100644 test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js create mode 100644 test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js create mode 100644 test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js create mode 100644 test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js create mode 100644 test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js diff --git a/test/harness/helper.js b/test/harness/helper.js index 1d4737657e..51cabcffbc 100644 --- a/test/harness/helper.js +++ b/test/harness/helper.js @@ -18,7 +18,6 @@ /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - /* Handles updating the page with information from the runner. */ function Presenter() { var altStyle = '', @@ -240,7 +239,6 @@ function Presenter() { function logResult(test) { var appendStr = ""; altStyle = (altStyle !== ' ') ? ' ' : 'alternate'; - if (test.result==="fail") { appendStr += '<tbody>'; appendStr += '<tr class=\"' + altStyle + '\">'; diff --git a/test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js b/test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js new file mode 100644 index 0000000000..6321f07711 --- /dev/null +++ b/test/suite/ch07/7.8/7.8.3/7.8.3-2gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch07/7.8/7.8.3/7.8.3-2gs.js + * @description Strict Mode - octal extension is forbidden in strict mode (after a hex number is assigned to a variable) + * @onlyStrict + * @negative ^((?!NotEarlyError).)*$ + */ + +"use strict"; +throw NotEarlyError; +var a; +a = 0x1; +a = 01; diff --git a/test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js b/test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js new file mode 100644 index 0000000000..d6a9374e10 --- /dev/null +++ b/test/suite/ch07/7.8/7.8.3/7.8.3-3gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch07/7.8/7.8.3/7.8.3-3gs.js + * @description Strict Mode - octal extension is forbidden in strict mode (after a hex number is assigned to a variable from an eval) + * @onlyStrict + * @negative SyntaxError + */ + +"use strict"; +var a; +eval("a = 0x1;a = 01;"); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js new file mode 100644 index 0000000000..03a96c7b3d --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_1.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_1.js + * @description Properties - [[HasOwnProperty]] (property does not exist) + */ + +function testcase() { + + var o = {}; + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js new file mode 100644 index 0000000000..bf09529a3b --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_10.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_10.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js new file mode 100644 index 0000000000..6ce87a2257 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_11.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_11.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js new file mode 100644 index 0000000000..0eeea18819 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_12.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_12.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js new file mode 100644 index 0000000000..cd77b0eb86 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_13.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_13.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js new file mode 100644 index 0000000000..1d9e38509c --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_14.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_14.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js new file mode 100644 index 0000000000..80c731b57d --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_15.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_15.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js new file mode 100644 index 0000000000..384279c4c3 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_16.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_16.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, configurable:true, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js new file mode 100644 index 0000000000..6923ed3a3d --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_17.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_17.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js new file mode 100644 index 0000000000..42d397b48a --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_18.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_18.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, non-enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js new file mode 100644 index 0000000000..e2cdb8a6b5 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_19.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_19.js + * @description Properties - [[HasOwnProperty]] (writable, configurable, enumerable inherited value property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {value: 42, writable:true, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js new file mode 100644 index 0000000000..ec0d3a4cf5 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_2.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_2.js + * @description Properties - [[HasOwnProperty]] (old style own property) + */ + +function testcase() { + + var o = {foo: 42}; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js new file mode 100644 index 0000000000..41644bd4af --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_20.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_20.js + * @description Properties - [[HasOwnProperty]] (literal own getter property) + */ + +function testcase() { + + var o = { get foo() { return 42;} }; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js new file mode 100644 index 0000000000..c1bf3f4a33 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_21.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_21.js + * @description Properties - [[HasOwnProperty]] (literal own setter property) + */ + +function testcase() { + + var o = { set foo(x) {;} }; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js new file mode 100644 index 0000000000..935b9c02e7 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_22.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_22.js + * @description Properties - [[HasOwnProperty]] (literal own getter/setter property) + */ + +function testcase() { + + var o = { get foo() { return 42;}, set foo(x) {;} }; + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js new file mode 100644 index 0000000000..85e0ca90a2 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_23.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_23.js + * @description Properties - [[HasOwnProperty]] (literal inherited getter property) + */ + +function testcase() { + + var base = { get foo() { return 42;} }; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js new file mode 100644 index 0000000000..1fc9c54675 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_24.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_24.js + * @description Properties - [[HasOwnProperty]] (literal inherited setter property) + */ + +function testcase() { + + var base = { set foo(x) {;} }; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js new file mode 100644 index 0000000000..13f7b8b574 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_25.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_25.js + * @description Properties - [[HasOwnProperty]] (literal inherited getter/setter property) + */ + +function testcase() { + + var base = { get foo() { return 42;}, set foo(x) {;} }; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js new file mode 100644 index 0000000000..c7aca32dba --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_26.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_26.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js new file mode 100644 index 0000000000..993d7815b3 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_27.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_27.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js new file mode 100644 index 0000000000..b367977905 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_28.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_28.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js new file mode 100644 index 0000000000..80290bc85a --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_29.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_29.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable own getter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js new file mode 100644 index 0000000000..f117b40639 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_3.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_3.js + * @description Properties - [[HasOwnProperty]] (old style inherited property) + */ + +function testcase() { + + var base = {foo:42}; + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js new file mode 100644 index 0000000000..e2b98dc4af --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_30.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_30.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js new file mode 100644 index 0000000000..9cbb0031ba --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_31.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_31.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js new file mode 100644 index 0000000000..c7458072d3 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_32.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_32.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js new file mode 100644 index 0000000000..90f5e8c4f3 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_33.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_33.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable own setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {set: function() {;}, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js new file mode 100644 index 0000000000..17ca1f1ec9 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_34.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_34.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js new file mode 100644 index 0000000000..f90197d76c --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_35.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_35.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js new file mode 100644 index 0000000000..5db786b2f8 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_36.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_36.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js new file mode 100644 index 0000000000..a224d7a83e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_37.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_37.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable own getter/setter property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js new file mode 100644 index 0000000000..34cbe041d3 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_38.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_38.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js new file mode 100644 index 0000000000..a4cf5c0808 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_39.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_39.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js new file mode 100644 index 0000000000..1e29909c4e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_4.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_4.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js new file mode 100644 index 0000000000..ab06b04adf --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_40.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_40.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js new file mode 100644 index 0000000000..1c960b3eac --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_41.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_41.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited getter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js new file mode 100644 index 0000000000..eb38bab046 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_42.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_42.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js new file mode 100644 index 0000000000..b6b74fdda3 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_43.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_43.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js new file mode 100644 index 0000000000..9ec5af0d8a --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_44.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_44.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js new file mode 100644 index 0000000000..cd827375b0 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_45.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_45.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {set: function() {;}, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js new file mode 100644 index 0000000000..3092081009 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_46.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_46.js + * @description Properties - [[HasOwnProperty]] (non-configurable, non-enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js new file mode 100644 index 0000000000..4f7c57f69a --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_47.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_47.js + * @description Properties - [[HasOwnProperty]] (non-configurable, enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js new file mode 100644 index 0000000000..4c40a22399 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_48.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_48.js + * @description Properties - [[HasOwnProperty]] (configurable, non-enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js new file mode 100644 index 0000000000..49831acd4d --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_49.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_49.js + * @description Properties - [[HasOwnProperty]] (configurable, enumerable inherited getter/setter property) + */ + +function testcase() { + + var base = {}; + Object.defineProperty(base, "foo", {get: function() {return 42;}, set: function() {;}, enumerable:true, configurable:true}); + var o = Object.create(base); + return o.hasOwnProperty("foo")===false; + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js new file mode 100644 index 0000000000..9a62e84b4b --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_5.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_5.js + * @description Properties - [[HasOwnProperty]] (non-writable, non-configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js new file mode 100644 index 0000000000..3c24dce960 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_6.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_6.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, configurable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js new file mode 100644 index 0000000000..979722f1bd --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_7.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_7.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, non-enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js new file mode 100644 index 0000000000..e210386fb4 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_8.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_8.js + * @description Properties - [[HasOwnProperty]] (non-writable, configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, configurable:true, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js b/test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js new file mode 100644 index 0000000000..96a4f7066c --- /dev/null +++ b/test/suite/ch08/8.12/8.12.1/8.12.1-1_9.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.1/8.12.1-1_9.js + * @description Properties - [[HasOwnProperty]] (writable, non-configurable, enumerable own value property) + */ + +function testcase() { + + var o = {}; + Object.defineProperty(o, "foo", {value: 42, writable:true, enumerable:true}); + return o.hasOwnProperty("foo"); + +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js new file mode 100644 index 0000000000..4ac055699b --- /dev/null +++ b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_1.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.4/8.14.4-8-b_1.js + * @description Non-writable property on a prototype written to. + */ + +function testcase() { + function foo() {}; + Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); + + var o = new foo(); + o.bar = "overridden"; + return o.hasOwnProperty("bar")===false && o.bar==="unwritable"; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js new file mode 100644 index 0000000000..92504de56e --- /dev/null +++ b/test/suite/ch08/8.12/8.12.4/8.14.4-8-b_2.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.4/8.14.4-8-b_2.js + * @description Non-writable property on a prototype written to in strict mode. + * @onlyStrict + */ + +function testcase() { + "use strict"; + + function foo() {}; + Object.defineProperty(foo.prototype, "bar", {value: "unwritable"}); + + var o = new foo(); + try { + o.bar = "overridden"; + return false; + } catch(e) { + return (e instanceof TypeError) && (o.bar==="unwritable"); + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js new file mode 100644 index 0000000000..dfa48ac5d6 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_1.js @@ -0,0 +1,55 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.5/8.12.5-3-b_1.js + * @description Changing the value of a data property should not affect it's non-value property descriptor attributes. + */ + + +function testcase() { + var origReduce = Array.prototype.reduce; + var origDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); + var newDesc; + + try { + Array.prototype.reduce = function () {;}; + newDesc = Object.getOwnPropertyDescriptor(Array.prototype, "reduce"); + var descArray = [origDesc, newDesc]; + + for (var j in descArray) { //Ensure no attributes are magically added to newDesc + for (var i in descArray[j]) { + if (i==="value") { + if (origDesc[i]===newDesc[i]) { + return false; + } + } + else if (origDesc[i]!==newDesc[i]) { + return false; + } + } + } + return true; + + } finally { + Array.prototype.reduce = origReduce; + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js new file mode 100644 index 0000000000..3ff6d55243 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.5/8.12.5-3-b_2.js @@ -0,0 +1,59 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.5/8.12.5-3-b_2.js + * @description Changing the value of a data property should not affect it's non-value property descriptor attributes. + */ + + +function testcase() { + var tempObj = {}; + + Object.defineProperty(tempObj, "reduce", { value:456, enumerable:false, writable:true}); + var origReduce = tempObj.reduce; + var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + + var newDesc; + + try { + tempObj.reduce = 123; + newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + var descArray = [origDesc, newDesc]; + + for (var j in descArray) { + for (var i in descArray[j]) { + if (i==="value") { + if (origDesc[i]===newDesc[i]) { + return false; + } + } + else if (origDesc[i]!==newDesc[i]) { + return false; + } + } + } + return true; + + } finally { + tempObj.reduce = origReduce; + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js b/test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js new file mode 100644 index 0000000000..201b36982a --- /dev/null +++ b/test/suite/ch08/8.12/8.12.5/8.12.5-5-b_1.js @@ -0,0 +1,54 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.5/8.12.5-5-b_1.js + * @description Changing the value of an accessor property should not affect it's property descriptor attributes. + */ + + +function testcase() { + var tempObj = {}; + + Object.defineProperty(tempObj, "reduce", { get: function() {return 456;}, enumerable:false, set: function() {;}}); + var origReduce = tempObj.reduce; + var origDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + + var newDesc; + + try { + tempObj.reduce = 123; + newDesc = Object.getOwnPropertyDescriptor(tempObj, "reduce"); + var descArray = [origDesc, newDesc]; + + for (var j in descArray) { + for (var i in descArray[j]) { + if (origDesc[i]!==newDesc[i]) { + return false; + } + } + } + return tempObj.reduce===456; + + } finally { + tempObj.reduce = origReduce; + } +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js new file mode 100644 index 0000000000..6d44900de0 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-b-i_1.js + * @description Redefine a configurable data property to be an accessor property on a newly non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { value: "hello", + configurable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", { get: function() { return 5;} }); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo===5 && fooDescrip.get!==undefined && fooDescrip.set===undefined && fooDescrip.value===undefined && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===undefined; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js new file mode 100644 index 0000000000..1b8b48e7dc --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-b-i_2.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-b-i_2.js + * @description Redefine a configurable data property to be an accessor property on a newly non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { value: "hello", + configurable: true, + enumerable: true, + writable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", { get: function() { return 5;} }); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo===5 && fooDescrip.get!==undefined && fooDescrip.set===undefined && fooDescrip.value===undefined && fooDescrip.configurable===true && fooDescrip.enumerable===true && fooDescrip.writable===undefined; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js new file mode 100644 index 0000000000..2af95327e0 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_1.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-c-i_1.js + * @description Redefine a configurable accessor property to be a data property on a non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { get: function() { return 5;}, + configurable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", { value: "hello"}); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo==="hello" && fooDescrip.get===undefined && fooDescrip.set===undefined && fooDescrip.value==="hello" && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===false; +} +runTestCase(testcase); diff --git a/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js new file mode 100644 index 0000000000..c2b7d5c2f7 --- /dev/null +++ b/test/suite/ch08/8.12/8.12.9/8.12.9-9-c-i_2.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch08/8.12/8.12.9/8.12.9-9-c-i_2.js + * @description Redefine a configurable accessor property to be a data property on a non-extensible object + */ + + +function testcase() { + var o = {}; + Object.defineProperty(o, "foo", + { get: function() { return 5;}, + configurable: true}); + Object.preventExtensions(o); + Object.defineProperty(o, "foo", + { value: "hello", + writable: true}); + + var fooDescrip = Object.getOwnPropertyDescriptor(o, "foo"); + return o.foo==="hello" && fooDescrip.get===undefined && fooDescrip.set===undefined && fooDescrip.value==="hello" && fooDescrip.configurable===true && fooDescrip.enumerable===false && fooDescrip.writable===true; +} +runTestCase(testcase); diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js new file mode 100644 index 0000000000..f7a2543d20 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-10-s.js + * @description Strict Mode - checking 'this' (FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = function () { + "use strict"; + return typeof this; +} +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js new file mode 100644 index 0000000000..03565a398a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-100-s.js + * @description Strict Mode - checking 'this' (strict function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ + +function testcase() { +var x = 3; + +function f() { + "use strict"; + x = this; + return "a"; +} +return ("ab".replace("b", f)==="aa") && (x===undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js new file mode 100644 index 0000000000..bbdc53d483 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-100gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-100gs.js + * @description Strict Mode - checking 'this' (strict function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ +var x = 3; + +function f() { + "use strict"; + x = this; + return "a"; +} +if (("ab".replace("b", f)!=="aa") || (x!==undefined)) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js new file mode 100644 index 0000000000..761faefaf4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-101-s.js + * @description Strict Mode - checking 'this' (non-strict function passed as arg to String.prototype.replace from strict context) + * @onlyStrict + */ + +function testcase() { +var x = 3; + +function f() { + x = this; + return "a"; +} + +return (function() {"use strict"; return "ab".replace("b", f)==="aa";}()) && (x===fnGlobalObject()); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js new file mode 100644 index 0000000000..6abb89c361 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-101gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-101gs.js + * @description Strict Mode - checking 'this' (non-strict function passed as arg to String.prototype.replace from strict context) + * @onlyStrict + */ +var x = 3; + +function f() { + x = this; + return "a"; +} + +if ( (!(function() {"use strict"; return "ab".replace("b", f)==="aa";}())) || (x!==fnGlobalObject())) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js new file mode 100644 index 0000000000..cc8fc6870e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-102-s.js + * @description Strict Mode - checking 'this' (strict anonymous function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ + +function testcase() { +var x = 3; + +return ("ab".replace("b", (function () { + "use strict"; + return function () { + x = this; + return "a"; + } + })())==="aa") && (x===undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js new file mode 100644 index 0000000000..d049c76ca2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-102gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-102gs.js + * @description Strict Mode - checking 'this' (strict anonymous function passed as arg to String.prototype.replace from non-strict context) + * @onlyStrict + */ +var x = 3; +if ( ("ab".replace("b", (function () { + "use strict"; + return function () { + x = this; + return "a"; + } + })())!=="aa") || (x!==undefined)) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js new file mode 100644 index 0000000000..e89c04fefa --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-10gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-10gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +var f = function () { + "use strict"; + return typeof this; +} +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js new file mode 100644 index 0000000000..f00a5c11d7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-11-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + return typeof this; +})() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js new file mode 100644 index 0000000000..4dac505a59 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-11gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-11gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +if ((function () { + return typeof this; +})() !== "undefined") { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js new file mode 100644 index 0000000000..8299e2f6ca --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-12-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + return typeof this; +})() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js new file mode 100644 index 0000000000..8805ce54e1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-12gs.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-12gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +if ((function () { + "use strict"; + return typeof this; +})() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js new file mode 100644 index 0000000000..b649a10a3e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-13-s.js + * @description Strict Mode - checking 'this' (Function constructor defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = Function("return typeof this;"); +return f() !== "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js new file mode 100644 index 0000000000..b450813292 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-13gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-13gs.js + * @description Strict - checking 'this' from a global scope (Function constructor defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = Function("return typeof this;"); +if (f() === "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js new file mode 100644 index 0000000000..cac94e3da0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-14-s.js + * @description Strict Mode - checking 'this' (Function constructor includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = Function("\"use strict\";\nreturn typeof this;"); +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js new file mode 100644 index 0000000000..1a7d26e0c2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-14gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-14gs.js + * @description Strict - checking 'this' from a global scope (Function constructor includes strict directive prologue) + * @onlyStrict + */ + +var f = Function("\"use strict\";\nreturn typeof this;"); +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js new file mode 100644 index 0000000000..f4e079244a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-15-s.js + * @description Strict Mode - checking 'this' (New'ed Function constructor defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = new Function("return typeof this;"); +return f() !== "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js new file mode 100644 index 0000000000..6f2b195cbf --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-15gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-15gs.js + * @description Strict - checking 'this' from a global scope (New'ed Function constructor defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = new Function("return typeof this;"); +if (f() === "undefined") { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js new file mode 100644 index 0000000000..14f164d71f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-16-s.js + * @description Strict Mode - checking 'this' (New'ed Function constructor includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = new Function("\"use strict\";\nreturn typeof this;"); +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js new file mode 100644 index 0000000000..0cb39f63f3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-16gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-16gs.js + * @description Strict - checking 'this' from a global scope (New'ed Function constructor includes strict directive prologue) + * @onlyStrict + */ + +var f = new Function("\"use strict\";\nreturn typeof this;"); +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js new file mode 100644 index 0000000000..646bab4fd7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-17-s.js + * @description Strict Mode - checking 'this' (eval used within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (eval("typeof this") === "undefined") && (eval("this") !== fnGlobalObject()); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js new file mode 100644 index 0000000000..3bdefd51f5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-17gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-17gs.js + * @description Strict - checking 'this' from a global scope (eval used within strict mode) + * @onlyStrict + */ + +"use strict"; +if (eval("this") !== fnGlobalObject()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js new file mode 100644 index 0000000000..600f8e6751 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-19-s.js + * @description Strict Mode - checking 'this' (indirect eval used within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var my_eval = eval; +return my_eval("this") === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js new file mode 100644 index 0000000000..e919eb8621 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-19gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-19gs.js + * @description Strict - checking 'this' from a global scope (indirect eval used within strict mode) + * @onlyStrict + */ + +"use strict"; +var my_eval = eval; +if (my_eval("this") !== fnGlobalObject()) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js new file mode 100644 index 0000000000..84d9131d9a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-20-s.js + * @description Strict Mode - checking 'this' (indirect eval includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var my_eval = eval; +return my_eval("\"use strict\";\nthis") === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js new file mode 100644 index 0000000000..be9d69eb99 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-20gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-20gs.js + * @description Strict - checking 'this' from a global scope (indirect eval includes strict directive prologue) + * @onlyStrict + */ + +var my_eval = eval; +if (my_eval("\"use strict\";\nthis") !== fnGlobalObject() ) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js new file mode 100644 index 0000000000..c05c9e3319 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-21-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionDeclaration defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f() { + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js new file mode 100644 index 0000000000..93f20d7dbe --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-21gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-21gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionDeclaration defined within strict mode) + * @onlyStrict + */ + +"use strict"; +function f() { + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js new file mode 100644 index 0000000000..3c6f001515 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-22-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionDeclaration includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f() { + "use strict"; + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); + +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js new file mode 100644 index 0000000000..a7df22eef2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-22gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-22gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionDeclaration includes strict directive prologue) + * @onlyStrict + */ + +function f() { + "use strict"; + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js new file mode 100644 index 0000000000..e7b2467dea --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-23-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = function () { + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); + +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js new file mode 100644 index 0000000000..52857ff379 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-23gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-23gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = function () { + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js new file mode 100644 index 0000000000..45161b7f2a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-24-s.js + * @description Strict Mode - checking 'this' (New'ed object from FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f = function () { + "use strict"; + return this; +} +return ( (new f())!==fnGlobalObject()) && (typeof (new f()) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js new file mode 100644 index 0000000000..8a658ce9b5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-24gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-24gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +var f = function () { + "use strict"; + return this; +} +if (((new f()) === fnGlobalObject()) || (typeof (new f()) === "undefined")) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js new file mode 100644 index 0000000000..c5fa5bd79e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-25-s.js + * @description Strict Mode - checking 'this' (New'ed object from Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var obj = new (function () { + return this; +}); +return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js new file mode 100644 index 0000000000..2c60ec1d4f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-25gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-25gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var obj = new (function () { + return this; +}); +if ((obj === fnGlobalObject()) || (typeof obj === "undefined")) { + throw "'this' had incorrect value!"; +} + diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js new file mode 100644 index 0000000000..a1e01aa836 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-26-s.js + * @description Strict Mode - checking 'this' (New'ed object from Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var obj = new (function () { + "use strict"; + return this; +}); +return (obj !== fnGlobalObject()) && ((typeof obj) !== "undefined"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js new file mode 100644 index 0000000000..832b1cc904 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-26gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-26gs.js + * @description Strict - checking 'this' from a global scope (New'ed object from Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + */ + +var obj = new (function () { + "use strict"; + return this; +}); +if ((obj === fnGlobalObject()) || (typeof obj === "undefined")) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js new file mode 100644 index 0000000000..d91936f824 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-27-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f1() { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js new file mode 100644 index 0000000000..086079f2de --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-27gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-27gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +"use strict"; +function f1() { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js new file mode 100644 index 0000000000..c6600b1134 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-28-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f1() { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js new file mode 100644 index 0000000000..a18f410c3a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-28gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-28gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +"use strict"; +function f1() { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js new file mode 100644 index 0000000000..315cd7da27 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-29-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +function f1() { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js new file mode 100644 index 0000000000..5c0d230233 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-29gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-29gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + */ + +"use strict"; +function f1() { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js new file mode 100644 index 0000000000..d5baf6e00a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-30-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f1 = function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js new file mode 100644 index 0000000000..984fe11e32 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-30gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-30gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +var f1 = function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js new file mode 100644 index 0000000000..05ebcb53ea --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-31-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f1 = function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js new file mode 100644 index 0000000000..54813afb86 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-31gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-31gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +var f1 = function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js new file mode 100644 index 0000000000..cc7d6ef19a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-32-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f1 = function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js new file mode 100644 index 0000000000..e3bf2212ef --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-32gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-32gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +var f1 = function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js new file mode 100644 index 0000000000..1a95f8c95f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-33-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js new file mode 100644 index 0000000000..5b906db36b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-33gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-33gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +if (! ((function () { + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js new file mode 100644 index 0000000000..f6ff5cfd88 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-34-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js new file mode 100644 index 0000000000..e807a3d1d7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-34gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-34gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +if (! ((function () { + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js new file mode 100644 index 0000000000..069836d0e7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-35-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +return (function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js new file mode 100644 index 0000000000..d4d7d5c8d9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-35gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-35gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + */ + +"use strict"; +if (! ((function () { + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js new file mode 100644 index 0000000000..43326dbf27 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-36-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f1() { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js new file mode 100644 index 0000000000..9b3705148b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-36gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-36gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function f1() { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js new file mode 100644 index 0000000000..500d525524 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-37-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f1() { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js new file mode 100644 index 0000000000..4f44eba212 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-37gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-37gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function f1() { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js new file mode 100644 index 0000000000..8b08a3fde6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-38-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +function f1() { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js new file mode 100644 index 0000000000..c98e18f2dd --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-38gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-38gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + */ + +function f1() { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js new file mode 100644 index 0000000000..24e00c147b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-39-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js new file mode 100644 index 0000000000..1904849190 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-39gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-39gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +var f1 = function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js new file mode 100644 index 0000000000..375751c4b7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-40-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js new file mode 100644 index 0000000000..33d59dfe28 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-40gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-40gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +var f1 = function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js new file mode 100644 index 0000000000..94767f920e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-41-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js new file mode 100644 index 0000000000..ddbbc2023e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-41gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-41gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +var f1 = function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js new file mode 100644 index 0000000000..9de6360bdb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-42-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js new file mode 100644 index 0000000000..8d6518ae2b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-42gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-42gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +if (! ((function () { + "use strict"; + function f() { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js new file mode 100644 index 0000000000..7e1f92591b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-43-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js new file mode 100644 index 0000000000..7ac8f22df8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-43gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-43gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +if (! ((function () { + "use strict"; + var f = function () { + return typeof this; + } + return (f()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js new file mode 100644 index 0000000000..10f1961abf --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-44-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +function testcase() { +return (function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js new file mode 100644 index 0000000000..558cc3b0a1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-44gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-44gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + */ + +if (! ((function () { + "use strict"; + return ((function () { + return typeof this; + })()==="undefined") && ((typeof this)==="undefined"); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js new file mode 100644 index 0000000000..1714482188 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-45-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function testcase() { +function f1() { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js new file mode 100644 index 0000000000..6d13c6a519 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-45gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-45gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function f1() { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js new file mode 100644 index 0000000000..4013696be0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-46-s.js + * @description Strict Mode - checking 'this' (FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function testcase() { +function f1() { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js new file mode 100644 index 0000000000..c6dd780795 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-46gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-46gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function f1() { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js new file mode 100644 index 0000000000..9d90c74bc2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-47-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function testcase() { +function f1() { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js new file mode 100644 index 0000000000..10e2b1b98a --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-47gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-47gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + */ + +function f1() { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js new file mode 100644 index 0000000000..efd4647ec6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-48-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js new file mode 100644 index 0000000000..d2c91f0875 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-48gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-48gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +var f1 = function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js new file mode 100644 index 0000000000..c873730052 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49-s.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-49-s.js + * @description Strict Mode - checking 'this' (FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js new file mode 100644 index 0000000000..af7a98baf6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-49gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-49gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +var f1 = function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js new file mode 100644 index 0000000000..c1fd024481 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-50-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +function testcase() { +var f1 = function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +return f1(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js new file mode 100644 index 0000000000..cb30fbea1c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-50gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-50gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + */ + +var f1 = function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +} +if (! f1()) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js new file mode 100644 index 0000000000..9908b67cba --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-51-s.js + * @description Strict Mode - checking 'this' (FunctionDeclaration with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +function testcase() { +return (function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js new file mode 100644 index 0000000000..7024f385e1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-51gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-51gs.js + * @description Strict - checking 'this' from a global scope (FunctionDeclaration with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +if (! ((function () { + function f() { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js new file mode 100644 index 0000000000..565d5d5398 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52-s.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-52-s.js + * @description Strict Mode - checking 'this' (FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +function testcase() { +return (function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js new file mode 100644 index 0000000000..46df6d64da --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-52gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-52gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +if (! ((function () { + var f = function () { + "use strict"; + return typeof this; + } + return (f()==="undefined") && (this===fnGlobalObject()); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js new file mode 100644 index 0000000000..d7c32ee820 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-53-s.js + * @description Strict Mode - checking 'this' (Anonymous FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +function testcase() { +return (function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js new file mode 100644 index 0000000000..74620fb77b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-53gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-53gs.js + * @description Strict - checking 'this' from a global scope (Anonymous FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + */ + +if (! ((function () { + return ((function () { + "use strict"; + return typeof this; + })()==="undefined") && (this===fnGlobalObject()); +})())) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js new file mode 100644 index 0000000000..3430665548 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-54-s.js + * @description Strict Mode - checking 'this' (Literal getter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var o = { get foo() { return this; } } +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js new file mode 100644 index 0000000000..94e2fcb04c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-54gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-54gs.js + * @description Strict - checking 'this' from a global scope (Literal getter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var o = { get foo() { return this; } } +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js new file mode 100644 index 0000000000..5073720689 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-55-s.js + * @description Strict Mode - checking 'this' (Literal getter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var o = { get foo() { "use strict"; return this; } } +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js new file mode 100644 index 0000000000..669b42b71d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-55gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-55gs.js + * @description Strict - checking 'this' from a global scope (Literal getter includes strict directive prologue) + * @onlyStrict + */ + +var o = { get foo() { "use strict"; return this; } } +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js new file mode 100644 index 0000000000..f4d98309fe --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-56-s.js + * @description Strict Mode - checking 'this' (Literal setter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var x = 2; +var o = { set foo(stuff) { x=this; } } +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js new file mode 100644 index 0000000000..5e9e762ce5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-56gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-56gs.js + * @description Strict - checking 'this' from a global scope (Literal setter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var x = 2; +var o = { set foo(stuff) { x=this; } } +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js new file mode 100644 index 0000000000..1b16bd4a01 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-57-s.js + * @description Strict Mode - checking 'this' (Literal setter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var x = 2; +var o = { set foo(stuff) { "use strict"; x=this; } } +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js new file mode 100644 index 0000000000..92318154f9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-57gs.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-57gs.js + * @description Strict - checking 'this' from a global scope (Literal setter includes strict directive prologue) + * @onlyStrict + */ + +var x = 2; +var o = { set foo(stuff) { "use strict"; x=this; } } +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js new file mode 100644 index 0000000000..54ba866eb1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-58-s.js + * @description Strict Mode - checking 'this' (Injected getter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { get: function() { return this; } }); +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js new file mode 100644 index 0000000000..75cf067dd8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-58gs.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-58gs.js + * @description Strict - checking 'this' from a global scope (Injected getter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { get : function() { return this; } }); +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js new file mode 100644 index 0000000000..620a003caa --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-59-s.js + * @description Strict Mode - checking 'this' (Injected getter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var o = {}; +Object.defineProperty(o, "foo", { get: function() { "use strict"; return this; } }); +return o.foo===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js new file mode 100644 index 0000000000..7d900bdbcb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-59gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-59gs.js + * @description Strict - checking 'this' from a global scope (Injected getter includes strict directive prologue) + * @onlyStrict + */ + +var o = {}; +Object.defineProperty(o, "foo", { get: function() { "use strict"; return this; } }); +if (o.foo!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js new file mode 100644 index 0000000000..66887c15a3 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60-s.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-60-s.js + * @description Strict Mode - checking 'this' (Injected setter defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { x=this; } }); +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js new file mode 100644 index 0000000000..2698998a4c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-60gs.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-60gs.js + * @description Strict - checking 'this' from a global scope (Injected setter defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { x=this; } }); +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js new file mode 100644 index 0000000000..d1196b32a7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-61-s.js + * @description Strict Mode - checking 'this' (Injected setter includes strict directive prologue) + * @onlyStrict + */ + +function testcase() { +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { "use strict"; x=this; } }); +o.foo = 3; +return x===o; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js new file mode 100644 index 0000000000..3a58b06ff1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-61gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-61gs.js + * @description Strict - checking 'this' from a global scope (Injected setter includes strict directive prologue) + * @onlyStrict + */ + +var o = {}; +var x = 2; +Object.defineProperty(o, "foo", { set: function(stuff) { "use strict"; x=this; } }); +o.foo = 3; +if (x!==o) { + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js new file mode 100644 index 0000000000..df5f324997 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-62-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict function declaration) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +function foo() { return f();} +return foo()===undefined; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js new file mode 100644 index 0000000000..c94f0a08f2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-62gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-62gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict function declaration) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +function foo() { return f();} +if (foo()!==undefined){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js new file mode 100644 index 0000000000..70ca76a810 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-63-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict eval) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return eval("f();"); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js new file mode 100644 index 0000000000..4a3df98a89 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-63gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-63gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict eval) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! eval("f();")){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js new file mode 100644 index 0000000000..fc60bb0991 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-64-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() { "use strict"; return this===undefined;}; +return Function("return f();")(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js new file mode 100644 index 0000000000..f5de739614 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-64gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-64gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict Function constructor) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! (Function("return f();")())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js new file mode 100644 index 0000000000..b8ed883085 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-65-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by non-strict new'ed Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() { "use strict"; return this===undefined;}; +return (new Function("return f();"))(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js new file mode 100644 index 0000000000..7babdbd7c2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-65gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-65gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by non-strict new'ed Function constructor) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! ( (new Function("return f();")) () )){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js new file mode 100644 index 0000000000..d10a6fd169 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-66-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.apply(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js new file mode 100644 index 0000000000..77e7b5d0e6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-66gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-66gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.apply()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js new file mode 100644 index 0000000000..64a4269b7e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-67-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(null)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===null;}; +return f.apply(null); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js new file mode 100644 index 0000000000..c808ca5c73 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-67gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-67gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(null)) + * @onlyStrict + */ + +function f() { "use strict"; return this===null;}; +if (! f.apply(null)){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js new file mode 100644 index 0000000000..d83b04a31b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-68-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.apply(undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js new file mode 100644 index 0000000000..0106f3f9a8 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-68gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-68gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.apply(undefined)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js new file mode 100644 index 0000000000..2c011b50e1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-69-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { "use strict"; return this===o;}; +return f.apply(o); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js new file mode 100644 index 0000000000..47ed693df1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-69gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-69gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { "use strict"; return this===o;}; +if (! f.apply(o)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js new file mode 100644 index 0000000000..8b6ad9bac6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-70-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +return f.apply(fnGlobalObject()) === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js new file mode 100644 index 0000000000..17b8c5c01f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-70gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-70gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +if (f.apply(fnGlobalObject()) !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js new file mode 100644 index 0000000000..ee94f1385b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-71-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.call(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js new file mode 100644 index 0000000000..a2aab51920 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-71gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-71gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.call()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js new file mode 100644 index 0000000000..86688a310f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-72-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(null)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===null;}; +return f.call(null); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js new file mode 100644 index 0000000000..33f1b4ba48 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-72gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-72gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(null)) + * @onlyStrict + */ + +function f() { "use strict"; return this===null;}; +if (! f.call(null)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js new file mode 100644 index 0000000000..341dae71db --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-73-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.call(undefined); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js new file mode 100644 index 0000000000..f37cc43264 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-73gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-73gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(undefined)) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! f.call(undefined)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js new file mode 100644 index 0000000000..7c03a5f644 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-74-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { "use strict"; return this===o;}; +return f.call(o); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js new file mode 100644 index 0000000000..b60af0d1b6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-74gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-74gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { "use strict"; return this===o;}; +if (! f.call(o)){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js new file mode 100644 index 0000000000..68553162e0 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-75-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +return f.call(fnGlobalObject()) === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js new file mode 100644 index 0000000000..9218e1b53e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-75gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-75gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +if (f.call(fnGlobalObject()) !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js new file mode 100644 index 0000000000..fba925f2b5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-76-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind()()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.bind()(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js new file mode 100644 index 0000000000..d0fcea66a9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-76gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-76gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind()()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! (f.bind()())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js new file mode 100644 index 0000000000..6e9959ca09 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-77-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(null)()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===null;}; +return f.bind(null)(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js new file mode 100644 index 0000000000..0da430f782 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-77gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-77gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(null)()) + * @onlyStrict + */ + +function f() { "use strict"; return this===null;}; +if (! (f.bind(null)())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js new file mode 100644 index 0000000000..5bf13e1594 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-78-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this===undefined;}; +return f.bind(undefined)(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js new file mode 100644 index 0000000000..dab370f6ba --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-78gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-78gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function f() { "use strict"; return this===undefined;}; +if (! (f.bind(undefined)())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js new file mode 100644 index 0000000000..dc6e585139 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-79-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { "use strict"; return this===o;}; +return f.bind(o)(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js new file mode 100644 index 0000000000..440ef17b4c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-79gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-79gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +var o = {}; +function f() { "use strict"; return this===o;}; +if (! (f.bind(o)())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js new file mode 100644 index 0000000000..d406018ed5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-80-s.js + * @description Strict Mode - checking 'this' (strict function declaration called by Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function testcase() { +function f() { "use strict"; return this;}; +return f.bind(fnGlobalObject())() === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js new file mode 100644 index 0000000000..b19a142228 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-80gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-80gs.js + * @description Strict - checking 'this' from a global scope (strict function declaration called by Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function f() { "use strict"; return this;}; +if (f.bind(fnGlobalObject())() !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js new file mode 100644 index 0000000000..77a5e2c6a7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-81-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict function declaration) + * @onlyStrict + */ + +function testcase() { +function f() { return this!==undefined;}; +function foo() { "use strict"; return f();} +return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js new file mode 100644 index 0000000000..c4f37c6986 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-81gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-81gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict function declaration) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +function foo() { "use strict"; return f();} +if (! foo()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js new file mode 100644 index 0000000000..f14caca28b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-82-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict eval) + * @onlyStrict + */ + +function testcase() { +function f() { return this!==undefined;}; +return (function () {"use strict"; return eval("f();");})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js new file mode 100644 index 0000000000..d07bf0bad2 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-82gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-82gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict eval) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +if (! ((function () {"use strict"; return eval("f();");})()) ){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js new file mode 100644 index 0000000000..b40b8dce68 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-83-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() {return this!==undefined;}; +return (function () {return Function("\"use strict\";return f();")();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js new file mode 100644 index 0000000000..c617fba995 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-83gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-83gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function constructor) + * @onlyStrict + */ + +function f() {return this!==undefined;}; +if (! ((function () {return Function("\"use strict\";return f();")();})()) ){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js new file mode 100644 index 0000000000..bd4ad7cc3c --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-84-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict new'ed Function constructor) + * @onlyStrict + */ + +function testcase() { +fnGlobalObject().f = function() { return this!==undefined;}; +return (function () {return new Function("\"use strict\";return f();")();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js new file mode 100644 index 0000000000..9a3d8297f5 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-84gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-84gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict new'ed Function constructor) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +if (! ((function () {return new Function("\"use strict\";return f();")();})()) ){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js new file mode 100644 index 0000000000..b337c11b7f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-85-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply()) + * @onlyStrict + */ + +function testcase() { +function f() { return this!==undefined;}; +return (function () {"use strict"; return f.apply();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js new file mode 100644 index 0000000000..c8e2810cfb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-85gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-85gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply()) + * @onlyStrict + */ + +function f() { return this!==undefined;}; +if (! ((function () {"use strict"; return f.apply();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js new file mode 100644 index 0000000000..2002e99652 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-86-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(null)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.apply(null);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js new file mode 100644 index 0000000000..b8b914e6c4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-86gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-86gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(null)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.apply(null);})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js new file mode 100644 index 0000000000..08c7912cdb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-87-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject()}; +return (function () {"use strict"; return f.apply(undefined);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js new file mode 100644 index 0000000000..058e0a1984 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-87gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-87gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(undefined)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.apply(undefined);})())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js new file mode 100644 index 0000000000..a014147428 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-88-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { return this===o;}; +return (function () {"use strict"; return f.apply(o);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js new file mode 100644 index 0000000000..01db70049b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-88gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-88gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { return this===o;}; +if (! ((function () {"use strict"; return f.apply(o);})())){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js new file mode 100644 index 0000000000..5b48014a89 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-89-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { return this;}; +return (function () {"use strict"; return f.apply(fnGlobalObject()); })() === fnGlobalObject(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js new file mode 100644 index 0000000000..e1317c9752 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-89gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-89gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.apply(globalObject)) + * @onlyStrict + */ + +function f() { return this;}; +if ((function () {"use strict"; return f.apply(fnGlobalObject());})() !== fnGlobalObject()){ + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js new file mode 100644 index 0000000000..b692ad1878 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9-s.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-9-s.js + * @description Strict Mode - checking 'this' (FunctionExpression defined within strict mode) + * @onlyStrict + */ + +function testcase() { +"use strict"; +var f = function () { + return typeof this; +} +return f() === "undefined"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js new file mode 100644 index 0000000000..77d6cc8ff1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-90-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js new file mode 100644 index 0000000000..48a8fff6c4 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-90gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-90gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js new file mode 100644 index 0000000000..7c2d4d9139 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-91-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(null)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(null); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js new file mode 100644 index 0000000000..fbcb7e186e --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-91gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-91gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(null)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call(null); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js new file mode 100644 index 0000000000..2e65d20cf9 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-92-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(undefined)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(undefined);})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js new file mode 100644 index 0000000000..c9625b34d7 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-92gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-92gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(undefined)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call(undefined);})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js new file mode 100644 index 0000000000..f055e795c1 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-93-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(someObject)) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { return this===o;}; +return (function () {"use strict"; return f.call(o); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js new file mode 100644 index 0000000000..3f05fadbeb --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-93gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-93gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(someObject)) + * @onlyStrict + */ + +var o = {}; +function f() { return this===o;}; +if (! ((function () {"use strict"; return f.call(o); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js new file mode 100644 index 0000000000..5f8f96b25b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-94-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.call(fnGlobalObject());})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js new file mode 100644 index 0000000000..f8ddd4113f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-94gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-94gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.call(globalObject)) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.call(fnGlobalObject());})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js new file mode 100644 index 0000000000..8355cce22d --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-95-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind()()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind()(); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js new file mode 100644 index 0000000000..5d5fe280ad --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-95gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-95gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind()()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind()(); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js new file mode 100644 index 0000000000..01cad66504 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-96-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(null)()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind(null)(); })(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js new file mode 100644 index 0000000000..8a95144e94 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-96gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-96gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(null)()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind(null)(); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js new file mode 100644 index 0000000000..b7daed4895 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-97-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind(undefined)();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js new file mode 100644 index 0000000000..2133adf185 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-97gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-97gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(undefined)()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind(undefined)(); })())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js new file mode 100644 index 0000000000..e4a05ff50b --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98-s.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-98-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +function testcase() { +var o = {}; +function f() { return this===o;}; +return (function () {"use strict"; return f.bind(o)();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js new file mode 100644 index 0000000000..9de8ece668 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-98gs.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-98gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(someObject)()) + * @onlyStrict + */ + +var o = {}; +function f() { return this===o;}; +if (! ((function () {"use strict"; return f.bind(o)();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js new file mode 100644 index 0000000000..2e64fc80e6 --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99-s.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.4/10.4.3/10.4.3-1-99-s.js + * @description Strict Mode - checking 'this' (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function testcase() { +function f() { return this===fnGlobalObject();}; +return (function () {"use strict"; return f.bind(fnGlobalObject())();})(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js new file mode 100644 index 0000000000..feb7e6f57f --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-99gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-99gs.js + * @description Strict - checking 'this' from a global scope (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + +function f() { return this===fnGlobalObject();}; +if (! ((function () {"use strict"; return f.bind(fnGlobalObject())();})())){ + throw "'this' had incorrect value!"; +} diff --git a/test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js new file mode 100644 index 0000000000..d9422091dc --- /dev/null +++ b/test/suite/ch10/10.4/10.4.3/10.4.3-1-9gs.js @@ -0,0 +1,32 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch10/10.4/10.4.3/10.4.3-1-9gs.js + * @description Strict - checking 'this' from a global scope (FunctionExpression defined within strict mode) + * @onlyStrict + */ + +"use strict"; +var f = function () { + return typeof this; +} +if (f() !== "undefined") { + throw "'this' had incorrect value!"; +} \ No newline at end of file diff --git a/test/suite/ch10/10.6/10.6-13-a-2.js b/test/suite/ch10/10.6/10.6-13-a-2.js new file mode 100644 index 0000000000..4364527cc7 --- /dev/null +++ b/test/suite/ch10/10.6/10.6-13-a-2.js @@ -0,0 +1,46 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.6/10.6-13-a-2.js + * @description A direct call to arguments.callee.caller should work + */ + + +function testcase() { + var called = false; + + function test1(flag) { + if (flag!==true) { + test2(); + } else { + called = true; + } + } + + function test2() { + arguments.callee.caller(true); + } + + test1(); + return called; +} + +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch10/10.6/10.6-13-a-3.js b/test/suite/ch10/10.6/10.6-13-a-3.js new file mode 100644 index 0000000000..c00234b5b2 --- /dev/null +++ b/test/suite/ch10/10.6/10.6-13-a-3.js @@ -0,0 +1,47 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch10/10.6/10.6-13-a-3.js + * @description An indirect call to arguments.callee.caller should work + */ + + +function testcase() { + var called = false; + + function test1(flag) { + if (flag!==true) { + test2(); + } else { + called = true; + } + } + + function test2() { + var explicit = arguments.callee.caller; + explicit(true); + } + + test1(); + return called; +} + +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js new file mode 100644 index 0000000000..42d037e074 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_1.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_1.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (FunctionDeclaration) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + try { + o.bar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js new file mode 100644 index 0000000000..ef5e3d317a --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_2.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_2.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (FunctionExpression) + */ + + +function testcase() { + var fooCalled = false; + var foo = function (){ fooCalled = true; } + + var o = { }; + try { + o.bar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js new file mode 100644 index 0000000000..79f71a4e19 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_3.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_3.js + * @description Call arguments are not evaluated before the check is made to see if the object is actually callable (undefined member) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + try { + o.bar.gar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===false); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js new file mode 100644 index 0000000000..423200d2d8 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_4.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_4.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (property) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, + set: function(x) {this.barSetter = true; }}); + try { + o.bar( foo() ); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true) && (o.barGetter===true) && (o.barSetter===undefined); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js new file mode 100644 index 0000000000..a850a1dbbd --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_5.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_5.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (eval'ed) + */ + + +function testcase() { + var fooCalled = false; + function foo(){ fooCalled = true; } + + var o = { }; + try { + eval("o.bar( foo() );"); + throw new Exception("o.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js new file mode 100644 index 0000000000..5abd045c09 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_6.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_6.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (getter called) + */ + + +function testcase() { + var o = { }; + Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, + set: function(x) {this.barSetter = true; }}); + try { + o.foo( o.bar ); + throw new Exception("o.foo does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js new file mode 100644 index 0000000000..a201b8d070 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_7.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_7.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (getter called as indexed property) + */ + + +function testcase() { + var o = { }; + Object.defineProperty(o, "bar", {get: function() {this.barGetter = true; return 42;}, + set: function(x) {this.barSetter = true; }}); + try { + o.foo( o["bar"] ); + throw new Exception("o.foo does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (o.barGetter===true) && (o.barSetter===undefined); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js b/test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js new file mode 100644 index 0000000000..5e63653fd1 --- /dev/null +++ b/test/suite/ch11/11.2/11.2.3/11.2.3-3_8.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.2/11.2.3/11.2.3-3_8.js + * @description Call arguments are evaluated before the check is made to see if the object is actually callable (global object) + */ + + +function testcase() { + if (this!==fnGlobalObject()) { + return; + } + + var fooCalled = false; + function foo(){ fooCalled = true; } + + try { + this.bar( foo() ); + throw new Exception("this.bar does not exist!"); + } catch(e) { + return (e instanceof TypeError) && (fooCalled===true); + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-s.js new file mode 100644 index 0000000000..4b6f0d176c --- /dev/null +++ b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-27-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. + +/** + * @path ch11/11.4/11.4.1/11.4.1-5-a-27-s.js + * @description Strict Mode - TypeError is thrown after deleting a property, calling preventExtensions, and attempting to reassign the property + * @onlyStrict + */ + + +function testcase() { + "use strict"; + var a = {x:0, get y() { return 0;}}; + delete a.x; + Object.preventExtensions(a); + try { + a.x = 1; + return false; + } catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); diff --git a/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js new file mode 100644 index 0000000000..bb1999b3dc --- /dev/null +++ b/test/suite/ch11/11.4/11.4.1/11.4.1-5-a-28-s.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch11/11.4/11.4.1/11.4.1-5-a-28-s.js + * @description Strict Mode - TypeError is thrown when deleting RegExp.length + * @onlyStrict + */ + + +function testcase() { + "use strict"; + var a = new RegExp(); + try { + var b = delete RegExp.length; + return false; + } catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); diff --git a/test/suite/ch13/13.0/13_4-17gs.js b/test/suite/ch13/13.0/13_4-17gs.js index 2d82271719..af52092138 100644 --- a/test/suite/ch13/13.0/13_4-17gs.js +++ b/test/suite/ch13/13.0/13_4-17gs.js @@ -1,4 +1,4 @@ -/// Copyright (c) 2011 Microsoft Corporation +/// Copyright (c) 2012 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: @@ -18,6 +18,7 @@ /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + /** * @path ch13/13.0/13_4-17gs.js * @description Strict Mode - SourceElements is evaluated as strict mode code when a Function constructor is contained in strict mode code diff --git a/test/suite/ch13/13.0/13_4-5gs.js b/test/suite/ch13/13.0/13_4-5gs.js index e648c35b6b..46a2c34a34 100644 --- a/test/suite/ch13/13.0/13_4-5gs.js +++ b/test/suite/ch13/13.0/13_4-5gs.js @@ -1,4 +1,4 @@ -/// Copyright (c) 2011 Microsoft Corporation +/// Copyright (c) 2012 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: @@ -18,6 +18,7 @@ /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + /** * @path ch13/13.0/13_4-5gs.js * @description Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration is contained in strict mode code diff --git a/test/suite/ch13/13.2/13.2-10-s.js b/test/suite/ch13/13.2/13.2-10-s.js new file mode 100644 index 0000000000..8b8ffae9b9 --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-10-s.js + * @description StrictMode - writing a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + foo.caller = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-11-s.js b/test/suite/ch13/13.2/13.2-11-s.js new file mode 100644 index 0000000000..6c33127ee7 --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-11-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + + for (var tempIndex in foo) { + if (tempIndex === "caller") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-12-s.js b/test/suite/ch13/13.2/13.2-12-s.js new file mode 100644 index 0000000000..8ac8d40f95 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-12-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-12-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"caller\") {return false;}}; return true;"); + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-13-s.js b/test/suite/ch13/13.2/13.2-13-s.js new file mode 100644 index 0000000000..b46625ca02 --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-13-s.js + * @description StrictMode - reading a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + try { + var temp = foo.arguments; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-14-s.js b/test/suite/ch13/13.2/13.2-14-s.js new file mode 100644 index 0000000000..cd834d8217 --- /dev/null +++ b/test/suite/ch13/13.2/13.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. + +/** + * @path ch13/13.2/13.2-14-s.js + * @description StrictMode - writing a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + try { + foo.arguments = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-15-s.js b/test/suite/ch13/13.2/13.2-15-s.js new file mode 100644 index 0000000000..d4faf9dd68 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-15-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. + +/** + * @path ch13/13.2/13.2-15-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + + for (var tempIndex in foo) { + if (tempIndex === "arguments") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-16-s.js b/test/suite/ch13/13.2/13.2-16-s.js new file mode 100644 index 0000000000..31daadd0cd --- /dev/null +++ b/test/suite/ch13/13.2/13.2-16-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-16-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"arguments\") {return false;}}; return true;"); + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-17-s.js b/test/suite/ch13/13.2/13.2-17-s.js new file mode 100644 index 0000000000..7dddaf1025 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-17-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. + +/** + * @path ch13/13.2/13.2-17-s.js + * @description StrictMode - reading a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + var temp = foo.arguments; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-18-s.js b/test/suite/ch13/13.2/13.2-18-s.js new file mode 100644 index 0000000000..7c4f27baee --- /dev/null +++ b/test/suite/ch13/13.2/13.2-18-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. + +/** + * @path ch13/13.2/13.2-18-s.js + * @description StrictMode - writing a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + foo.arguments = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-19-b-3gs.js b/test/suite/ch13/13.2/13.2-19-b-3gs.js new file mode 100644 index 0000000000..c02bc5bd3e --- /dev/null +++ b/test/suite/ch13/13.2/13.2-19-b-3gs.js @@ -0,0 +1,29 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/** + * @path ch13/13.2/13.2-19-b-3gs.js + * @description StrictMode - error is thrown when assign a value to the 'caller' property of a function object + * @onlyStrict + * @negative NotEarlyError + */ +"use strict"; +throw NotEarlyError; +function _13_2_19_b_3_gs() {} +_13_2_19_b_3_gs.caller = 1; diff --git a/test/suite/ch13/13.2/13.2-19-s.js b/test/suite/ch13/13.2/13.2-19-s.js new file mode 100644 index 0000000000..13c2343d7d --- /dev/null +++ b/test/suite/ch13/13.2/13.2-19-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. + +/** + * @path ch13/13.2/13.2-19-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + + for (var tempIndex in foo) { + if (tempIndex === "arguments") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-20-s.js b/test/suite/ch13/13.2/13.2-20-s.js new file mode 100644 index 0000000000..e7f425b8a6 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-20-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-20-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"arguments\") {return false;}}; return true;"); + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-21-s.js b/test/suite/ch13/13.2/13.2-21-s.js new file mode 100644 index 0000000000..06ab40e257 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-21-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. + +/** + * @path ch13/13.2/13.2-21-s.js + * @description StrictMode - reading a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + var temp = foo.caller; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-22-s.js b/test/suite/ch13/13.2/13.2-22-s.js new file mode 100644 index 0000000000..dbffb87850 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-22-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. + +/** + * @path ch13/13.2/13.2-22-s.js + * @description StrictMode - writing a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + foo.caller = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-23-s.js b/test/suite/ch13/13.2/13.2-23-s.js new file mode 100644 index 0000000000..c720bc8920 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-23-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. + +/** + * @path ch13/13.2/13.2-23-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + for (var tempIndex in foo) { + if (tempIndex === "caller") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-24-s.js b/test/suite/ch13/13.2/13.2-24-s.js new file mode 100644 index 0000000000..eb37d46cd5 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-24-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. + +/** + * @path ch13/13.2/13.2-24-s.js + * @description StrictMode - enumerating over a function object looking for 'caller' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () { + "use strict"; + for (var tempIndex in this) { + if (tempIndex==="caller") { + return false; + } + } + return true; + } + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-25-s.js b/test/suite/ch13/13.2/13.2-25-s.js new file mode 100644 index 0000000000..4b9ac5aca5 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-25-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. + +/** + * @path ch13/13.2/13.2-25-s.js + * @description StrictMode - reading a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + var temp = foo.arguments; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-26-s.js b/test/suite/ch13/13.2/13.2-26-s.js new file mode 100644 index 0000000000..fbe806fa6d --- /dev/null +++ b/test/suite/ch13/13.2/13.2-26-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. + +/** + * @path ch13/13.2/13.2-26-s.js + * @description StrictMode - writing a property named 'arguments' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + try { + foo.arguments = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-27-s.js b/test/suite/ch13/13.2/13.2-27-s.js new file mode 100644 index 0000000000..a30b1a63a9 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-27-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. + +/** + * @path ch13/13.2/13.2-27-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function + * @onlyStrict + */ + + + +function testcase() { + function foo () {"use strict";} + + for (var tempIndex in foo) { + if (tempIndex === "arguments") { + return false; + } + } + return true; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-28-s.js b/test/suite/ch13/13.2/13.2-28-s.js new file mode 100644 index 0000000000..501cebf62f --- /dev/null +++ b/test/suite/ch13/13.2/13.2-28-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. + +/** + * @path ch13/13.2/13.2-28-s.js + * @description StrictMode - enumerating over a function object looking for 'arguments' fails inside the function + * @onlyStrict + */ + + + +function testcase() { + function foo() { + "use strict"; + for (var tempIndex in this) { + if (tempIndex==="arguments") { + return false; + } + } + return true; + } + return foo(); +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-29-s.js b/test/suite/ch13/13.2/13.2-29-s.js new file mode 100644 index 0000000000..63c454b2b5 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-29-s.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. + +/** + * @path ch13/13.2/13.2-29-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + function foo() {"use strict";} + return ! Object.getOwnPropertyDescriptor(foo, + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-30-s.js b/test/suite/ch13/13.2/13.2-30-s.js new file mode 100644 index 0000000000..6a2b68eff1 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-30-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-30-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(Function("'use strict';"), + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-31-s.js b/test/suite/ch13/13.2/13.2-31-s.js new file mode 100644 index 0000000000..d6ccdd02cf --- /dev/null +++ b/test/suite/ch13/13.2/13.2-31-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-31-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(new Function("'use strict';"), + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-32-s.js b/test/suite/ch13/13.2/13.2-32-s.js new file mode 100644 index 0000000000..f743719e10 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-32-s.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. + +/** + * @path ch13/13.2/13.2-32-s.js + * @description StrictMode - property named 'caller' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + var funcExpr = function () { "use strict";}; + return ! Object.getOwnPropertyDescriptor(funcExpr, + "caller").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-33-s.js b/test/suite/ch13/13.2/13.2-33-s.js new file mode 100644 index 0000000000..32b7f2ff9c --- /dev/null +++ b/test/suite/ch13/13.2/13.2-33-s.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. + +/** + * @path ch13/13.2/13.2-33-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + function foo() {"use strict";} + return ! Object.getOwnPropertyDescriptor(foo, + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-34-s.js b/test/suite/ch13/13.2/13.2-34-s.js new file mode 100644 index 0000000000..53c9242c6f --- /dev/null +++ b/test/suite/ch13/13.2/13.2-34-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-34-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(Function("'use strict';"), + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-35-s.js b/test/suite/ch13/13.2/13.2-35-s.js new file mode 100644 index 0000000000..ebb765ebfc --- /dev/null +++ b/test/suite/ch13/13.2/13.2-35-s.js @@ -0,0 +1,33 @@ +/// Copyright (c) 2009 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch13/13.2/13.2-35-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + return ! Object.getOwnPropertyDescriptor(new Function("'use strict';"), + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-36-s.js b/test/suite/ch13/13.2/13.2-36-s.js new file mode 100644 index 0000000000..e14fb7c158 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-36-s.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. + +/** + * @path ch13/13.2/13.2-36-s.js + * @description StrictMode - property named 'arguments' of function objects is not configurable + * @onlyStrict + */ + + + +function testcase() { + var funcExpr = function () { "use strict";}; + return ! Object.getOwnPropertyDescriptor(funcExpr, + "arguments").configurable; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-6-s.js b/test/suite/ch13/13.2/13.2-6-s.js new file mode 100644 index 0000000000..18c8321ec9 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-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. + +/** + * @path ch13/13.2/13.2-6-s.js + * @description StrictMode - writing a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = new Function("'use strict';"); + try { + foo.caller = 41; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch13/13.2/13.2-9-s.js b/test/suite/ch13/13.2/13.2-9-s.js new file mode 100644 index 0000000000..561ded3be5 --- /dev/null +++ b/test/suite/ch13/13.2/13.2-9-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. + +/** + * @path ch13/13.2/13.2-9-s.js + * @description StrictMode - reading a property named 'caller' of function objects is not allowed outside the function + * @onlyStrict + */ + + + +function testcase() { + var foo = Function("'use strict';"); + try { + var temp = foo.caller; + return false; + } + catch (e) { + return e instanceof TypeError; + } +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-1.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-1.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js index 54874fa5bd..df5b4f537d 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-1.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-1.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-1.js * @description RegExp - the thrown error is TypeError instead of RegExpError when pattern is an object whose [[Class]] property is 'RegExp' and flags is not undefined */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-2.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-2.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js index 617da247b6..5db110bebe 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-2.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-2.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-2.js * @description RegExp - the thrown error is SyntaxError instead of RegExpError when the characters of 'P' do not have the syntactic form Pattern */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-3.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-3.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js index 1c3d43ea7f..1081b9d819 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-3.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-3.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-3.js * @description RegExp - the thrown error is SyntaxError instead of RegExpError when 'F' contains any character other than 'g', 'i', or 'm' */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1-4.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js similarity index 95% rename from test/suite/ch15/15.10/15.10.4/15.10.4.1-4.js rename to test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js index 2321f21545..c2852bf3e6 100644 --- a/test/suite/ch15/15.10/15.10.4/15.10.4.1-4.js +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js @@ -19,7 +19,7 @@ /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** - * @path ch15/15.10/15.10.4/15.10.4.1-4.js + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-4.js * @description RegExp - the SyntaxError is not thrown when flags is 'gim' */ diff --git a/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js new file mode 100644 index 0000000000..6dc5ee5083 --- /dev/null +++ b/test/suite/ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.10/15.10.4/15.10.4.1/15.10.4.1-5.js + * @description RegExp - the 'source' property of an empty RegExp should not be the empty string + */ + + +function testcase() { + var regObj = new RegExp(); + return (regObj.source!=="") && (RegExp().source!==""); +} +runTestCase(testcase); diff --git a/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js new file mode 100644 index 0000000000..a7e86df04e --- /dev/null +++ b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-1.js + * @description Object.prototype.valueOf - typeof Object.prototype.valueOf.call(true)==="object" + */ + + +function testcase() { + return (typeof Object.prototype.valueOf.call(true)) === "object"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js new file mode 100644 index 0000000000..1d4bc57ed5 --- /dev/null +++ b/test/suite/ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js @@ -0,0 +1,30 @@ +/// Copyright (c) 2011 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.2/15.2.4/15.2.4.4/15.2.4.4-2.js + * @description Object.prototype.valueOf - typeof Object.prototype.valueOf.call(false)==="object" + */ + + +function testcase() { + return (typeof Object.prototype.valueOf.call(false)) === "object"; +} +runTestCase(testcase); \ No newline at end of file diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js new file mode 100644 index 0000000000..92aad3a3db --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-10gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed Function constructor includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = new Function("\"use strict\";\nreturn gNonStrict();"); +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js new file mode 100644 index 0000000000..1e2a9b5f38 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-11gs.js + * @description Strict mode - checking access to strict function caller from strict function (eval used within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +eval("gNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js new file mode 100644 index 0000000000..765ea8b09b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-12gs.js + * @description Strict mode - checking access to non-strict function caller from non-strict function (eval includes strict directive prologue) + * @onlyStrict + */ + + +eval("\"use strict\";\ngNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js new file mode 100644 index 0000000000..f1a89c5da5 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-13gs.js + * @description Strict mode - checking access to non-strict function caller from strict function (indirect eval used within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var my_eval = eval; +my_eval("gNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js new file mode 100644 index 0000000000..55641ef964 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-14gs.js + * @description Strict mode - checking access to non-strict function caller from non-strict function (indirect eval includes strict directive prologue) + * @onlyStrict + */ + + +var my_eval = eval; +my_eval("\"use strict\";\ngNonStrict();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js new file mode 100644 index 0000000000..4d2f9e092f --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-15gs.js + * @description Strict mode - checking access to strict function caller from strict function (New'ed object from FunctionDeclaration defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f() { + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js new file mode 100644 index 0000000000..87bbf173e8 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-16gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed object from FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f() { + "use strict"; + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js new file mode 100644 index 0000000000..2cadec95d9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-17gs.js + * @description Strict mode - checking access to strict function caller from strict function (New'ed object from FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = function () { + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js new file mode 100644 index 0000000000..625f0a0d9b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-18gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed object from FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = function () { + "use strict"; + return gNonStrict(); +} +new f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js new file mode 100644 index 0000000000..5c0c352ee9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-19gs.js + * @description Strict mode - checking access to strict function caller from strict function (New'ed object from Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var obj = new (function () { + return gNonStrict(); +}); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js new file mode 100644 index 0000000000..4529d480dc --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-1gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f() { + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js new file mode 100644 index 0000000000..6646663bcc --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-20gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (New'ed object from Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var obj = new (function () { + "use strict"; + return gNonStrict(); +}); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js new file mode 100644 index 0000000000..c5c9087ef2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-21gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f1() { + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js new file mode 100644 index 0000000000..7f88bf06f4 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-22gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f1() { + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js new file mode 100644 index 0000000000..05913a8b82 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-23gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within a FunctionDeclaration inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +function f1() { + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js new file mode 100644 index 0000000000..97f8cdb6ff --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-24gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within a FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f1 = function () { + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js new file mode 100644 index 0000000000..4be80ade9c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-25gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f1 = function () { + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js new file mode 100644 index 0000000000..bd11514aa0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-26gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within a FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f1 = function () { + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js new file mode 100644 index 0000000000..5d6d61f0d2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-27gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionDeclaration defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + function f() { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js new file mode 100644 index 0000000000..202fedfec9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-28gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + var f = function () { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js new file mode 100644 index 0000000000..b3f4192ca2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-29gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within an Anonymous FunctionExpression inside strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + return (function () { + return gNonStrict(); + })(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js new file mode 100644 index 0000000000..c79deeb8f0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-2gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f() { + "use strict"; + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js new file mode 100644 index 0000000000..4f4b317dc3 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-30gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + "use strict"; + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js new file mode 100644 index 0000000000..9e3411c183 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-31gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + "use strict"; + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js new file mode 100644 index 0000000000..f5faa72a17 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-32gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression defined within a FunctionDeclaration with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + "use strict"; + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js new file mode 100644 index 0000000000..c873f43c9f --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-33gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + "use strict"; + function f() { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js new file mode 100644 index 0000000000..f99bb167cd --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-34gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + "use strict"; + var f = function () { + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js new file mode 100644 index 0000000000..93cae80d32 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-35gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression defined within a FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + "use strict"; + return (function () { + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js new file mode 100644 index 0000000000..df4a8668c6 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-36gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + function f() { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js new file mode 100644 index 0000000000..3918ac8007 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-37gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + var f = function () { + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js new file mode 100644 index 0000000000..9b0600fce5 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-38gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression defined within an Anonymous FunctionExpression with a strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + return (function () { + return gNonStrict(); + })(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js new file mode 100644 index 0000000000..157f1799af --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-39gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + function f() { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js new file mode 100644 index 0000000000..beb694ae6d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-3gs.js + * @description Strict mode - checking access to strict function caller from strict function (FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = function () { + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js new file mode 100644 index 0000000000..fcefb9e2d4 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-40gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + var f = function () { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js new file mode 100644 index 0000000000..040610cf01 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-41gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionDeclaration) + * @onlyStrict + * @negative TypeError + */ + + +function f1() { + return (function () { + "use strict"; + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js new file mode 100644 index 0000000000..8ee2a733e5 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-42gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + function f() { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js new file mode 100644 index 0000000000..cdaff2ec77 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js @@ -0,0 +1,42 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-43gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + var f = function () { + "use strict"; + return gNonStrict(); + } + return f(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js new file mode 100644 index 0000000000..84933722bf --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-44gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression with a strict directive prologue defined within a FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +var f1 = function () { + return (function () { + "use strict"; + return gNonStrict(); + })(); +} +f1(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js new file mode 100644 index 0000000000..a0cb3fc623 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-45gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionDeclaration with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + function f() { + "use strict"; + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js new file mode 100644 index 0000000000..7d1f92192c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js @@ -0,0 +1,41 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-46gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + var f = function () { + "use strict"; + return gNonStrict(); + } + return f(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js new file mode 100644 index 0000000000..8f5a79d0d9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-47gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression with a strict directive prologue defined within an Anonymous FunctionExpression) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + return (function () { + "use strict"; + return gNonStrict(); + })(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js new file mode 100644 index 0000000000..81c70afb26 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-48gs.js + * @description Strict mode - checking access to strict function caller from strict function (Literal getter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = { get foo() { return gNonStrict(); } } +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js new file mode 100644 index 0000000000..c1a8761250 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-49gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Literal getter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = { get foo() { "use strict"; return gNonStrict(); } } +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js new file mode 100644 index 0000000000..24f23b21c8 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-4gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = function () { + "use strict"; + return gNonStrict(); +} +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js new file mode 100644 index 0000000000..fff605a915 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-50gs.js + * @description Strict mode - checking access to strict function caller from strict function (Literal setter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = { set foo(stuff) { return gNonStrict(); } } +o.foo = 7; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js new file mode 100644 index 0000000000..0367a94d3d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-51gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Literal setter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = { set foo(stuff) { "use strict"; return gNonStrict(); } } +o.foo = 8; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js new file mode 100644 index 0000000000..8402204876 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-52gs.js + * @description Strict mode - checking access to strict function caller from strict function (Injected getter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { get: function() { return gNonStrict(); } }); +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js new file mode 100644 index 0000000000..3996d6b0f2 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-53gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Injected getter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = {}; +Object.defineProperty(o, "foo", { get: function() { "use strict"; return gNonStrict(); } }); +o.foo; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js new file mode 100644 index 0000000000..5960057fc0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-54gs.js + * @description Strict mode - checking access to strict function caller from strict function (Injected setter defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var o = {}; +Object.defineProperty(o, "foo", { set: function(stuff) { return gNonStrict(); } }); +o.foo = 9; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js new file mode 100644 index 0000000000..dcdd399dc7 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-55gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Injected setter includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var o = {}; +Object.defineProperty(o, "foo", { set: function(stuff) { "use strict"; return gNonStrict(); } }); +o.foo = 10; + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js new file mode 100644 index 0000000000..96ae2c2687 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-56gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict function declaration) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +function foo() { return f();} +foo(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js new file mode 100644 index 0000000000..9f5ea23cf6 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-57gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict eval) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +eval("f();"); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js new file mode 100644 index 0000000000..ba4896abac --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-58gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict Function constructor) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +Function("return f();")(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js new file mode 100644 index 0000000000..0de2f9046d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-59gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by non-strict new'ed Function constructor) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +new Function("return f();")(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js new file mode 100644 index 0000000000..a558cc3b4f --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-5gs.js + * @description Strict mode - checking access to strict function caller from strict function (Anonymous FunctionExpression defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +(function () { + return gNonStrict(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js new file mode 100644 index 0000000000..25c45d7b65 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-60gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js new file mode 100644 index 0000000000..06461a4c08 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-61gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(null)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(null); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js new file mode 100644 index 0000000000..df931b4825 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-62gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(undefined)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(undefined); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js new file mode 100644 index 0000000000..2b190192d1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-63gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(someObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +var o = {}; +f.apply(o); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js new file mode 100644 index 0000000000..1732d51146 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-64gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.apply(globalObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.apply(fnGlobalObject()); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js new file mode 100644 index 0000000000..ed6c9a656e --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-65gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js new file mode 100644 index 0000000000..b02c2e2183 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-66gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(null)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(null); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js new file mode 100644 index 0000000000..f2ab4b11f6 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-67gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(undefined)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(undefined); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js new file mode 100644 index 0000000000..3123e935b5 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-68gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(someObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +var o = {}; +f.call(o); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js new file mode 100644 index 0000000000..41e73ff48a --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-69gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.call(globalObject)) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.call(fnGlobalObject()); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js new file mode 100644 index 0000000000..0984163ec8 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js @@ -0,0 +1,38 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-6gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Anonymous FunctionExpression includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +(function () { + "use strict"; + return gNonStrict(); +})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js new file mode 100644 index 0000000000..3ba84df3c4 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-70gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind()()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind()(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js new file mode 100644 index 0000000000..50c4f8e11c --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-71gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(null)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind(null)(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js new file mode 100644 index 0000000000..e29ccca958 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-72gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(undefined)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind(undefined)(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js new file mode 100644 index 0000000000..d025892817 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-73gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(someObject)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +var o = {}; +f.bind(o)(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js new file mode 100644 index 0000000000..e59aae69f0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-74gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (strict function declaration called by Function.prototype.bind(globalObject)()) + * @onlyStrict + * @negative TypeError + */ + + +function f() { "use strict"; return gNonStrict();}; +f.bind(fnGlobalObject())(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js new file mode 100644 index 0000000000..a46e66faf7 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-75gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict function declaration) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +function foo() { "use strict"; return f();} +foo(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js new file mode 100644 index 0000000000..798370c314 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-76gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict eval) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return eval("f();"); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js new file mode 100644 index 0000000000..b18c35aed9 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-77gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function constructor) + * @onlyStrict + */ + + +function f() {return gNonStrict();}; +(function () {"use strict"; return Function("return f();")(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js new file mode 100644 index 0000000000..9ff7be956d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-78gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict new'ed Function constructor) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return new Function("return f();")(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js new file mode 100644 index 0000000000..47c5964b0b --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-79gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply();})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js new file mode 100644 index 0000000000..d5689d4614 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-7gs.js + * @description Strict mode - checking access to non-strict function caller from strict function (Function constructor defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = Function("return gNonStrict();"); +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js new file mode 100644 index 0000000000..8f175407f8 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-80gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(null)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply(null); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js new file mode 100644 index 0000000000..330591c985 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-81gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(undefined)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply(undefined); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js new file mode 100644 index 0000000000..a111de9979 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-82gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(someObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +var o = {}; +(function () {"use strict"; return f.apply(o); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js new file mode 100644 index 0000000000..488124e93d --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-83gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.apply(globalObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.apply(fnGlobalObject()); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js new file mode 100644 index 0000000000..e69f4b8a02 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-84gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call();})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js new file mode 100644 index 0000000000..b6dae55425 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-85gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(null)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call(null);})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js new file mode 100644 index 0000000000..967eefbba3 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-86gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(undefined)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call(undefined); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js new file mode 100644 index 0000000000..abfdc433ac --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-87gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(someObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +var o = {}; +(function () {"use strict"; return f.call(o); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js new file mode 100644 index 0000000000..ab8cce7382 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-88gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.call(globalObject)) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.call(fnGlobalObject()); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js new file mode 100644 index 0000000000..a12519da78 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-89gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind()()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind();})(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js new file mode 100644 index 0000000000..837dd39c16 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-8gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (Function constructor includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + + +var f = Function("\"use strict\";\nreturn gNonStrict();"); +f(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js new file mode 100644 index 0000000000..a3919e30d1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-90gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(null)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind(null)(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js new file mode 100644 index 0000000000..025eb038c0 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-91gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(undefined)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind(undefined)(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js new file mode 100644 index 0000000000..f3f838a612 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-92gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(someObject)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +var o = {}; +(function () {"use strict"; return f.bind(o)(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js new file mode 100644 index 0000000000..502489733a --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js @@ -0,0 +1,35 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-93gs.js + * @description Strict mode - checking access to strict function caller from non-strict function (non-strict function declaration called by strict Function.prototype.bind(globalObject)()) + * @onlyStrict + */ + + +function f() { return gNonStrict();}; +(function () {"use strict"; return f.bind(fnGlobalObject())(); })(); + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js new file mode 100644 index 0000000000..df880935af --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-94gs.js + * @description Strict mode - checking access to strict function caller from non-strict function expression (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var gNonStrict = function () { + return gNonStrict.caller; +} + +function f() { + "use strict"; + return gNonStrict(); +} +f(); diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js new file mode 100644 index 0000000000..cd3969a4c1 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js @@ -0,0 +1,34 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-95gs.js + * @description Strict mode - checking access to strict function caller from non-strict, constructor-based function (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var gNonStrict = Function("return gNonStrict.caller;"); + +function f() { + "use strict"; + return gNonStrict(); +} +f(); diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js new file mode 100644 index 0000000000..d63cba2d39 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-96gs.js + * @description Strict mode - checking access to strict function caller from non-strict property (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var o = { + get gNonStrict() { + return Object.getOwnPropertyDescriptor(o, "gNonStrict").get.caller; + } +}; + + +function f() { + "use strict"; + return o.gNonStrict; +} +f(); diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js new file mode 100644 index 0000000000..b26d13706e --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js @@ -0,0 +1,40 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-97gs.js + * @description Strict mode - checking access to strict function caller from bound non-strict function (FunctionDeclaration includes strict directive prologue) + * @onlyStrict + * @negative TypeError + */ + +var gNonStrict = gNonStrictBindee.bind(null); + +function f() { + "use strict"; + return gNonStrict(); +} +f(); + + +function gNonStrictBindee() { + return gNonStrictBindee.caller; +} + diff --git a/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js new file mode 100644 index 0000000000..64c6879057 --- /dev/null +++ b/test/suite/ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js @@ -0,0 +1,37 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.3/15.3.5/15.3.5.4/15.3.5.4_2-9gs.js + * @description Strict mode - checking access to non-strict function caller from strict function (New'ed Function constructor defined within strict mode) + * @onlyStrict + * @negative TypeError + */ + + +"use strict"; +var f = new Function("return gNonStrict();"); +f(); //REPLACE ME + + +function gNonStrict() { + return gNonStrict.caller; +} + diff --git a/test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js b/test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js new file mode 100644 index 0000000000..704d89102d --- /dev/null +++ b/test/suite/ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js @@ -0,0 +1,36 @@ +/// Copyright (c) 2012 Microsoft Corporation +/// +/// Redistribution and use in source and binary forms, with or without modification, are permitted provided +/// that the following conditions are met: +/// * Redistributions of source code must retain the above copyright notice, this list of conditions and +/// the following disclaimer. +/// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and +/// the following disclaimer in the documentation and/or other materials provided with the distribution. +/// * Neither the name of Microsoft nor the names of its contributors may be used to +/// endorse or promote products derived from this software without specific prior written permission. +/// +/// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +/// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +/// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +/// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +/// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +/// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +/// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +/// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * @path ch15/15.9/15.9.5/15.9.5.40/15.9.5.40_1.js + * @description Date.prototype.setFullYear - Date.prototype is itself an instance of Date + */ + + +function testcase() { + try { + var origYear = Date.prototype.getFullYear(); + Date.prototype.setFullYear(2012); + return Date.prototype.getFullYear()===2012; + } finally { + Date.prototype.setFullYear(origYear); + } +} +runTestCase(testcase); diff --git a/tools/packaging/packagerConfig.py b/tools/packaging/packagerConfig.py index d86f2792d3..37b1b009f0 100644 --- a/tools/packaging/packagerConfig.py +++ b/tools/packaging/packagerConfig.py @@ -88,11 +88,9 @@ def generateHarness(harnessType, jsonName, title): if TEMPLATE_LINES==None or harnessType!=__lastHarnessType: __lastHarnessType = harnessType TEMPLATE_LINES = [] - with open(os.path.join(os.getcwd(), "templates", "runner." + harnessType + ".html"), "r") as f: TEMPLATE_LINES = f.readlines() - fileName = os.path.join(TEST262_ROOT, WEBSITE_SHORT_NAME, jsonName.replace(".json", ".html")) fileNameExists = False -- GitLab