3 module.exports = function (t, a) {
4 var o, o1, o2, x, y = {}, z = {};
5 o = { inherited: true, visible: 23 };
8 o1.nonremovable = 'raz';
9 Object.defineProperty(o1, 'hidden', { value: 'hidden' });
11 o2 = Object.defineProperties({}, { nonremovable: { value: y } });
14 try { t(o2, o1); } catch (ignore) {}
16 a(o2.visible, z, "Enumerable");
17 a(o1.hidden, 'hidden', "Not Enumerable");
18 a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
19 a(o2.propertyIsEnumerable('hidden'), false,
20 "Not enumerable is not enumerable");
22 a(o2.inherited, true, "Extend deep");
24 a(o2.nonremovable, y, "Do not overwrite non configurable");
25 a(o2.other, 'other', "Own kept");
29 try { t(x, o1); } catch (ignore) {}
31 a(x.visible, z, "Enumerable");
32 a(x.hidden, 'hidden', "Not Enumerable");
33 a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
34 a(x.propertyIsEnumerable('hidden'), false,
35 "Not enumerable is not enumerable");
37 a(x.inherited, true, "Extend deep");
39 a(x.nonremovable, y, "Ignored non configurable");
40 a(x.other, 'other', "Other");
43 a(x.visible, 3, "Writable is writable");
47 a.throws(function () {
49 }, "Not writable is not writable");
54 a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable");
58 a.throws(function () {
60 }, "Not configurable is not configurable");
62 x = Object.defineProperty({}, 'foo',
63 { configurable: false, writable: true, enumerable: false, value: 'bar' });
65 try { t(x, { foo: 'lorem' }); } catch (ignore) {}
66 a(x.foo, 'bar', "Writable, not enumerable");