OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-ayle license that can be | 2 // Use of this source code is governed by a BSD-ayle license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-object-observe | |
6 // Flags: --allow-natives-syntax --track-fields --expose-gc | 5 // Flags: --allow-natives-syntax --track-fields --expose-gc |
7 | 6 |
8 var global = Function('return this')(); | 7 var global = Function('return this')(); |
9 var verbose = 0; | 8 var verbose = 0; |
10 | 9 |
11 function test(ctor_desc, use_desc, migr_desc) { | 10 function test(ctor_desc, use_desc, migr_desc) { |
12 var n = 5; | 11 var n = 5; |
13 var objects = []; | 12 var objects = []; |
14 var results = []; | 13 var results = []; |
15 | 14 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 name: "set property callback", | 267 name: "set property callback", |
269 migr: function(o, i) { | 268 migr: function(o, i) { |
270 Object.defineProperty(o, "a", { | 269 Object.defineProperty(o, "a", { |
271 get: function() { return 1.5 + i; }, | 270 get: function() { return 1.5 + i; }, |
272 set: function(value) {}, | 271 set: function(value) {}, |
273 configurable: true, | 272 configurable: true, |
274 }); | 273 }); |
275 }, | 274 }, |
276 }, | 275 }, |
277 { | 276 { |
278 name: "observe", | |
279 migr: function(o, i) { Object.observe(o, function(){}); }, | |
280 }, | |
281 { | |
282 name: "seal", | 277 name: "seal", |
283 migr: function(o, i) { Object.seal(o); }, | 278 migr: function(o, i) { Object.seal(o); }, |
284 }, | 279 }, |
285 { // Must be the last in the sequence, because after the global object freeze | 280 { // Must be the last in the sequence, because after the global object freeze |
286 // the other modifications does not make sence. | 281 // the other modifications does not make sence. |
287 name: "freeze", | 282 name: "freeze", |
288 migr: function(o, i) { Object.freeze(o); }, | 283 migr: function(o, i) { Object.freeze(o); }, |
289 }, | 284 }, |
290 ]; | 285 ]; |
291 | 286 |
292 | 287 |
293 | 288 |
294 migrations.forEach(function(migr) { | 289 migrations.forEach(function(migr) { |
295 uses.forEach(function(use) { | 290 uses.forEach(function(use) { |
296 ctors.forEach(function(ctor) { | 291 ctors.forEach(function(ctor) { |
297 test(ctor, use, migr); | 292 test(ctor, use, migr); |
298 }); | 293 }); |
299 }); | 294 }); |
300 }); | 295 }); |
OLD | NEW |