main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
302 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var test = {
|
---|
4 | __proto__: null,
|
---|
5 | foo: {}
|
---|
6 | };
|
---|
7 |
|
---|
8 | var $Object = Object;
|
---|
9 |
|
---|
10 | /** @type {import('.')} */
|
---|
11 | module.exports = function hasProto() {
|
---|
12 | // @ts-expect-error: TS errors on an inherited property for some reason
|
---|
13 | return { __proto__: test }.foo === test.foo
|
---|
14 | && !(test instanceof $Object);
|
---|
15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.