Lines Matching refs:function
33 function TestWithProxies(test, x, y, z) {
35 test(function(h) {return Proxy.createFunction(h, function() {})}, x, y, z)
44 function TestGetOwnProperty(handler) {
48 function TestGetOwnProperty2(create, handler) {
57 getOwnPropertyDescriptor: function(k) {
64 getOwnPropertyDescriptor: function(k) {
67 getOwnPropertyDescriptor2: function(k) {
74 getOwnPropertyDescriptor: function(k) {
81 get: function(pr, pk) {
82 return function(k) { key = k; return {value: 42, configurable: true} }
87 function TestGetOwnPropertyThrow(handler) {
91 function TestGetOwnPropertyThrow2(create, handler) {
93 assertThrows(function(){ Object.getOwnPropertyDescriptor(p, "a") }, "myexn")
94 assertThrows(function(){ Object.getOwnPropertyDescriptor(p, 77) }, "myexn")
98 getOwnPropertyDescriptor: function(k) { throw "myexn" }
102 getOwnPropertyDescriptor: function(k) {
105 getOwnPropertyDescriptor2: function(k) { throw "myexn" }
109 getOwnPropertyDescriptor: function(k) {
115 get: function(pr, pk) {
116 return function(k) { throw "myexn" }
126 function TestGet(handler) {
130 function TestGet2(create, handler) {
138 assertEquals(42, (function(n) { return p[n] })("c"))
140 assertEquals(42, (function(n) { return p[n] })(101))
152 assertEquals(42, (function(n) { return o[n] })("c"))
154 assertEquals(42, (function(n) { return o[n] })(101))
156 assertEquals(88, (function(n) { return o[n] })("x"))
160 get: function(r, k) { key = k; return 42 }
164 get: function(r, k) { return this.get2(r, k) },
165 get2: function(r, k) { key = k; return 42 }
169 getPropertyDescriptor: function(k) { key = k; return {value: 42} }
173 getPropertyDescriptor: function(k) { return this.getPropertyDescriptor2(k) },
174 getPropertyDescriptor2: function(k) { key = k; return {value: 42} }
178 getPropertyDescriptor: function(k) {
186 getPropertyDescriptor: function(k) { key = k; return {value: 42} }
190 get: function(pr, pk) {
191 return function(r, k) { key = k; return 42 }
196 function TestGetCall(handler) {
200 function TestGetCall2(create, handler) {
210 assertEquals(55, (function(n) { return p[n]() })("f"))
211 assertEquals(55, (function(n) { return p[n].call(p) })("f"))
212 assertEquals(55, (function(n) { return p[n](15, 20) })("withargs"))
213 assertEquals(55, (function(n) { return p[n].call(p, 13, 21) })("withargs"))
216 var o = Object.create(p, {g: {value: function(x) { return x + 88 }}})
229 assertEquals(55, (function(n) { return o[n]() })("f"))
230 assertEquals(55, (function(n) { return o[n].call(o) })("f"))
231 assertEquals(55, (function(n) { return o[n](15, 20) })("withargs"))
232 assertEquals(55, (function(n) { return o[n].call(o, 13, 21) })("withargs"))
233 assertEquals(93, (function(n) { return o[n](5) })("g"))
234 assertEquals(94, (function(n) { return o[n].call(o, 6) })("g"))
235 assertEquals(95, (function(n) { return o[n].call(p, 7) })("g"))
240 get: function(r, k) { return function() { return 55 } }
244 get: function(r, k) { return this.get2(r, k) },
245 get2: function(r, k) { return function() { return 55 } }
249 getPropertyDescriptor: function(k) {
250 return {value: function() { return 55 }}
255 getPropertyDescriptor: function(k) { return this.getPropertyDescriptor2(k) },
256 getPropertyDescriptor2: function(k) {
257 return {value: function() { return 55 }}
262 getPropertyDescriptor: function(k) {
263 return {get value() { return function() { return 55 } }}
269 getPropertyDescriptor: function(k) {
270 return {value: function() { return 55 }}
275 get: function(r, k) {
277 return function() { return 55 }
279 return function(n, m) { return n + m * 2 }
281 return function() { return this.gg() }
287 get: function(pr, pk) {
288 return function(r, k) { return function() { return 55 } }
293 function TestGetThrow(handler) {
297 function TestGetThrow2(create, handler) {
299 assertThrows(function(){ p.a }, "myexn")
300 assertThrows(function(){ p["b"] }, "myexn")
301 assertThrows(function(){ p[3] }, "myexn")
302 assertThrows(function(){ (function(n) { p[n] })("c") }, "myexn")
303 assertThrows(function(){ (function(n) { p[n] })(99) }, "myexn")
306 assertThrows(function(){ o.a }, "myexn")
307 assertThrows(function(){ o["b"] }, "myexn")
308 assertThrows(function(){ o[3] }, "myexn")
309 assertThrows(function(){ (function(n) { o[n] })("c") }, "myexn")
310 assertThrows(function(){ (function(n) { o[n] })(99) }, "myexn")
314 get: function(r, k) { throw "myexn" }
318 get: function(r, k) { return this.get2(r, k) },
319 get2: function(r, k) { throw "myexn" }
323 getPropertyDescriptor: function(k) { throw "myexn" }
327 getPropertyDescriptor: function(k) { return this.getPropertyDescriptor2(k) },
328 getPropertyDescriptor2: function(k) { throw "myexn" }
332 getPropertyDescriptor: function(k) {
339 getPropertyDescriptor: function(k) { throw "myexn" }
343 get: function(pr, pk) { throw "myexn" }
347 get: function(pr, pk) {
348 return function(r, k) { throw "myexn" }
359 function TestSet(handler) {
363 function TestSet2(create, handler) {
375 assertEquals(45, (function(n) { return p[n] = 45 })("c"))
378 assertEquals(46, (function(n) { return p[n] = 46 })(99))
384 set: function(r, k, v) { key = k; val = v; return true }
388 set: function(r, k, v) { return this.set2(r, k, v) },
389 set2: function(r, k, v) { key = k; val = v; return true }
393 getOwnPropertyDescriptor: function(k) { return {writable: true} },
394 defineProperty: function(k, desc) { key = k; val = desc.value }
398 getOwnPropertyDescriptor: function(k) {
401 getOwnPropertyDescriptor2: function(k) { return {writable: true} },
402 defineProperty: function(k, desc) { this.defineProperty2(k, desc) },
403 defineProperty2: function(k, desc) { key = k; val = desc.value }
407 getOwnPropertyDescriptor: function(k) {
410 defineProperty: function(k, desc) { key = k; val = desc.value }
414 getOwnPropertyDescriptor: function(k) {
415 return {set: function(v) { key = k; val = v }}
420 getOwnPropertyDescriptor: function(k) { return null },
421 getPropertyDescriptor: function(k) { return {writable: true} },
422 defineProperty: function(k, desc) { key = k; val = desc.value }
426 getOwnPropertyDescriptor: function(k) { return null },
427 getPropertyDescriptor: function(k) {
430 defineProperty: function(k, desc) { key = k; val = desc.value }
434 getOwnPropertyDescriptor: function(k) { return null },
435 getPropertyDescriptor: function(k) {
436 return {set: function(v) { key = k; val = v }}
441 getOwnPropertyDescriptor: function(k) { return null },
442 getPropertyDescriptor: function(k) { return null },
443 defineProperty: function(k, desc) { key = k, val = desc.value }
447 get: function(pr, pk) {
448 return function(r, k, v) { key = k; val = v; return true }
453 function TestSetThrow(handler) {
457 function TestSetThrow2(create, handler) {
459 assertThrows(function(){ p.a = 42 }, "myexn")
460 assertThrows(function(){ p["b"] = 42 }, "myexn")
461 assertThrows(function(){ p[22] = 42 }, "myexn")
462 assertThrows(function(){ (function(n) { p[n] = 45 })("c") }, "myexn")
463 assertThrows(function(){ (function(n) { p[n] = 46 })(99) }, "myexn")
467 set: function(r, k, v) { throw "myexn" }
471 set: function(r, k, v) { return this.set2(r, k, v) },
472 set2: function(r, k, v) { throw "myexn" }
476 getOwnPropertyDescriptor: function(k) { throw "myexn" },
477 defineProperty: function(k, desc) { key = k; val = desc.value }
481 getOwnPropertyDescriptor: function(k) { return {writable: true} },
482 defineProperty: function(k, desc) { throw "myexn" }
486 getOwnPropertyDescriptor: function(k) {
489 getOwnPropertyDescriptor2: function(k) { throw "myexn" },
490 defineProperty: function(k, desc) { this.defineProperty2(k, desc) },
491 defineProperty2: function(k, desc) { key = k; val = desc.value }
495 getOwnPropertyDescriptor: function(k) {
498 getOwnPropertyDescriptor2: function(k) { return {writable: true} },
499 defineProperty: function(k, desc) { this.defineProperty2(k, desc) },
500 defineProperty2: function(k, desc) { throw "myexn" }
504 getOwnPropertyDescriptor: function(k) { throw "myexn" },
505 defineProperty: function(k, desc) { key = k; val = desc.value }
509 getOwnPropertyDescriptor: function(k) {
512 defineProperty: function(k, desc) { throw "myexn" }
516 getOwnPropertyDescriptor: function(k) { throw "myexn" }
520 getOwnPropertyDescriptor: function(k) {
521 return {set: function(v) { throw "myexn" }}
526 getOwnPropertyDescriptor: function(k) { throw "myexn" },
527 getPropertyDescriptor: function(k) { return {writable: true} },
528 defineProperty: function(k, desc) { key = k; val = desc.value }
532 getOwnPropertyDescriptor: function(k) { return null },
533 getPropertyDescriptor: function(k) { throw "myexn" },
534 defineProperty: function(k, desc) { key = k; val = desc.value }
538 getOwnPropertyDescriptor: function(k) { return null },
539 getPropertyDescriptor: function(k) { return {writable: true} },
540 defineProperty: function(k, desc) { throw "myexn" }
544 getOwnPropertyDescriptor: function(k) { return null },
545 getPropertyDescriptor: function(k) {
548 defineProperty: function(k, desc) { key = k; val = desc.value }
552 getOwnPropertyDescriptor: function(k) { return null },
553 getPropertyDescriptor: function(k) {
554 return {set: function(v) { throw "myexn" }}
559 getOwnPropertyDescriptor: function(k) { return null },
560 getPropertyDescriptor: function(k) { return null },
561 defineProperty: function(k, desc) { throw "myexn" }
565 get: function(pr, pk) { throw "myexn" }
569 get: function(pr, pk) {
570 return function(r, k, v) { throw "myexn" }
578 function TestSetForDerived(handler) {
582 function TestSetForDerived2(create, handler) {
624 assertThrows(function(){ "use strict"; o.p_nosetter = 50 }, TypeError)
628 assertThrows(function(){ o.p_nonconf = 53 }, TypeError)
631 assertThrows(function(){ o.p_throw = 51 }, "myexn")
634 assertThrows(function(){ o.p_setterthrow = 52 }, "myexn")
639 getPropertyDescriptor: function(k) {
644 case "p_setter":return {set: function(x) { val = x }, configurable: true}
645 case "p_nosetter": return {get: function() { return 1 }, configurable: true}
648 case "p_setterthrow": return {set: function(x) { throw "myexn" }}
658 TestWithProxies(function(create) {
661 getPropertyDescriptor: function() {
664 ? {get: function() { return 5 }, configurable: true}
665 : {set: function() { return false }, configurable: true}
674 TestWithProxies(function(create) {
676 getPropertyDescriptor: function() {
677 Object.defineProperty(o, "x", {get: function() { return 5 }});
678 return {set: function() {}}
699 function TestDefine(handler) {
703 function TestDefine2(create, handler) {
740 assertEquals(p, Object.defineProperty(p, "e", {get: function(){ return 5 }}))
750 get: function(r, k) { return (k === "value") ? 77 : void 0 },
751 getOwnPropertyNames: function() { return ["value"] },
752 enumerate: function() { return ["value"] }
763 blub: {get: function() { return true }},
776 assertThrows(function(){ Object.defineProperties(p, props) }, "myexn")
780 defineProperty: function(k, d) { key = k; desc = d; return true }
784 defineProperty: function(k, d) { return this.defineProperty2(k, d) },
785 defineProperty2: function(k, d) { key = k; desc = d; return true }
789 get: function(pr, pk) {
790 return function(k, d) { key = k; desc = d; return true }
795 function TestDefineThrow(handler) {
799 function TestDefineThrow2(create, handler) {
801 assertThrows(function(){ Object.defineProperty(p, "a", {value: 44})}, "myexn")
802 assertThrows(function(){ Object.defineProperty(p, 0, {value: 44})}, "myexn")
805 get: function(r, k) { throw "myexn" },
806 getOwnPropertyNames: function() { return ["value"] }
808 assertThrows(function(){ Object.defineProperty(p, "p", d1) }, "myexn")
810 get: function(r, k) { return 77 },
811 getOwnPropertyNames: function() { throw "myexn" }
813 assertThrows(function(){ Object.defineProperty(p, "p", d2) }, "myexn")
816 assertThrows(function(){ Object.defineProperties(p, props) }, "otherexn")
820 defineProperty: function(k, d) { throw "myexn" }
824 defineProperty: function(k, d) { return this.defineProperty2(k, d) },
825 defineProperty2: function(k, d) { throw "myexn" }
829 get: function(pr, pk) { throw "myexn" }
833 get: function(pr, pk) {
834 return function(k, d) { throw "myexn" }
844 function TestDelete(handler) {
848 function TestDelete2(create, handler) {
862 (function() {
871 assertThrows(function(){ delete p.z3 }, TypeError)
873 assertThrows(function(){ delete p["z4"] }, TypeError)
879 delete: function(k) { key = k; return k < "z" }
883 delete: function(k) { return this.delete2(k) },
884 delete2: function(k) { key = k; return k < "z" }
888 get: function(pr, pk) {
889 return function(k) { key = k; return k < "z" }
894 function TestDeleteThrow(handler) {
898 function TestDeleteThrow2(create, handler) {
900 assertThrows(function(){ delete p.a }, "myexn")
901 assertThrows(function(){ delete p["b"] }, "myexn");
902 assertThrows(function(){ delete p[3] }, "myexn");
904 (function() {
906 assertThrows(function(){ delete p.c }, "myexn")
907 assertThrows(function(){ delete p["d"] }, "myexn")
908 assertThrows(function(){ delete p[4] }, "myexn");
913 delete: function(k) { throw "myexn" }
917 delete: function(k) { return this.delete2(k) },
918 delete2: function(k) { throw "myexn" }
922 get: function(pr, pk) { throw "myexn" }
926 get: function(pr, pk) {
927 return function(k) { throw "myexn" }
935 function TestDescriptor(handler) {
939 function TestDescriptor2(create, handler) {
946 {get: function() { "get" }, set: function() { "set" }, configurable: true}
961 defineProperty: function(k, d) { this["__" + k] = d; return true },
962 getOwnPropertyDescriptor: function(k) { return this["__" + k] }
966 defineProperty: function(k, d) { this["__" + k] = d; return true },
967 getOwnPropertyDescriptor: function(k) {
970 getOwnPropertyDescriptor2: function(k) { return this["__" + k] }
974 function TestDescriptorThrow(handler) {
978 function TestDescriptorThrow2(create, handler) {
980 assertThrows(function(){ Object.getOwnPropertyDescriptor(p, "a") }, "myexn")
984 getOwnPropertyDescriptor: function(k) { throw "myexn" }
988 getOwnPropertyDescriptor: function(k) {
991 getOwnPropertyDescriptor2: function(k) { throw "myexn" }
998 function TestComparison(eq) {
1002 function TestComparison2(create, eq) {
1014 TestComparison(function(o1, o2) { return o1 == o2 })
1015 TestComparison(function(o1, o2) { return o1 === o2 })
1016 TestComparison(function(o1, o2) { return !(o1 != o2) })
1017 TestComparison(function(o1, o2) { return !(o1 !== o2) })
1023 function TestTypeof() {
1028 assertEquals("function", typeof Proxy.createFunction({}, function() {}))
1029 assertTrue(typeof Proxy.createFunction({}, function() {}) == "function")
1030 assertTrue("function" == typeof Proxy.createFunction({}, function() {}))
1041 function TestIn(handler) {
1045 function TestIn2(create, handler) {
1084 has: function(k) { key = k; return k < "z" }
1088 has: function(k) { return this.has2(k) },
1089 has2: function(k) { key = k; return k < "z" }
1093 getPropertyDescriptor: function(k) {
1099 getPropertyDescriptor: function(k) { return this.getPropertyDescriptor2(k) },
1100 getPropertyDescriptor2: function(k) {
1106 getPropertyDescriptor: function(k) {
1113 getPropertyDescriptor: function(k) {
1119 get: function(pr, pk) {
1120 return function(k) { key = k; return k < "z" }
1125 function TestInThrow(handler) {
1129 function TestInThrow2(create, handler) {
1131 assertThrows(function(){ return "a" in o }, "myexn")
1132 assertThrows(function(){ return 99 in o }, "myexn")
1133 assertThrows(function(){ return !("a" in o) }, "myexn")
1134 assertThrows(function(){ return ("a" in o) ? 2 : 3 }, "myexn")
1135 assertThrows(function(){ if ("b" in o) {} }, "myexn")
1136 assertThrows(function(){ if (!("b" in o)) {} }, "myexn")
1137 assertThrows(function(){ if ("zzz" in o) {} }, "myexn")
1141 has: function(k) { throw "myexn" }
1145 has: function(k) { return this.has2(k) },
1146 has2: function(k) { throw "myexn" }
1150 getPropertyDescriptor: function(k) { throw "myexn" }
1154 getPropertyDescriptor: function(k) { return this.getPropertyDescriptor2(k) },
1155 getPropertyDescriptor2: function(k) { throw "myexn" }
1160 getPropertyDescriptor: function(k) { throw "myexn" }
1164 get: function(pr, pk) { throw "myexn" }
1168 get: function(pr, pk) {
1169 return function(k) { throw "myexn" }
1174 function TestInForDerived(handler) {
1178 function TestInForDerived2(create, handler) {
1218 getPropertyDescriptor: function(k) {
1224 getPropertyDescriptor: function(k) { return this.getPropertyDescriptor2(k) },
1225 getPropertyDescriptor2: function(k) {
1231 getPropertyDescriptor: function(k) {
1240 getOwnPropertyDescriptor: function(k) {
1246 getOwnPropertyDescriptor: function(k) {
1249 getOwnPropertyDescriptor2: function(k) {
1255 getOwnPropertyDescriptor: function(k) {
1263 get: function(pr, pk) {
1264 return function(k) {
1276 function TestDescriptorGetOrder(handler) {
1279 TestDescriptorGetOrder2(function(n) { return p[n] }, "vV")
1280 TestDescriptorGetOrder2(function(n) { return n in p }, "")
1281 TestDescriptorGetOrder2(function(n) { return o[n] }, "vV")
1282 TestDescriptorGetOrder2(function(n) { return n in o }, "eEcCvVwWgs")
1285 function TestDescriptorGetOrder2(f, access) {
1298 getPropertyDescriptor: function(k) {
1302 get: function(r, attr) {
1306 has: function(attr) {
1331 function TestHasOwn(handler) {
1335 function TestHasOwn2(create, handler) {
1346 hasOwn: function(k) { key = k; return k < "z" }
1350 hasOwn: function(k) { return this.hasOwn2(k) },
1351 hasOwn2: function(k) { key = k; return k < "z" }
1355 getOwnPropertyDescriptor: function(k) {
1361 getOwnPropertyDescriptor: function(k) {
1364 getOwnPropertyDescriptor2: function(k) {
1370 getOwnPropertyDescriptor: function(k) {
1377 getOwnPropertyDescriptor: function(k) {
1383 get: function(pr, pk) {
1384 return function(k) { key = k; return k < "z" }
1389 function TestHasOwnThrow(handler) {
1393 function TestHasOwnThrow2(create, handler) {
1395 assertThrows(function(){ Object.prototype.hasOwnProperty.call(p, "a")},
1397 assertThrows(function(){ Object.prototype.hasOwnProperty.call(p, 99)},
1402 hasOwn: function(k) { throw "myexn" }
1406 hasOwn: function(k) { return this.hasOwn2(k) },
1407 hasOwn2: function(k) { throw "myexn" }
1411 getOwnPropertyDescriptor: function(k) { throw "myexn" }
1415 getOwnPropertyDescriptor: function(k) {
1418 getOwnPropertyDescriptor2: function(k) { throw "myexn" }
1423 getOwnPropertyDescriptor: function(k) { throw "myexn" }
1427 get: function(pr, pk) { throw "myexn" }
1431 get: function(pr, pk) {
1432 return function(k) { throw "myexn" }
1440 function TestProxyInstanceof() {
1447 var f0 = function() {}
1449 var f1 = function() {}
1451 var f2 = function() {}
1453 var f3 = function() {}
1482 var f = Proxy.createFunction({}, function() {})
1483 assertTrue(f instanceof Function)
1489 function TestInstanceofProxy() {
1497 function handler(o) { return {get: function() { return o } } }
1498 var f0 = Proxy.createFunction(handler(o0), function() {})
1499 var f1 = Proxy.createFunction(handler(o1), function() {})
1500 var f2 = Proxy.createFunction(handler(o2), function() {})
1501 var f3 = Proxy.createFunction(handler(o3), function() {})
1502 var f4 = Proxy.createFunction(handler(o4), function() {})
1503 var f5 = Proxy.createFunction(handler(o4), function() {})
1543 var f = Proxy.createFunction({}, function() {})
1544 var ff = Proxy.createFunction(handler(Function), function() {})
1545 assertTrue(f instanceof Function)
1555 function TestPrototype() {
1608 var f = Proxy.createFunction({}, function() {})
1609 assertSame(Object.getPrototypeOf(f), Function.prototype)
1611 assertTrue(Object.prototype.isPrototypeOf.call(Function.prototype, f))
1620 function TestPropertyNames(names, handler) {
1624 function TestPropertyNames2(create, handler, names) {
1630 getOwnPropertyNames: function() { return [] }
1634 getOwnPropertyNames: function() { return ["a", "zz", " ", 0] }
1637 TestPropertyNames(["throw", "function "], {
1638 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() },
1639 getOwnPropertyNames2: function() { return ["throw", "function "] }
1644 return function() { return [{}] }
1649 function TestPropertyNamesThrow(handler) {
1653 function TestPropertyNamesThrow2(create, handler) {
1655 assertThrows(function(){ Object.getOwnPropertyNames(p) }, "myexn")
1659 getOwnPropertyNames: function() { throw "myexn" }
1663 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() },
1664 getOwnPropertyNames2: function() { throw "myexn" }
1668 function TestKeys(names, handler) {
1672 function TestKeys2(create, handler, names) {
1678 keys: function() { return [] }
1682 keys: function() { return ["a", "zz", " ", 0] }
1685 TestKeys(["throw", "function "], {
1686 keys: function() { return this.keys2() },
1687 keys2: function() { return ["throw", "function "] }
1692 return function() { return [{}] }
1697 getOwnPropertyNames: function() { return ["a", 23, "zz", "", 0] },
1698 getOwnPropertyDescriptor: function(k) {
1704 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() },
1705 getOwnPropertyNames2: function() { return ["a", 23, "zz", "", 0] },
1706 getOwnPropertyDescriptor: function(k) {
1709 getOwnPropertyDescriptor2: function(k) { return {enumerable: k.length != 1} }
1714 return function() { return ["0", 4, "a", "b", "c", 5, "ety"] }
1717 return function(k) {
1725 return function() { return ["a", "b", "c"] }
1727 getOwnPropertyDescriptor: function(k) { return {} }
1731 function TestKeysThrow(handler) {
1735 function TestKeysThrow2(create, handler) {
1737 assertThrows(function(){ Object.keys(p) }, "myexn")
1741 keys: function() { throw "myexn" }
1745 keys: function() { return this.keys2() },
1746 keys2: function() { throw "myexn" }
1750 getOwnPropertyNames: function() { throw "myexn" },
1751 getOwnPropertyDescriptor: function(k) { return true }
1755 getOwnPropertyNames: function() { return [1, 2] },
1756 getOwnPropertyDescriptor: function(k) { throw "myexn" }
1760 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() },
1761 getOwnPropertyNames2: function() { throw "myexn" },
1765 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() },
1766 getOwnPropertyNames2: function() { return [1, 2] },
1767 getOwnPropertyDescriptor: function(k) {
1770 getOwnPropertyDescriptor2: function(k) { throw "myexn" }
1779 return function() { throw "myexn" }
1785 return function() { return [1, 2] }
1787 getOwnPropertyDescriptor: function(k) { throw "myexn" }
1795 function TestFix(names, handler) {
1797 var assertFixing = function(o, s, f, e) {
1808 assertArrayEquals(names.filter(function(x) {return x < "z"}).sort(),
1822 assertArrayEquals(names.filter(function(x) {return x < "z"}).sort(),
1837 assertArrayEquals(names.filter(function(x) {return x < "z"}).sort(),
1852 fix: function() { return {} }
1856 fix: function() {
1868 fix: function() { return this.fix2() },
1869 fix2: function() {
1876 return function() {
1883 function TestFixFunction(fix) {
1885 fix: function() { return {} }
1886 }, function() {})
1891 fix: function() { return {length: {value: 3}} }
1892 }, function() {})
1897 fix: function() { return {length: {value: "huh"}} }
1898 }, function() {})
1908 function TestFixThrow(handler) {
1912 function TestFixThrow2(create, handler) {
1914 assertThrows(function(){ Object.seal(p) }, "myexn")
1915 assertThrows(function(){ Object.freeze(p) }, "myexn")
1916 assertThrows(function(){ Object.preventExtensions(p) }, "myexn")
1920 fix: function() { throw "myexn" }
1924 fix: function() { return this.fix2() },
1925 fix2: function() { throw "myexn" }
1934 return function() { throw "myexn" }
1942 function TestReentrantFix(f) {
1948 TestReentrantFix(function(create, freeze) {
1951 fix: function() { return {} }
1958 TestReentrantFix(function(create, freeze) {
1960 get: function() { freeze(p); return 3 },
1961 fix: function() { return {} }
1968 TestReentrantFix(function(create, freeze) {
1970 getPropertyDescriptor: function() { freeze(p); return undefined },
1971 fix: function() { return {} }
1978 TestReentrantFix(function(create, freeze) {
1980 getPropertyDescriptor: function() { freeze(p); return {get: function(){}} },
1981 fix: function() { return {} }
1989 TestReentrantFix(function(create, freeze) {
1992 fix: function() { return {} }
1999 TestReentrantFix(function(create, freeze) {
2001 set: function() { freeze(p); return true },
2002 fix: function() { return {} }
2009 TestReentrantFix(function(create, freeze) {
2011 getOwnPropertyDescriptor: function() { freeze(p); return undefined },
2012 fix: function() { return {} }
2019 TestReentrantFix(function(create, freeze) {
2021 getPropertyDescriptor: function() { freeze(p); return {set: function(){}} },
2022 fix: function() { return {} }
2030 TestReentrantFix(function(create, freeze) {
2032 getPropertyDescriptor: function() { freeze(p); return {set: function(){}} },
2033 fix: function() { return {x: {get: function(){}}} }
2041 TestReentrantFix(function(create, freeze) {
2043 get fix() { freeze(p); return function(){} }
2054 TestReentrantFix(function(create, freeze) {
2056 fix: function() { freeze(p); return {} }
2071 // Function.prototype.toString)
2075 function TestToString(handler) {
2083 var f = Proxy.createFunction(handler, function() {})
2085 assertEquals("[object Function]", Object.prototype.toString.call(f))
2089 assertDoesNotThrow(function(){ Function.prototype.toString.call(f) })
2100 get: function(r, k) { key = k; return function() { return "my_proxy" } }
2104 get: function(r, k) { return this.get2(r, k) },
2105 get2: function(r, k) { key = k; return function() { return "my_proxy" } }
2109 get: function(pr, pk) {
2110 return function(r, k) { key = k; return function() { return "my_proxy" } }
2115 function TestToStringThrow(handler) {
2118 assertThrows(function(){ Object.prototype.toLocaleString.call(p) }, "myexn")
2120 var f = Proxy.createFunction(handler, function() {})
2121 assertEquals("[object Function]", Object.prototype.toString.call(f))
2122 assertThrows(function(){ Object.prototype.toLocaleString.call(f) }, "myexn")
2126 assertThrows(function(){ Object.prototype.toLocaleString.call(o) }, "myexn")
2130 get: function(r, k) { throw "myexn" }
2134 get: function(r, k) { return function() { throw "myexn" } }
2138 get: function(r, k) { return this.get2(r, k) },
2139 get2: function(r, k) { throw "myexn" }
2143 get: function(pr, pk) { throw "myexn" }
2147 get: function(pr, pk) {
2148 return function(r, k) { throw "myexn" }
2156 function TestValueOf(handler) {
2160 function TestValueOf2(create, handler) {
2173 function TestIsEnumerable(handler) {
2177 function TestIsEnumerable2(create, handler) {
2193 getOwnPropertyDescriptor: function(k) {
2199 getOwnPropertyDescriptor: function(k) {
2202 getOwnPropertyDescriptor2: function(k) {
2208 getOwnPropertyDescriptor: function(k) {
2214 get: function(pr, pk) {
2215 return function(k) {
2222 function TestIsEnumerableThrow(handler) {
2226 function TestIsEnumerableThrow2(create, handler) {
2228 assertThrows(function(){ Object.prototype.propertyIsEnumerable.call(p, "a") },
2230 assertThrows(function(){ Object.prototype.propertyIsEnumerable.call(p, 11) },
2235 getOwnPropertyDescriptor: function(k) { throw "myexn" }
2239 getOwnPropertyDescriptor: function(k) {
2242 getOwnPropertyDescriptor2: function(k) { throw "myexn" }
2246 getOwnPropertyDescriptor: function(k) {
2252 get: function(pr, pk) { throw "myexn" }
2256 get: function(pr, pk) {
2257 return function(k) { throw "myexn" }
2265 function TestConstructorWithProxyPrototype() {
2269 function TestConstructorWithProxyPrototype2(create, handler) {
2270 function C() {};