Add missing test cases for set __proto__ (#898)

Fixes #887
This commit is contained in:
Zirak 2017-03-13 17:03:28 +02:00 committed by Leo Balter
parent 6ef9cef4a0
commit ed2bcdc0a9
1 changed files with 16 additions and 0 deletions

View File

@ -12,8 +12,24 @@ features: [Symbol]
---*/
var set = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
var subject = {};
assert.sameValue(set.call(true), undefined, 'boolean');
assert.sameValue(
Object.getPrototypeOf(subject), Object.prototype, 'following boolean'
);
assert.sameValue(set.call(1), undefined, 'number');
assert.sameValue(
Object.getPrototypeOf(subject), Object.prototype, 'following number'
);
assert.sameValue(set.call('string'), undefined, 'string');
assert.sameValue(
Object.getPrototypeOf(subject), Object.prototype, 'following string'
);
assert.sameValue(set.call(Symbol('')), undefined, 'symbol');
assert.sameValue(
Object.getPrototypeOf(subject), Object.prototype, 'following symbol'
);