Lines Matching defs:observer

33   allObservers.forEach(function(observer) { observer.reset(); });
47 var observer = {
77 observer.callback = function(r) {
81 observer.records = r;
82 observer.callbackCount++;
85 observer.reset();
86 allObservers.push(observer);
87 return observer;
90 var observer = createObserver();
93 assertEquals("function", typeof observer.callback);
113 assertThrows(function() { Object.observe("non-object", observer.callback); },
115 assertThrows(function() { Object.observe(this, observer.callback); },
119 assertEquals(obj, Object.observe(obj, observer.callback, [1]));
120 assertEquals(obj, Object.observe(obj, observer.callback, [true]));
121 assertEquals(obj, Object.observe(obj, observer.callback, ['foo', null]));
122 assertEquals(obj, Object.observe(obj, observer.callback, [undefined]));
123 assertEquals(obj, Object.observe(obj, observer.callback,
125 assertEquals(obj, Object.observe(obj, observer.callback, []));
126 assertEquals(obj, Object.observe(obj, observer.callback, undefined));
127 assertEquals(obj, Object.observe(obj, observer.callback));
130 assertThrows(function() { Object.unobserve(4, observer.callback); }, TypeError);
131 assertThrows(function() { Object.unobserve(this, observer.callback); },
134 assertEquals(obj, Object.unobserve(obj, observer.callback));
175 Object.observe(obj, observer.callback);
190 Object.deliverChangeRecords(observer.callback);
207 Object.deliverChangeRecords(observer.callback);
208 observer.assertCallbackRecords([
215 Object.observe(obj, observer.callback, [true, 1, null, undefined]);
225 Object.deliverChangeRecords(observer.callback);
226 observer.assertCallbackRecords([
235 Object.deliverChangeRecords(observer.callback);
236 observer.assertNotCalled();
241 Object.observe(obj, observer.callback);
242 Object.observe(obj, observer.callback);
246 Object.deliverChangeRecords(observer.callback);
247 observer.assertCalled();
252 Object.unobserve(obj, observer.callback);
256 Object.deliverChangeRecords(observer.callback);
257 observer.assertNotCalled();
262 Object.unobserve(obj, observer.callback);
263 Object.unobserve(obj, observer.callback);
267 Object.deliverChangeRecords(observer.callback);
268 observer.assertNotCalled();
276 Object.observe(obj, observer.callback);
281 Object.deliverChangeRecords(observer.callback);
282 observer.assertRecordCount(1);
288 Object.observe(obj, observer.callback);
290 Object.deliverChangeRecords(observer.callback);
291 observer.assertCallbackRecords([
298 Object.observe(obj, observer.callback);
302 Object.deliverChangeRecords(observer.callback);
303 observer.assertCallbackRecords([
312 Object.observe(obj, observer.callback);
316 Object.deliverChangeRecords(observer.callback);
317 observer.assertCallbackRecords([
325 Object.observe(obj, observer.callback);
327 Object.deliverChangeRecords(observer.callback);
328 observer.assertNotCalled();
348 Object.observe(obj, observer.callback);
351 Object.deliverChangeRecords(observer.callback);
352 observer.assertCallbackRecords([
362 Object.observe(obj, observer.callback);
364 Object.deliverChangeRecords(observer.callback);
365 observer.assertNotCalled();
385 Object.observe(obj, observer.callback);
388 Object.deliverChangeRecords(observer.callback);
389 observer.assertCallbackRecords([
398 Object.observe(obj, observer.callback);
400 Object.deliverChangeRecords(observer.callback);
401 observer.assertNotCalled();
406 Object.observe(obj, observer.callback);
412 Object.unobserve(obj, observer.callback);
418 Object.observe(obj, observer.callback);
424 Object.unobserve(obj, observer.callback);
430 Object.observe(obj, observer.callback);
436 Object.unobserve(obj, observer.callback);
437 Object.deliverChangeRecords(observer.callback);
438 observer.assertCallbackRecords([
446 Object.observe(obj, observer.callback, ['somethingElse']);
462 Object.deliverChangeRecords(observer.callback);
463 observer.assertNotCalled();
466 Object.observe(obj, observer.callback, ['add', 'delete', 'setPrototype']);
485 Object.deliverChangeRecords(observer.callback);
486 observer.assertCallbackRecords([
494 Object.observe(obj, observer.callback, ['update', 'foo']);
513 Object.deliverChangeRecords(observer.callback);
514 observer.assertCallbackRecords([
588 Object.observe(thingy, observer.callback);
596 Object.deliverChangeRecords(observer.callback);
598 observer.assertCallbackRecords([
640 Object.observe(arr, observer.callback);
642 Object.unobserve(arr, observer.callback);
643 Object.deliverChangeRecords(observer.callback);
644 observer.assertCallbackRecords([
672 Object.observe(arr, observer.callback);
674 Object.unobserve(arr, observer.callback);
675 Object.deliverChangeRecords(observer.callback);
676 observer.assertCallbackRecords([
724 Object.observe(thingy, observer.callback);
728 Object.deliverChangeRecords(observer.callback);
730 observer.assertCallbackRecords([
793 Object.observe(obj, observer.callback);
794 Object.observe(obj3, observer.callback);
795 Object.observe(obj2, observer.callback);
805 Object.observe(obj3, observer.callback);
806 Object.deliverChangeRecords(observer.callback);
807 observer.assertCallbackRecords([
847 Object.observe(obj, observer.callback);
875 Object.deliverChangeRecords(observer.callback);
876 observer.assertCallbackRecords([
905 Object.observe(obj, observer.callback);
933 Object.deliverChangeRecords(observer.callback);
934 observer.assertCallbackRecords([
965 Object.observe(obj, observer.callback);
979 Object.deliverChangeRecords(observer.callback);
980 observer.assertNotCalled();
986 Object.observe(obj, observer.callback);
987 Object.unobserve(obj, observer.callback);
989 Object.observe(obj, observer.callback);
1022 Object.deliverChangeRecords(observer.callback);
1023 observer.assertCallbackRecords([
1051 Object.unobserve(obj, observer.callback);
1057 Object.observe(obj, observer.callback);
1058 Object.unobserve(obj, observer.callback);
1060 Object.observe(obj, observer.callback);
1070 Object.deliverChangeRecords(observer.callback);
1071 observer.assertCallbackRecords([
1078 Object.unobserve(obj, observer.callback);
1171 Object.observe(arr, observer.callback);
1173 Object.observe(arr2, observer.callback);
1175 Object.observe(arr3, observer.callback);
1191 Object.deliverChangeRecords(observer.callback);
1192 observer.assertCallbackRecords([
1240 Object.observe(slow_arr, observer.callback);
1247 Object.deliverChangeRecords(observer.callback);
1248 observer.assertCallbackRecords([
1270 Object.observe(obj, observer.callback);
1274 Object.deliverChangeRecords(observer.callback);
1275 observer.assertCallbackRecords([
1285 Object.observe(obj, observer.callback);
1289 Object.deliverChangeRecords(observer.callback);
1290 observer.assertCallbackRecords([
1303 Object.observe(arr, observer.callback);
1310 Object.deliverChangeRecords(observer.callback);
1311 observer.assertCallbackRecords([
1339 Object.observe(array, observer.callback);
1343 Object.deliverChangeRecords(observer.callback);
1344 observer.assertCallbackRecords([
1361 Object.observe(array, observer.callback);
1364 Object.deliverChangeRecords(observer.callback);
1365 observer.assertCallbackRecords([
1375 Object.observe(array, observer.callback);
1378 Object.deliverChangeRecords(observer.callback);
1379 observer.assertCallbackRecords([
1390 Object.observe(array, observer.callback);
1392 Object.deliverChangeRecords(observer.callback);
1393 observer.assertCallbackRecords([
1404 Object.observe(array, observer.callback);
1406 Object.deliverChangeRecords(observer.callback);
1407 observer.assertCallbackRecords([
1417 Object.observe(array, observer.callback);
1422 Object.deliverChangeRecords(observer.callback);
1423 observer.assertCallbackRecords([
1432 function MockArray(initial, observer) {
1437 this.observer = observer;
1443 Object.observe(this, this.observer.callback, ['splice']);
1451 var array = new MockArray([], observer);
1452 Object.observe(array, observer.callback, ['lengthChange']);
1454 Object.deliverChangeRecords(observer.callback);
1455 observer.assertCallbackRecords([
1461 var array = new MockArray([1], observer);
1462 Object.observe(array, observer.callback, ['lengthChange']);
1464 Object.deliverChangeRecords(observer.callback);
1465 observer.assertCallbackRecords([
1471 var array = new MockArray([1], observer);
1472 Object.observe(array, observer.callback, ['lengthChange']);
1474 Object.deliverChangeRecords(observer.callback);
1475 observer.assertCallbackRecords([
1481 var array = new MockArray([], observer);
1482 Object.observe(array, observer.callback, ['lengthChange']);
1484 Object.deliverChangeRecords(observer.callback);
1485 observer.assertCallbackRecords([
1491 var array = new MockArray([0, 1, 2], observer);
1492 Object.observe(array, observer.callback, ['lengthChange']);
1494 Object.deliverChangeRecords(observer.callback);
1495 observer.assertCallbackRecords([
1506 Object.observe(array, observer.callback);
1508 Object.deliverChangeRecords(observer.callback);
1509 observer.assertCallbackRecords([
1518 Object.observe(array, observer.callback);
1523 Object.deliverChangeRecords(observer.callback);
1524 observer.assertCallbackRecords([
1539 Object.observe(array, observer.callback);
1544 Object.deliverChangeRecords(observer.callback);
1545 observer.assertCallbackRecords([
1561 Object.observe(array, observer.callback);
1565 Object.deliverChangeRecords(observer.callback);
1566 observer.assertCallbackRecords([
1588 Object.observe(array, observer.callback);
1594 Object.deliverChangeRecords(observer.callback);
1595 observer.assertCallbackRecords([
1622 Object.observe(dummy, observer.callback);
1623 Object.unobserve(dummy, observer.callback);
1625 Object.observe(array, observer.callback);
1627 Object.deliverChangeRecords(observer.callback);
1628 observer.assertCallbackRecords([
1637 Object.observe(obj, observer.callback);
1646 Object.deliverChangeRecords(observer.callback);
1647 observer.assertCallbackRecords([
1658 Object.observe(fun, observer.callback);
1664 Object.deliverChangeRecords(observer.callback);
1665 observer.assertRecordCount(3);
1668 assertSame(fun, observer.records[0].object);
1669 assertEquals('prototype', observer.records[0].name);
1670 assertEquals('update', observer.records[0].type);
1675 assertSame(fun, observer.records[0].oldValue.constructor);
1676 observer.records.splice(0, 1);
1677 observer.assertCallbackRecords([
1686 Object.observe(obj, observer.callback);
1688 Object.deliverChangeRecords(observer.callback);
1689 observer.assertRecordCount(1);
1690 observer.assertCallbackRecords([
1723 Object.observe(arr, observer.callback);
1725 Object.deliverChangeRecords(observer.callback);
1726 observer.assertCallbackRecords([
1773 Object.observe(arr, observer.callback);
1775 Object.deliverChangeRecords(observer.callback);
1777 observer.assertNotCalled();
1780 observer.assertRecordCount(count + 1);
1781 var lengthRecord = observer.records[count];