source: imaps-frontend/node_modules/has-proto/mutator.js@ 79a0317

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

F4 Finalna Verzija

  • Property mode set to 100644
File size: 533 bytes
Line 
1'use strict';
2
3var result = require('./')();
4
5var test = {
6 __proto__: null,
7 foo: {}
8};
9
10var setter = require('dunder-proto/set');
11
12/** @type {import('./mutator')} */
13module.exports = function hasMutator() {
14 if (!result) {
15 return false;
16 }
17
18 var obj = { __proto__: test };
19 // @ts-expect-error: TS errors on an inherited property for some reason
20 if (obj.foo !== test.foo) {
21 return false;
22 }
23
24 if (!setter) {
25 return false;
26 }
27
28 setter(obj, null);
29 if ('foo' in obj || 'toString' in obj) {
30 return false;
31 }
32 return true;
33};
Note: See TracBrowser for help on using the repository browser.