Tests for exotic global objects
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 564
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
Description
ES2015 accounts for abrupt completions returned by every call to the global object's essential internal methods. For example, from HasRestrictedGlobalProperty:
- Let existingProp be globalObject.[GetOwnProperty].
- ReturnIfAbrupt(existingProp).
This is because the global object may be an exotic object, as specified by the first step of InitializeHostDefinedRealm:
- If this implementation requires use of an exotic object to serve as
realm's global object, let global be such an object created in an
implementation defined manner. Otherwise, let global be undefined
indicating that an ordinary object should be created as the global object.
Test262 should assert correct behavior for such exotic global objects. This will require a new "helper" function such as $CREATE_REALM(globalObject). Similar to print, hosts would be required to provide an implementation prior to test execution.
But taking a step back, I'm having trouble thinking of a use case for this functionality. My worry is that many (most?) implementers have no need for exotic global objects, and therefore would ignore this aspect of the specification (and any tests for it).
Understanding the use case (and the likelihood of compliance) goes beyond the scope of the specification itself, but that perspective is necessary to properly prioritize test-writing efforts in this area. @bterlson and/or @allenwb: do you have a moment to offer your thoughts on this?
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 with issue #538 and the cited ES2015 sections, especially HasRestrictedGlobalProperty and InitializeHostDefinedRealm. Review how existing host-provided helpers such as print are specified, then determine the scope of a proposed $CREATE_REALM(globalObject) helper. Done would mean agreed use cases and tests that assert correct behavior for exotic global objects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100