Missing test for mapped arguments object
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 564
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
Description
It looks to me like there's a couple of holes in the tests for mapped arguments, namely,
definePropertywith both a value andwritable: falseshould write the value and then break the mapping betweenargumentsand the corresponding parameterObject.freezeshould break the mapping for every parameter
For example, both of these should return true:
(function nonwritableAndValue(a) {
Object.defineProperty(arguments, '0', {writable: false, value: 1});
const postWriteCondition = arguments[0] === 1 && a === 1;
a = 2;
return postWriteCondition && arguments[0] === 1 && a === 2;
})(0);
(function freeze(a) {
Object.freeze(arguments);
a = 2;
return arguments[0] === 0 && a === 2;
})(0);
The Object.freeze case is particularly important as a potential security issue. (Firefox fails it, even though manually setting the property as nonwritable does correctly break the mapping.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in test/language/arguments-object/mapped, reviewing the existing mapped-arguments tests and the two examples in the issue. Add coverage for defineProperty with value and writable:false, and for Object.freeze; done means both cases verify the mapping is broken as described and pass the Test262 tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100