Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
759 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | function _defineEnumerableProperties(obj, descs) {
|
---|
| 2 | for (var key in descs) {
|
---|
| 3 | var desc = descs[key];
|
---|
| 4 | desc.configurable = desc.enumerable = true;
|
---|
| 5 | if ("value" in desc) desc.writable = true;
|
---|
| 6 | Object.defineProperty(obj, key, desc);
|
---|
| 7 | }
|
---|
| 8 |
|
---|
| 9 | if (Object.getOwnPropertySymbols) {
|
---|
| 10 | var objectSymbols = Object.getOwnPropertySymbols(descs);
|
---|
| 11 |
|
---|
| 12 | for (var i = 0; i < objectSymbols.length; i++) {
|
---|
| 13 | var sym = objectSymbols[i];
|
---|
| 14 | var desc = descs[sym];
|
---|
| 15 | desc.configurable = desc.enumerable = true;
|
---|
| 16 | if ("value" in desc) desc.writable = true;
|
---|
| 17 | Object.defineProperty(obj, sym, desc);
|
---|
| 18 | }
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | return obj;
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | module.exports = _defineEnumerableProperties;
|
---|
| 25 | module.exports["default"] = module.exports, module.exports.__esModule = true; |
---|
Note:
See
TracBrowser
for help on using the repository browser.