Lines Matching refs:observer
33 allObservers.forEach(function(observer) { observer.reset(); }); argument
47 var observer = { variable
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(); variable
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);
1173 Object.observe(arr, observer.callback);
1175 Object.observe(arr2, observer.callback);
1177 Object.observe(arr3, observer.callback);
1193 Object.deliverChangeRecords(observer.callback);
1194 observer.assertCallbackRecords([
1242 Object.observe(slow_arr, observer.callback);
1249 Object.deliverChangeRecords(observer.callback);
1250 observer.assertCallbackRecords([
1272 Object.observe(obj, observer.callback);
1276 Object.deliverChangeRecords(observer.callback);
1277 observer.assertCallbackRecords([
1287 Object.observe(obj, observer.callback);
1291 Object.deliverChangeRecords(observer.callback);
1292 observer.assertCallbackRecords([
1305 Object.observe(arr, observer.callback);
1312 Object.deliverChangeRecords(observer.callback);
1313 observer.assertCallbackRecords([
1341 Object.observe(array, observer.callback);
1345 Object.deliverChangeRecords(observer.callback);
1346 observer.assertCallbackRecords([
1363 Object.observe(array, observer.callback);
1366 Object.deliverChangeRecords(observer.callback);
1367 observer.assertCallbackRecords([
1377 Object.observe(array, observer.callback);
1380 Object.deliverChangeRecords(observer.callback);
1381 observer.assertCallbackRecords([
1392 Object.observe(array, observer.callback);
1394 Object.deliverChangeRecords(observer.callback);
1395 observer.assertCallbackRecords([
1406 Object.observe(array, observer.callback);
1408 Object.deliverChangeRecords(observer.callback);
1409 observer.assertCallbackRecords([
1419 Object.observe(array, observer.callback);
1424 Object.deliverChangeRecords(observer.callback);
1425 observer.assertCallbackRecords([
1434 function MockArray(initial, observer) { argument
1439 this.observer = observer;
1445 Object.observe(this, this.observer.callback, ['splice']);
1453 var array = new MockArray([], observer);
1454 Object.observe(array, observer.callback, ['lengthChange']);
1456 Object.deliverChangeRecords(observer.callback);
1457 observer.assertCallbackRecords([
1463 var array = new MockArray([1], observer);
1464 Object.observe(array, observer.callback, ['lengthChange']);
1466 Object.deliverChangeRecords(observer.callback);
1467 observer.assertCallbackRecords([
1473 var array = new MockArray([1], observer);
1474 Object.observe(array, observer.callback, ['lengthChange']);
1476 Object.deliverChangeRecords(observer.callback);
1477 observer.assertCallbackRecords([
1483 var array = new MockArray([], observer);
1484 Object.observe(array, observer.callback, ['lengthChange']);
1486 Object.deliverChangeRecords(observer.callback);
1487 observer.assertCallbackRecords([
1493 var array = new MockArray([0, 1, 2], observer);
1494 Object.observe(array, observer.callback, ['lengthChange']);
1496 Object.deliverChangeRecords(observer.callback);
1497 observer.assertCallbackRecords([
1508 Object.observe(array, observer.callback);
1510 Object.deliverChangeRecords(observer.callback);
1511 observer.assertCallbackRecords([
1520 Object.observe(array, observer.callback);
1525 Object.deliverChangeRecords(observer.callback);
1526 observer.assertCallbackRecords([
1541 Object.observe(array, observer.callback);
1546 Object.deliverChangeRecords(observer.callback);
1547 observer.assertCallbackRecords([
1563 Object.observe(array, observer.callback);
1567 Object.deliverChangeRecords(observer.callback);
1568 observer.assertCallbackRecords([
1590 Object.observe(array, observer.callback);
1596 Object.deliverChangeRecords(observer.callback);
1597 observer.assertCallbackRecords([
1624 Object.observe(dummy, observer.callback);
1625 Object.unobserve(dummy, observer.callback);
1627 Object.observe(array, observer.callback);
1629 Object.deliverChangeRecords(observer.callback);
1630 observer.assertCallbackRecords([
1639 Object.observe(obj, observer.callback);
1648 Object.deliverChangeRecords(observer.callback);
1649 observer.assertCallbackRecords([
1660 Object.observe(fun, observer.callback);
1666 Object.deliverChangeRecords(observer.callback);
1667 observer.assertRecordCount(3);
1670 assertSame(fun, observer.records[0].object);
1671 assertEquals('prototype', observer.records[0].name);
1672 assertEquals('update', observer.records[0].type);
1677 assertSame(fun, observer.records[0].oldValue.constructor);
1678 observer.records.splice(0, 1);
1679 observer.assertCallbackRecords([
1688 Object.observe(obj, observer.callback);
1690 Object.deliverChangeRecords(observer.callback);
1691 observer.assertRecordCount(1);
1692 observer.assertCallbackRecords([
1725 Object.observe(arr, observer.callback);
1727 Object.deliverChangeRecords(observer.callback);
1728 observer.assertCallbackRecords([
1775 Object.observe(arr, observer.callback);
1777 Object.deliverChangeRecords(observer.callback);
1779 observer.assertNotCalled();
1782 observer.assertRecordCount(count + 1);
1783 var lengthRecord = observer.records[count];
1809 Object.observe(fun, observer.callback);
1819 Object.deliverChangeRecords(observer.callback);
1820 observer.assertCallbackRecords([
1834 Object.observe(fun, observer.callback);
1844 Object.deliverChangeRecords(observer.callback);
1845 observer.assertCallbackRecords([