fix issue #42850, test for setters adding properties (#43813)

This commit is contained in:
Jeremy L Thompson
2021-10-14 07:58:13 -06:00
committed by GitHub
parent e7437d3666
commit b8b86a65b8

View File

@ -23,10 +23,19 @@ Run the tests to see the expected output for each method. The methods that take
# --hints--
`Object.keys(bob).length` should return 6.
No properties should be added. `Object.keys(bob).length` should always return 6.
```js
assert.deepEqual(Object.keys(bob).length, 6);
assert.strictEqual(
Object.keys((function () {
let bob = new Person('Bob Ross');
bob.setFirstName('Haskell');
bob.setLastName('Curry');
bob.setFullName('John Smith');
return bob;
})()).length,
6
);
```
`bob instanceof Person` should return `true`.