summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch08/8.12/8.12.7
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/ch08/8.12/8.12.7')
-rw-r--r--js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A1.js29
-rw-r--r--js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T1.js39
-rw-r--r--js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T2.js40
-rw-r--r--js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A3.js49
-rw-r--r--js/src/tests/test262/ch08/8.12/8.12.7/browser.js0
-rw-r--r--js/src/tests/test262/ch08/8.12/8.12.7/shell.js0
6 files changed, 157 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A1.js b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A1.js
new file mode 100644
index 000000000..b6944fd48
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A1.js
@@ -0,0 +1,29 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * and If the property has the DontDelete attribute, return false
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A1.js
+ * @description Try to delete Math.E, that has the DontDelete attribute
+ * @noStrict
+ */
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete Math.E !== false){
+ $ERROR('#1: delete Math.E === false. Actual: ' + (delete Math.E));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (Math.E === undefined){
+ $ERROR('#2: delete Math.E; Math.E !== undefined');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T1.js b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T1.js
new file mode 100644
index 000000000..6c416b525
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T1.js
@@ -0,0 +1,39 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * and if O doesn't have a property with name P, return true
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A2_T1.js
+ * @description Try to delete not existent properties
+ */
+
+var __color__map = {};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete __color__map.red !== true){
+ $ERROR('#1: var __color__map = {}; delete __color__map.red === true. Actual: ' + (delete __color__map.red));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (delete __color__map["green"] !== true){
+ $ERROR('#2: var __color__map = {}; delete __color__map["green"] === true. Actual: ' + (delete __color__map["green"]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+var blue = 1;
+if (delete __color__map[blue] !== true){
+ $ERROR('#3: var __color__map = {}; var blue = 1; delete __color__map[blue] === true. Actual: ' + (delete __color__map[blue]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T2.js b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T2.js
new file mode 100644
index 000000000..e3182463a
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A2_T2.js
@@ -0,0 +1,40 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * and if O doesn't have a property with name P, return true
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A2_T2.js
+ * @description Try to delete not existent properties of O, but existent property of prototype
+ */
+
+function Palette(){};
+Palette.prototype = {red:0xFF0000, green:0x00FF00};
+var __palette = new Palette;
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (__palette.red !== 0xFF0000){
+ $ERROR('#1: function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; __palette.red === 0xFF0000. Actual: ' + (__palette.red));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (delete __palette.red !== true) {
+ $ERROR('#2 function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; delete __palette.red === true. Actual: ' + (delete __palette.red));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (__palette.red !== 0xFF0000){
+ $ERROR('#3: function Palette(){}; Palette.prototype = {red:0xFF0000, green:0x00FF00}; __palette = new Palette; __palette.red === 0xFF0000. Actual: ' + (__palette.red));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A3.js b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A3.js
new file mode 100644
index 000000000..c9abe19d9
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/S8.12.7_A3.js
@@ -0,0 +1,49 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * When the [[Delete]] method of O is called with property name P,
+ * removes the property with name P from O and return true
+ *
+ * @path ch08/8.12/8.12.7/S8.12.7_A3.js
+ * @description Delete existent properties
+ */
+
+var BLUE_NUM=1;
+var BLUE_STR="1";
+var YELLOW_NUM=2;
+var YELLOW_STR="2";
+var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00};
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#1
+if (delete __color__map[YELLOW_NUM] !== true){
+ $ERROR('#1: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[YELLOW_NUM] === true;');
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#2
+if (__color__map[YELLOW_STR] !== undefined) {
+ $ERROR('#2: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[YELLOW_NUM]; __color__map[YELLOW_STR] === undefined. Actual: ' + (__color__map[YELLOW_STR]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#3
+if (delete __color__map[BLUE_STR] !== true){
+ $ERROR('#3: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[BLUE_STR] === true. Actual: ' + (delete __color__map[BLUE_STR]));
+};
+//
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//CHECK#4
+if (__color__map[BLUE_NUM] !== undefined) {
+ $ERROR('#4: var BLUE_NUM=1; var BLUE_STR="1"; var YELLOW_NUM=2; var YELLOW_STR="2"; var __color__map = {red:0xFF0000, BLUE_NUM:0x0000FF, green:0x00FF00, YELLOW_STR:0xFFFF00}; delete __color__map[BLUE_STR]; __color__map[BLUE_NUM] === undefined. Actual: ' + (__color__map[BLUE_NUM]));
+}
+//
+//////////////////////////////////////////////////////////////////////////////
+
diff --git a/js/src/tests/test262/ch08/8.12/8.12.7/browser.js b/js/src/tests/test262/ch08/8.12/8.12.7/browser.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/browser.js
diff --git a/js/src/tests/test262/ch08/8.12/8.12.7/shell.js b/js/src/tests/test262/ch08/8.12/8.12.7/shell.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/test262/ch08/8.12/8.12.7/shell.js