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:
477 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var test = require('tape');
|
---|
4 | var hasProto = require('../');
|
---|
5 |
|
---|
6 | test('hasProto', function (t) {
|
---|
7 | var result = hasProto();
|
---|
8 | t.equal(typeof result, 'boolean', 'returns a boolean (' + result + ')');
|
---|
9 |
|
---|
10 | var obj = { __proto__: null };
|
---|
11 | if (result) {
|
---|
12 | t.notOk('toString' in obj, 'null object lacks toString');
|
---|
13 | } else {
|
---|
14 | t.ok('toString' in obj, 'without proto, null object has toString');
|
---|
15 | t.equal(obj.__proto__, null); // eslint-disable-line no-proto
|
---|
16 | }
|
---|
17 |
|
---|
18 | t.end();
|
---|
19 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.