(obj)
| 10 | let globalCounter = 10000000; |
| 11 | |
| 12 | function testProperties(obj) { |
| 13 | for (let i = 0; i < 3; i++) { |
| 14 | obj.x = 1001; |
| 15 | assertEquals(1001, obj.x); |
| 16 | |
| 17 | obj.y = "old"; |
| 18 | assertEquals("old", obj.y); |
| 19 | |
| 20 | delete obj.y; |
| 21 | assertEquals("undefined", typeof obj.y); |
| 22 | |
| 23 | let uid = globalCounter++; |
| 24 | let fresh = "f_" + uid; |
| 25 | |
| 26 | obj.z = fresh; |
| 27 | assertEquals(fresh, obj.z); |
| 28 | |
| 29 | obj[fresh] = uid; |
| 30 | assertEquals(uid, obj[fresh]); |
| 31 | |
| 32 | verifyHeap(); |
| 33 | |
| 34 | assertEquals(1001, obj.x); |
| 35 | assertEquals(fresh, obj.z); |
| 36 | assertEquals(uid, obj[fresh]); |
| 37 | } |
| 38 | |
| 39 | // These properties are special for JSFunctions. |
| 40 | Object.defineProperty(obj, 'name', {value: "crazy"}); |
| 41 | Object.defineProperty(obj, 'length', {value: 999}); |
| 42 | } |
| 43 | |
| 44 | function minus18(x) { return x - 18; } |
| 45 | function id(x) { return x; } |
no test coverage detected