|
21 | 21 | configurable: true,
|
22 | 22 | set: t.step_func((value) => { setter_called = true; }),
|
23 | 23 | });
|
| 24 | + t.add_cleanup(function() { |
| 25 | + delete Object.prototype['10']; |
| 26 | + }); |
24 | 27 | request.onerror = t.unreached_func('request should not fail');
|
25 | 28 | request.onsuccess = t.step_func(() => {
|
26 | 29 | const result = request.result;
|
|
31 | 34 | 'Result should have own-property overriding prototype setter.');
|
32 | 35 | assert_equals(result[10], 'key',
|
33 | 36 | 'Result should have expected property.');
|
34 |
| - |
35 |
| - delete Object.prototype['10']; |
36 | 37 | t.done();
|
37 | 38 | });
|
38 | 39 | },
|
|
53 | 54 | configurable: true,
|
54 | 55 | set: t.step_func(function(value) { setter_called = true; }),
|
55 | 56 | });
|
| 57 | + t.add_cleanup(function() { |
| 58 | + delete Object.prototype['id']; |
| 59 | + }); |
56 | 60 | request.onerror = t.unreached_func('request should not fail');
|
57 | 61 | request.onsuccess = t.step_func(function() {
|
58 | 62 | const result = request.result;
|
|
63 | 67 | 'Result should have own-property overriding prototype setter.');
|
64 | 68 | assert_equals(result.id, 1,
|
65 | 69 | 'Own property should match primary key generator value');
|
66 |
| - |
67 |
| - delete Object.prototype['id']; |
68 | 70 | t.done();
|
69 | 71 | });
|
70 | 72 | },
|
|
81 | 83 | const request = tx.objectStore('store').get(1);
|
82 | 84 |
|
83 | 85 | Object.prototype.a = {b: {c: 'on proto'}};
|
| 86 | + t.add_cleanup(function() { |
| 87 | + delete Object.prototype.a; |
| 88 | + }); |
| 89 | + assert_equals(Object.prototype.a.b.c, 'on proto', |
| 90 | + 'Prototype should be configured for test'); |
84 | 91 |
|
85 | 92 | request.onerror = t.unreached_func('request should not fail');
|
86 | 93 | request.onsuccess = t.step_func(function() {
|
|
94 | 101 | assert_equals(result.a.b.c, 1,
|
95 | 102 | 'Own property should match primary key generator value');
|
96 | 103 | assert_equals(Object.prototype.a.b.c, 'on proto',
|
97 |
| - 'Prototype should not be modified'); |
| 104 | + 'Prototype should not be modified'); |
98 | 105 | t.done();
|
99 | 106 | });
|
100 | 107 | },
|
|
0 commit comments