Lines Matching refs:function
32 function reset() {
33 allObservers.forEach(function(observer) { observer.reset(); });
36 function stringifyNoThrow(arg) {
44 function createObserver() {
50 reset: function() {
54 assertNotCalled: function() {
58 assertCalled: function() {
61 assertRecordCount: function(count) {
65 assertCallbackRecords: function(recs) {
77 observer.callback = function(r) {
93 assertEquals("function", typeof observer.callback);
94 assertEquals("function", typeof observer2.callback);
98 function frozenFunction() {}
104 get: function() {
113 assertThrows(function() { Object.observe("non-object", observer.callback); },
115 assertThrows(function() { Object.observe(this, observer.callback); },
117 assertThrows(function() { Object.observe(obj, nonFunction); }, TypeError);
118 assertThrows(function() { Object.observe(obj, frozenFunction); }, TypeError);
130 assertThrows(function() { Object.unobserve(4, observer.callback); }, TypeError);
131 assertThrows(function() { Object.unobserve(this, observer.callback); },
133 assertThrows(function() { Object.unobserve(obj, nonFunction); }, TypeError);
141 assertThrows(function() { Object.getNotifier(this) }, TypeError);
148 assertThrows(function() { notifier.notify({}); }, TypeError);
149 assertThrows(function() { notifier.notify({ type: 4 }); }, TypeError);
151 assertThrows(function() { notifier.performChange(1, function(){}); }, TypeError);
152 assertThrows(function() { notifier.performChange(undefined, function(){}); }, TypeError);
153 assertThrows(function() { notifier.performChange('foo', undefined); }, TypeError);
154 assertThrows(function() { notifier.performChange('foo', 'bar'); }, TypeError);
156 notifier.performChange('foo', function() {
161 assertThrows(function() { notify.call(undefined, { type: 'a' }); }, TypeError);
162 assertThrows(function() { notify.call(null, { type: 'a' }); }, TypeError);
163 assertThrows(function() { notify.call(5, { type: 'a' }); }, TypeError);
164 assertThrows(function() { notify.call('hello', { type: 'a' }); }, TypeError);
165 assertThrows(function() { notify.call(false, { type: 'a' }); }, TypeError);
166 assertThrows(function() { notify.call({}, { type: 'a' }); }, TypeError);
173 assertThrows(function() { Object.deliverChangeRecords(nonFunction); }, TypeError);
184 set: function() { protoExpandoAccessed = true; }
521 function Thingy(a, b, c) {
531 increment: function(amount) {
535 notifier.performChange(Thingy.INCREMENT, function() {
545 multiply: function(amount) {
549 notifier.performChange(Thingy.MULTIPLY, function() {
559 incrementAndMultiply: function(incAmount, multAmount) {
563 notifier.performChange(Thingy.INCREMENT_AND_MULTIPLY, function() {
575 Thingy.observe = function(thingy, callback) {
582 Thingy.unobserve = function(thingy, callback) {
626 function pushMultiple(arr) {
658 function popMultiple(arr) {
688 function RecursiveThingy() {}
695 multiplyFirstN: function(amount, n) {
700 notifier.performChange(RecursiveThingy.MULTIPLY_FIRST_N, function() {
713 RecursiveThingy.observe = function(thingy, callback) {
717 RecursiveThingy.unobserve = function(thingy, callback) {
740 function DeckSuit() {
749 shuffle: function() {
752 notifier.performChange(DeckSuit.SHUFFLE, function() {
754 self.sort(function() { return Math.random()* 2 - 1; });
758 self.sort(function() { return Math.random()* 2 - 1; });
762 self.sort(function() { return Math.random()* 2 - 1; });
771 DeckSuit.observe = function(thingy, callback) {
775 DeckSuit.unobserve = function(thingy, callback) {
817 function recursiveObserver(r) {
830 function recursiveObserver2(r) {
859 Object.defineProperty(obj, "a", {get: function() {}});
867 Object.defineProperty(obj, "a", {get: function() {}, configurable: true});
917 Object.defineProperty(obj, "1", {get: function() {}});
925 Object.defineProperty(obj, "1", {get: function() {}, configurable: true});
968 Object.defineProperty(obj, symbol, {get: function() {}, configurable: true});
977 obj.__defineSetter__(symbol, function() {});
978 obj.__defineGetter__(symbol, function() {});
984 function TestObserveConfigurable(obj, prop) {
1001 Object.defineProperty(obj, prop, {get: function() {}});
1008 obj.__defineSetter__(prop, function() {});
1009 obj.__defineGetter__(prop, function() {});
1012 obj.__defineGetter__(prop, function() {});
1014 Object.defineProperty(obj, prop, {get: function() {}, configurable: true});
1055 function TestObserveNonConfigurable(obj, prop, desc) {
1083 function createProxy(create, x) {
1085 getPropertyDescriptor: function(k) {
1092 getOwnPropertyDescriptor: function(k) {
1095 defineProperty: function(k, desc) {
1100 delete: function(k) {
1105 getPropertyNames: function() {
1109 callback: function(changeRecords) {
1127 function(){},
1128 (function(){ return arguments })(),
1129 (function(){ "use strict"; return arguments })(),
1132 Object, Function, Date, RegExp,
1137 // createProxy(Proxy.createFunction, function(){}),
1142 function blacklisted(obj, prop) {
1169 Object.defineProperty(arr, '2', {get: function(){}});
1170 Object.defineProperty(arr2, '0', {get: function(){}, configurable: false});
1242 function slowSpliceCallback(records) {
1308 Object.defineProperty(arr, '400', {get: function(){}});
1432 function MockArray(initial, observer) {
1655 // Function.prototype
1657 var fun = function(){};
1673 // we compare its constructor to our function (one of the invariants
1682 // Function.prototype should not be observable except on the object itself
1684 var fun = function(){};
1706 function TestFastElements(prop, mutation, prepopulate, polymorphic, optimize) {
1708 "(function setElement(a, i, v) { " + mutation + "; " +
1750 function TestFastElementsLength(
1753 "(function setLength(a, v) { " + mutation + "; " +
1759 function array(n) {