tests/auto/qml/ecmascripttests/test262/test/language/expressions/delete/11.4.1-5-1.js
raw| 1 | // Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 | // This code is governed by the BSD license found in the LICENSE file. |
| 3 | |
| 4 | /*--- |
| 5 | es5id: 11.4.1-5-1 |
| 6 | description: > |
| 7 | delete operator returns false when deleting a direct reference to |
| 8 | a var |
| 9 | flags: [noStrict] |
| 10 | ---*/ |
| 11 | |
| 12 | function testcase() { |
| 13 | var x = 1; |
| 14 | |
| 15 | // Now, deleting 'x' directly should fail; |
| 16 | var d = delete x; |
| 17 | |
| 18 | assert.sameValue(d, false, 'd'); |
| 19 | assert.sameValue(x, 1, 'x'); |
| 20 | } |
| 21 | testcase(); |