source: imaps-frontend/node_modules/@babel/helpers/lib/helpers/set.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 3 months ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.4 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = _set;
7var _superPropBase = require("./superPropBase.js");
8var _defineProperty = require("./defineProperty.js");
9function set(target, property, value, receiver) {
10 if (typeof Reflect !== "undefined" && Reflect.set) {
11 set = Reflect.set;
12 } else {
13 set = function set(target, property, value, receiver) {
14 var base = (0, _superPropBase.default)(target, property);
15 var desc;
16 if (base) {
17 desc = Object.getOwnPropertyDescriptor(base, property);
18 if (desc.set) {
19 desc.set.call(receiver, value);
20 return true;
21 } else if (!desc.writable) {
22 return false;
23 }
24 }
25 desc = Object.getOwnPropertyDescriptor(receiver, property);
26 if (desc) {
27 if (!desc.writable) {
28 return false;
29 }
30 desc.value = value;
31 Object.defineProperty(receiver, property, desc);
32 } else {
33 (0, _defineProperty.default)(receiver, property, value);
34 }
35 return true;
36 };
37 }
38 return set(target, property, value, receiver);
39}
40function _set(target, property, value, receiver, isStrict) {
41 var s = set(target, property, value, receiver || target);
42 if (!s && isStrict) {
43 throw new TypeError("failed to set property");
44 }
45 return value;
46}
47
48//# sourceMappingURL=set.js.map
Note: See TracBrowser for help on using the repository browser.