Lines Matching full:reflect
68 // Reflect.get
72 assertEquals(2, Reflect.get.length);
77 assertThrows(function() { Reflect.get(); }, TypeError);
78 assertThrows(function() { Reflect.get(42, "bla"); }, TypeError);
79 assertThrows(function() { Reflect.get(null, "bla"); }, TypeError);
87 assertEquals(42, Reflect.get(target, a));
88 assertThrowsEquals(function() { Reflect.get(target, b); }, "gaga");
96 assertEquals(true, Reflect.get(target, "bla"));
97 assertEquals(true, Reflect.get(target, "bla", target));
98 assertEquals(true, Reflect.get(target, "bla", receiver));
99 assertEquals(42, Reflect.get(target, 4));
100 assertEquals(42, Reflect.get(target, 4, target));
101 assertEquals(42, Reflect.get(target, 4, receiver));
102 assertEquals(42, Reflect.get(target, "4"));
103 assertEquals(42, Reflect.get(target, "4", target));
104 assertEquals(42, Reflect.get(target, "4", receiver));
105 assertEquals("foo", Reflect.get(target, sym));
106 assertEquals("foo", Reflect.get(target, sym, target));
107 assertEquals("foo", Reflect.get(target, sym, receiver));
108 assertEquals(43, Reflect.get(target, "noconf"));
109 assertEquals(43, Reflect.get(target, "noconf", target));
110 assertEquals(43, Reflect.get(target, "noconf", receiver));
111 assertEquals(true, Reflect.get(target, "getter"));
112 assertEquals(true, Reflect.get(target, "getter", target));
113 assertEquals(false, Reflect.get(target, "getter", receiver));
114 assertEquals(undefined, Reflect.get(target, "setter"));
115 assertEquals(undefined, Reflect.get(target, "setter", target));
116 assertEquals(undefined, Reflect.get(target, "setter", receiver));
117 assertEquals(undefined, Reflect.get(target, "foo"));
118 assertEquals(undefined, Reflect.get(target, "foo", target));
119 assertEquals(undefined, Reflect.get(target, "foo", receiver));
120 assertEquals(undefined, Reflect.get(target, 666));
121 assertEquals(undefined, Reflect.get(target, 666, target));
122 assertEquals(undefined, Reflect.get(target, 666, receiver));
126 assertEquals(true, Reflect.get(target, "foo"));
127 assertEquals(true, Reflect.get(target, "foo", target));
128 assertEquals(false, Reflect.get(target, "foo", receiver));
136 // Reflect.set
140 assertEquals(3, Reflect.set.length);
145 assertThrows(function() { Reflect.set(); }, TypeError);
146 assertThrows(function() { Reflect.set(42, "bla"); }, TypeError);
147 assertThrows(function() { Reflect.set(null, "bla"); }, TypeError);
155 assertTrue(Reflect.set(target, a, 42));
157 assertThrowsEquals(function() { Reflect.set(target, b, 42); }, "gaga");
166 assertTrue(Reflect.set(target, "bla", value));
170 assertTrue(Reflect.set(target, "bla", value, target));
174 assertTrue(Reflect.set(target, "bla", value, receiver));
180 assertTrue(Reflect.set(target, 4, value));
184 assertTrue(Reflect.set(target, 4, value, target));
188 assertTrue(Reflect.set(target, 4, value, receiver));
194 assertTrue(Reflect.set(target, sym, value));
198 assertTrue(Reflect.set(target, sym, value, target));
202 assertTrue(Reflect.set(target, sym, value, receiver));
208 assertTrue(Reflect.set(target, "noconf", value));
212 assertTrue(Reflect.set(target, "noconf", value, target));
216 assertTrue(Reflect.set(target, "noconf", value, receiver));
221 assertTrue(Reflect.set(target, "setter", value));
225 assertTrue(Reflect.set(target, "setter", value, target));
229 assertTrue(Reflect.set(target, "setter", value, receiver));
234 assertFalse(Reflect.set(target, "nowrite", value));
237 assertFalse(Reflect.set(target, "nowrite", value, target));
240 assertFalse(Reflect.set(target, "nowrite", value, receiver));
245 assertFalse(Reflect.set({}, "nowrite", value, target));
248 assertFalse(Reflect.set({}, "unknown", 0, {set unknown(x) {}}));
249 assertFalse(Reflect.set(target, "unknown", value, {set unknown(x) {}}));
250 assertFalse(Reflect.set(target, "bla", value, {set bla(x) {}}));
251 assertFalse(Reflect.set(target, "bla", value, {get bla() {}}));
254 assertTrue(Reflect.set({set bla(x) {}}), "bla", value, target);
255 assertFalse(Reflect.set({get bla() {}}, "bla", value, target));
258 assertFalse(Reflect.set({}, "bla", value, null));
259 assertFalse(Reflect.set({bla: 42}, "bla", value, null));
262 assertTrue(Reflect.set(target, "setter2", value, null));
263 assertFalse(Reflect.set(target, "getter", value, null));
270 assertTrue(Reflect.set(target, "bla", value, receiver2));
271 assertTrue(Reflect.set(target, "not_in_target", value, receiver2));
278 // Reflect.has
282 assertEquals(2, Reflect.has.length);
287 assertThrows(function() { Reflect.has(); }, TypeError);
288 assertThrows(function() { Reflect.has(42, "bla"); }, TypeError);
289 assertThrows(function() { Reflect.has(null, "bla"); }, TypeError);
297 assertTrue(Reflect.has(target, a));
298 assertThrowsEquals(function() { Reflect.has(target, b); }, "gaga");
305 assertTrue(Reflect.has(target, "bla"));
306 assertTrue(Reflect.has(target, 4));
307 assertTrue(Reflect.has(target, "4"));
308 assertTrue(Reflect.has(target, sym));
309 assertTrue(Reflect.has(target, "noconf"));
310 assertTrue(Reflect.has(target, "getter"));
311 assertTrue(Reflect.has(target, "setter"));
312 assertFalse(Reflect.has(target, "foo"));
313 assertFalse(Reflect.has(target, 666));
317 assertEquals(true, Reflect.has(target, "foo"));
325 // Reflect.defineProperty
329 assertEquals(3, Reflect.defineProperty.length);
334 assertThrows(function() { Reflect.defineProperty(); }, TypeError);
335 assertThrows(function() { Reflect.defineProperty(42, "bla"); }, TypeError);
336 assertThrows(function() { Reflect.defineProperty(null, "bla"); }, TypeError);
337 assertThrows(function() { Reflect.defineProperty({}, "bla"); }, TypeError);
338 assertThrows(function() { Reflect.defineProperty({}, "bla", 42); },
340 assertThrows(function() { Reflect.defineProperty({}, "bla", null); },
349 assertTrue(Reflect.defineProperty(target, a, {value: 42}));
351 assertThrowsEquals(function() { Reflect.defineProperty(target, b); }, "gaga");
355 // See reflect-define-property.js for further tests.
360 // Reflect.deleteProperty
364 assertEquals(2, Reflect.deleteProperty.length);
369 assertThrows(function() { Reflect.deleteProperty(); }, TypeError);
370 assertThrows(function() { Reflect.deleteProperty(42, "bla"); }, TypeError);
371 assertThrows(function() { Reflect.deleteProperty(null, "bla"); }, TypeError);
379 assertTrue(Reflect.deleteProperty(target, a));
380 assertThrowsEquals(function() { Reflect.deleteProperty(target, b); }, "gaga");
387 assertTrue(Reflect.deleteProperty(target, "bla"));
390 assertFalse(Reflect.deleteProperty(target, 4));
392 assertTrue(Reflect.deleteProperty(target, 4));
395 assertTrue(Reflect.deleteProperty(target, sym));
397 assertFalse(Reflect.deleteProperty(target, "noconf"));
399 assertTrue(Reflect.deleteProperty(target, "getter"));
400 assertTrue(Reflect.deleteProperty(target, "setter"));
401 assertTrue(Reflect.deleteProperty(target, "foo"));
402 assertTrue(Reflect.deleteProperty(target, 666));
406 assertEquals(true, Reflect.deleteProperty(target, "foo"));
414 // Reflect.getPrototypeOf
418 assertEquals(1, Reflect.getPrototypeOf.length);
423 assertThrows(function() { Reflect.getPrototypeOf(); }, TypeError);
424 assertThrows(function() { Reflect.getPrototypeOf(42); }, TypeError);
425 assertThrows(function() { Reflect.getPrototypeOf(null); }, TypeError);
429 // See reflect-get-prototype-of.js for further tests.
434 // Reflect.setPrototypeOf
438 assertEquals(2, Reflect.setPrototypeOf.length);
443 assertThrows(function() { Reflect.setPrototypeOf(undefined, {}); },
445 assertThrows(function() { Reflect.setPrototypeOf(42, {}); }, TypeError);
446 assertThrows(function() { Reflect.setPrototypeOf(null, {}); }, TypeError);
448 assertThrows(function() { Reflect.setPrototypeOf({}, undefined); },
450 assertThrows(function() { Reflect.setPrototypeOf({}, 42); }, TypeError);
451 assertTrue(Reflect.setPrototypeOf({}, null));
455 // See reflect-set-prototype-of.js for further tests.
460 // Reflect.isExtensible
464 assertEquals(1, Reflect.isExtensible.length);
469 assertThrows(function() { Reflect.isExtensible(); }, TypeError);
470 assertThrows(function() { Reflect.isExtensible(42); }, TypeError);
471 assertThrows(function() { Reflect.isExtensible(null); }, TypeError);
480 assertTrue(Reflect.isExtensible(target));
482 assertFalse(Reflect.isExtensible(target));
488 // Reflect.getOwnPropertyDescriptor
492 assertEquals(2, Reflect.getOwnPropertyDescriptor.length);
497 assertThrows(function() { Reflect.getOwnPropertyDescriptor(); }, TypeError);
498 assertThrows(function() { Reflect.getOwnPropertyDescriptor(42); },
500 assertThrows(function() { Reflect.getOwnPropertyDescriptor(null); },
509 assertEquals(42, Reflect.getOwnPropertyDescriptor(target, a).value);
510 assertThrowsEquals(() => Reflect.getOwnPropertyDescriptor(target, b), "gaga");
514 // See reflect
519 // Reflect.ownKeys
523 assertEquals(1, Reflect.ownKeys.length);
528 assertThrows(function() { Reflect.ownKeys(); }, TypeError);
529 assertThrows(function() { Reflect.ownKeys(42); }, TypeError);
530 assertThrows(function() { Reflect.ownKeys(null); }, TypeError);
535 assertEquals(["z", "y", "x"], Reflect.ownKeys({z: 3, y: 2, x: 1}));
536 assertEquals(["length"], Reflect.ownKeys([]));
543 Reflect.ownKeys(obj));
547 Reflect.ownKeys(obj));
550 assertEquals(["42", "88", "-1", "aaa", s1, s2], Reflect.ownKeys(obj));
554 // See reflect-own-keys.js for further tests.
559 // Reflect.preventExtensions
563 assertEquals(1, Reflect.preventExtensions.length);
568 assertThrows(function() { Reflect.preventExtensions(); }, TypeError);
569 assertThrows(function() { Reflect.preventExtensions(42); }, TypeError);
570 assertThrows(function() { Reflect.preventExtensions(null); }, TypeError);
574 // See reflect-prevent-extensions.js for further tests.