propertyHelper.js calls String after deleting the global, breaking String/prop-desc.js
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- testing-qa
Research direction
The bug is in harness/propertyHelper.js: isConfigurable deletes the global String before _isCanonicalNumericIndexString calls String(n) (around lines 156 and 182). Read how the other primordials are captured at the top of that file and follow the same pattern, then use that reference in the helper. Confirm with the exact command in the report: js -f harness/sta.js -f harness/assert.js -f harness/propertyHelper.js -f test/built-ins/String/prop-desc.js, which should run without the ReferenceError.
Written by the indexing model from the issue text.
Description
test/built-ins/String/prop-desc.js fails with ReferenceError: String is not defined at 2a1ade303f72d3de80565c921d685222405c32ce, the merge commit for #4551. I reproduced it with the original Test262 files and the SpiderMonkey shell, without the Firefox test importer.
From the Test262 checkout at that revision, run:
js -f harness/sta.js -f harness/assert.js -f harness/propertyHelper.js \
-f test/built-ins/String/prop-desc.js
The test expects verifyProperty(this, "String", …) to complete successfully. Instead, the shell reports:
ReferenceError: String is not defined
_isCanonicalNumericIndexString@harness/propertyHelper.js:156:3
isConfigurable@harness/propertyHelper.js:182:37
verifyProperty@harness/propertyHelper.js:130:31
@test/built-ins/String/prop-desc.js:14:15
isConfigurable deletes the global String property as part of the configurability check. It then calls _isCanonicalNumericIndexString before checking whether the receiver is a TypedArray. That helper calls String(n) after the global binding has been deleted.
Capturing the original String alongside the other primordials in propertyHelper.js and using that reference in _isCanonicalNumericIndexString made the same command pass locally.
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 571
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from tc39/test262
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tc39/test262#5190 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tc39/test262#5185 · 7 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tc39/test262#5159 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tc39/test262#5133 · 1 comment ·
Maintainers usually reply within 1 day
-
Uint8Array.prototype.toHex tests do not test for paddingPossibly taken @bakkot claimed this 24 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
tc39/test262#5130 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
all-contributors/cli#690 ·
Maintainers usually reply within 1 day
-
area: ui Bug Payload OSS
Difficulty 1/5 Under an hour Newbie friendliness 88/100
payloadcms/payload#19839 ·
Maintainers usually reply within 1 day
-
Add: C+ ClassicsOpenapproved channels:add check:passed
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AllTheMods/ATM10-Aeronautics#167 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day