Chromium Code Reviews| Index: test/mjsunit/harmony/object-observe.js |
| diff --git a/test/mjsunit/harmony/object-observe.js b/test/mjsunit/harmony/object-observe.js |
| index 474bfcd3bc49bb7aeb8f7a8d92e97f725161ca5d..73edce263a8fc35fd324a0c256416dfbcf99a42a 100644 |
| --- a/test/mjsunit/harmony/object-observe.js |
| +++ b/test/mjsunit/harmony/object-observe.js |
| @@ -811,3 +811,22 @@ observer.assertCallbackRecords([ |
| { object: array, name: '0', type: 'deleted', oldValue: 0 }, |
| { object: array, name: 'length', type: 'updated', oldValue: 1}, |
| ]); |
| + |
| +// __proto__ |
| +reset(); |
| +var obj = {}; |
| +Object.observe(obj, observer.callback); |
| +var p = {foo: 'yes'}; |
| +var q = {bar: 'no'}; |
| +obj.__proto__ = p; |
| +obj.__proto__ = p; // ignored |
| +obj.__proto__ = null; |
| +obj.__proto__ = q; |
| +// TODO(adamk): Add tests for objects with hidden prototypes |
| +// once we support observing the global object. |
| +Object.deliverChangeRecords(observer.callback); |
| +observer.assertCallbackRecords([ |
| + { object: obj, name: '__proto__', type: 'prototype', oldValue: Object.prototype }, |
|
rossberg
2012/12/03 13:37:41
Line length.
adamk
2012/12/03 19:07:05
Done.
|
| + { object: obj, name: '__proto__', type: 'prototype', oldValue: p }, |
| + { object: obj, name: '__proto__', type: 'prototype', oldValue: null }, |
| +]); |