Repository navigation
Refuse the Window property names the specification lists as the object name - #88
Merged
Merged
Conversation
jwrosewell
marked this pull request as ready for review
November 11, 2026 13:50
This was referenced Nov 11, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The JavaScript Builder lets a site name the global object the client script creates. The script declares it with a top level
var, so a name that is a read-only property of the browser's Window object never creates the object, andevalreplaces the page's own function.locationnavigates the page away. The specification's JavaScript builder page lists the names to refuse, and this repository refused only the language's reserved words,Infinity,NaN,undefinedand the builder's own constructor name.For specifications#114, which merged on 9 November. It extends the Object name section of javascript-builder.md, pinned at 8aa2de01 on specifications
rc, first merged in specifications#113.What changed
JavaScriptBuilderElement.RESERVED_OBJECT_NAMESnow also refuses these 30 names, with the existing behaviour for a refused name kept as it was. A configured name is aPipelineConfigurationException, from the builder and from the constructor, and a name in the request's evidence falls back to the configured name with a warning.These are exactly the names the Object name section lists beyond the reserved words,
Infinity,NaN,undefinedandfiftyoneDegreesManager.caches,cookieStoreanddocumentPictureInPictureare refused, as the section says, although they exist only in a secure context, so that whether a name is valid does not depend on the page's scheme.letwas already refused because it is reserved in strict mode (ECMA-262 section 13.1.1).self,frames,parent,openerandlengthstay allowed because a top levelvarcan replace them, and so do near misses such aswindows,WindowandcachesX.The comment above the list gives each group's reason as the section does. Strict mode code cannot declare
evalandarguments, andevalwould also replace the page's own function. A top levelvarcannot replace the Window properties, so the object would never be created, andlocationnavigates the page away.The session id check in the builder (
^[A-Za-z0-9-]{1,64}$, an empty session id otherwise) was already in place and tested, so it is not changed here.The same list in the other languages
The set and the order are the same as the four merged changes, so every language refuses exactly the same names.
Tests
The tests were written first, in
JavaScriptObjectNameTests.java. Each refused name is checked from the builder, from the constructor, from the request's evidence and throughisValidObjectName, and each allowed name is checked as accepted.rcwith only the tests added: run 42699059220, failure.Both ran on 9 November, so they are the red and green of the change itself and not of this head. The head has moved only by the merge of
rcdescribed below, and the full build covers it.Full build
Commit 6058d00 merges the current
rcat ddb7d04, with no conflict. Nothing else has changed since the green run.Run 43020308064, success, on head
6058d003ce714e48f66b34aca88c78dc1ec54ccf. Configure, the nine build and test jobs (Ubuntu x64 with Java 8, 11, 17 and 21, Ubuntu ARM with Java 17, and Windows with Java 8, 11, 17 and 21) and Complete all passed on the first attempt. All 10Setting 'PullRequestSha'lines are6058d003ce714e48f66b34aca88c78dc1ec54ccf, the head, and the Configure log reads "Left out 6 macOS entries".macOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
Still to do