diff options
Diffstat (limited to 'external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator')
8 files changed, 267 insertions, 0 deletions
diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A1.js new file mode 100644 index 000000000..2642e00e6 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A1.js @@ -0,0 +1,59 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A1; +* @section: 11.4.1; +* @assertion: White Space and Line Terminator between "delete" and UnaryExpression are allowed; +* @description: Checking by using eval; +*/ + +//CHECK#1 +if (eval("delete\u00090") !== true) { + $ERROR('#1: delete\\u00090 === true'); +} + +//CHECK#2 +if (eval("delete\u000B0") !== true) { + $ERROR('#2: delete\\u000B0 === true'); +} + +//CHECK#3 +if (eval("delete\u000C0") !== true) { + $ERROR('#3: delete\\u000C0 === true'); +} + +//CHECK#4 +if (eval("delete\u00200") !== true) { + $ERROR('#4: delete\\u00200 === true'); +} + +//CHECK#5 +if (eval("delete\u00A00") !== true) { + $ERROR('#5: delete\\u00A00 === true'); +} + +//CHECK#6 +if (eval("delete\u000A0") !== true) { + $ERROR('#6: delete\\u000A0 === true'); +} + +//CHECK#7 +if (eval("delete\u000D0") !== true) { + $ERROR('#7: delete\\u000D0 === true'); +} + +//CHECK#8 +if (eval("delete\u20280") !== true) { + $ERROR('#8: delete\\u20280 === true'); +} + +//CHECK#9 +if (eval("delete\u20290") !== true) { + $ERROR('#9: delete\\u20290 === true'); +} + +//CHECK#10 +if (eval("delete\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== true) { + $ERROR('#10: delete\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290 === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.1.js new file mode 100644 index 000000000..3c960c972 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.1.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A2.1; +* @section: 11.4.1; +* @assertion: If Type(x) is not Reference, return true; +* @description: Checking primitive value and Object value cases; +*/ + +//CHECK#1 +if (delete 1 !== true) { + $ERROR('#1: delete 1 === true'); +} + +//CHECK#2 +if (delete new Object() !== true) { + $ERROR('#2: delete new Object() === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.2_T1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.2_T1.js new file mode 100644 index 000000000..79b4f2997 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.2_T1.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A2.2_T1; +* @section: 11.4.1; +* @assertion: If GetBase(x) doesn't have a property GetPropertyName(x), return true; +* @description: Checking undeclared variable case; +*/ + +//CHECK#1 +if (delete x !== true) { + $ERROR('#1: delete x === true'); +} + +//CHECK#2 +if (delete this.x !== true) { + $ERROR('#2: delete this.x === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.2_T2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.2_T2.js new file mode 100644 index 000000000..75e30cbe3 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A2.2_T2.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A2.2_T2; +* @section: 11.4.1; +* @assertion: If GetBase(x) doesn't have a property GetPropertyName(x), return true; +* @description: Checking Object object and Function object cases; +*/ + +//CHECK#1 +function MyFunction(){} +var MyObject = new MyFunction(); +if (delete MyObject.prop !== true) { + $ERROR('#1: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject.prop === true'); +} + +//CHECK#2 +var MyObject = new Object(); +if (delete MyObject.prop !== true) { + $ERROR('#2: var MyObject = new Object(); delete MyObject.prop === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.1.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.1.js new file mode 100644 index 000000000..ea3ab3753 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.1.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. + +/** +* @name: S11.4.1_A3.1; +* @section: 11.4.1; +* @assertion: If the property has the DontDelete attribute, return false; +* @description: Checking declared variable; +*/ + +//CHECK#1 +var x = 1; +if (delete x !== false) { + $ERROR('#1: var x = 1; delete x === false'); +} + +//CHECK#2 +var y = 1; +if (delete this.y !== false) { + $ERROR('#2: var y = 1; delete this.y === false'); +} + +//CHECK#3 +function MyFunction(){}; +if (delete MyFunction !== false) { + $ERROR('#3: function MyFunction(){}; delete MyFunction === false'); +} + +//CHECK#4 +function MyFunction(){}; +var MyObject = new MyFunction(); +if (delete MyObject !== false) { + $ERROR('#4: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'); +} + +//CHECK#5 +if (delete MyObject !== false) { + $ERROR('#5: function MyFunction(){}; var MyObject = new MyFunction(); delete MyObject === false'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.2.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.2.js new file mode 100644 index 000000000..16d7b94db --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.2.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A3.2; +* @section: 11.4.1; +* @assertion: If the property doesn't have the DontDelete attribute, return true; +* @description: Checking declared variable; +*/ + +//CHECK#1 +x = 1; +if (delete x !== true) { + $ERROR('#1: x = 1; delete x === true'); +} + +//CHECK#2 +function MyFunction(){}; +MyFunction.prop = 1; +if (delete MyFunction.prop !== true) { + $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop === true'); +} + +//CHECK#3 +function MyFunction(){}; +var MyObject = new MyFunction(); +MyObject.prop = 1; +if (delete MyObject.prop !== true) { + $ERROR('#3: function MyFunction(){}; var MyObject = new MyFunction(); MyFunction.prop = 1; delete MyObject.prop === true'); +} diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.3.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.3.js new file mode 100644 index 000000000..169310d5d --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A3.3.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A3.3; +* @section: 11.4.1; +* @assertion: If the property doesn't have the DontDelete attribute, remove the property; +* @description: Checking declared variable; +*/ + +//CHECK#1 +try { + x = 1; + delete x; + x; + $ERROR('#1: x = 1; delete x; x is not exist'); +} catch (e) { + if (e instanceof ReferenceError !== true) { + $ERROR('#1: x = 1; delete x; x is not exist'); + } +} + + +//CHECK#2 +function MyFunction(){}; +MyFunction.prop = 1; +delete MyFunction.prop; +if (MyFunction.prop !== undefined) { + $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop; MyFunction.prop === undefined. Actual: ' + (MyFunction.prop)); + +} + +//CHECK#3 +function MyFunction(){}; +var MyObjectVar = new MyFunction(); +MyObjectVar.prop = 1; +delete MyObjectVar.prop; +if (MyObjectVar.prop !== undefined) { + $ERROR('#3: function MyFunction(){}; var MyObjectVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectVar.prop; MyObjectVar.prop === undefined. Actual: ' + (MyObjectVar.prop)); +} + +//CHECK#4 +if (delete MyObjectVar !== false) { + $ERROR('#4: function MyFunction(){}; var MyObjectVar = new MyFunction(); delete MyObjectVar === false'); +} + +//CHECK#5 +function MyFunction(){}; +MyObjectNotVar = new MyFunction(); +MyObjectNotVar.prop = 1; +delete MyObjectNotVar.prop; +if (MyObjectNotVar.prop !== undefined) { + $ERROR('#5: function MyFunction(){}; MyObjectNotVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectNotVar.prop; MyObjectNotVar.prop === undefined. Actual: ' + (MyObjectNotVar.prop)); +} + +//CHECK#6 +if (delete MyObjectNotVar !== true) { + $ERROR('#6: function MyFunction(){}; var MyObjectNotVar = new MyFunction(); delete MyObjectNotVar === true'); +} + diff --git a/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A4.js b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A4.js new file mode 100644 index 000000000..83f5ce1d9 --- /dev/null +++ b/external/contributions/Google/sputniktests/tests/Conformance/11_Expressions/11.4_Unary_Operators/11.4.1_The_delete_Operator/S11.4.1_A4.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** +* @name: S11.4.1_A4; +* @section: 11.4.1; +* @assertion: "Delete" operator removes property, which is reference to the object, not the object; +* @description: Checking two reference by one object; +*/ + +//CHECK#1 +obj = new Object(); +ref = obj; +delete ref; +if (typeof obj !== "object") { + $ERROR('#1: obj = new Object(); ref = obj; delete ref; typeof obj === "object". Actual: ' + (typeof obj)); +} + |