Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | // Copyright 2009 the Sputnik authors. All rights reserved. |
michael@0 | 2 | // This code is governed by the BSD license found in the LICENSE file. |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * If the property doesn't have the DontDelete attribute, remove the property |
michael@0 | 6 | * |
michael@0 | 7 | * @path ch11/11.4/11.4.1/S11.4.1_A3.3.js |
michael@0 | 8 | * @description Checking declared variable |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | //CHECK#1 |
michael@0 | 12 | try { |
michael@0 | 13 | x = 1; |
michael@0 | 14 | delete x; |
michael@0 | 15 | x; |
michael@0 | 16 | $ERROR('#1: x = 1; delete x; x is not exist'); |
michael@0 | 17 | } catch (e) { |
michael@0 | 18 | if (e instanceof ReferenceError !== true) { |
michael@0 | 19 | $ERROR('#1: x = 1; delete x; x is not exist'); |
michael@0 | 20 | } |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | |
michael@0 | 24 | //CHECK#2 |
michael@0 | 25 | function MyFunction(){}; |
michael@0 | 26 | MyFunction.prop = 1; |
michael@0 | 27 | delete MyFunction.prop; |
michael@0 | 28 | if (MyFunction.prop !== undefined) { |
michael@0 | 29 | $ERROR('#2: function MyFunction(){}; MyFunction.prop = 1; delete MyFunction.prop; MyFunction.prop === undefined. Actual: ' + (MyFunction.prop)); |
michael@0 | 30 | |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | //CHECK#3 |
michael@0 | 34 | function MyFunction(){}; |
michael@0 | 35 | var MyObjectVar = new MyFunction(); |
michael@0 | 36 | MyObjectVar.prop = 1; |
michael@0 | 37 | delete MyObjectVar.prop; |
michael@0 | 38 | if (MyObjectVar.prop !== undefined) { |
michael@0 | 39 | $ERROR('#3: function MyFunction(){}; var MyObjectVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectVar.prop; MyObjectVar.prop === undefined. Actual: ' + (MyObjectVar.prop)); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | //CHECK#4 |
michael@0 | 43 | if (delete MyObjectVar !== false) { |
michael@0 | 44 | $ERROR('#4: function MyFunction(){}; var MyObjectVar = new MyFunction(); delete MyObjectVar === false'); |
michael@0 | 45 | } |
michael@0 | 46 | |
michael@0 | 47 | //CHECK#5 |
michael@0 | 48 | function MyFunction(){}; |
michael@0 | 49 | MyObjectNotVar = new MyFunction(); |
michael@0 | 50 | MyObjectNotVar.prop = 1; |
michael@0 | 51 | delete MyObjectNotVar.prop; |
michael@0 | 52 | if (MyObjectNotVar.prop !== undefined) { |
michael@0 | 53 | $ERROR('#5: function MyFunction(){}; MyObjectNotVar = new MyFunction(); MyFunction.prop = 1; delete MyObjectNotVar.prop; MyObjectNotVar.prop === undefined. Actual: ' + (MyObjectNotVar.prop)); |
michael@0 | 54 | } |
michael@0 | 55 | |
michael@0 | 56 | //CHECK#6 |
michael@0 | 57 | if (delete MyObjectNotVar !== true) { |
michael@0 | 58 | $ERROR('#6: function MyFunction(){}; var MyObjectNotVar = new MyFunction(); delete MyObjectNotVar === true'); |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 |