Skip to content

Commit

Permalink
[Tests] add some additional tests
Browse files Browse the repository at this point in the history
This may fail in v8 3.5 and older; see https://bugs.chromium.org/p/v8/issues/detail?id=1570
  • Loading branch information
ljharb committed Dec 21, 2021
1 parent 1b95ae7 commit 78af7d8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/spec/s-object.js
Expand Up @@ -250,15 +250,18 @@ describe('Object', function () {

(supportsDescriptors ? it : xit)('allows setting a nonwritable prototype', function () {
var F = function () {};
expect(F.prototype).toEqual(Object.getOwnPropertyDescriptor(F, 'prototype').value);
expect((new F()).toString).toEqual(Object.prototype.toString);

F.prototype = Number.prototype;
expect(F.prototype).toEqual(Object.getOwnPropertyDescriptor(F, 'prototype').value);
expect((new F()).toString).toEqual(Number.prototype.toString);

var toStringSentinel = {};
var sentinel = { toString: toStringSentinel };
Object.defineProperty(F, 'prototype', { value: sentinel, writable: false });

expect(F.prototype).toEqual(Object.getOwnPropertyDescriptor(F, 'prototype').value);
expect((new F()).toString).toEqual(toStringSentinel);
});
});
Expand Down

0 comments on commit 78af7d8

Please sign in to comment.