Repository navigation
Conversation
|
Thanks for your contribution! Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only. |
3 of 9 tasks
This branch has not been deployed
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.
Brief Information
This pull request is in the type of:
What does this PR do?
Keep missing dataset values from matching regular expression filters as the literal strings
"null"or"undefined".Fixed issues
No existing issue was found in the targeted search. The reproduction is included below.
Details
Before: What was the problem?
RegExpEvaluator.evaluatepasses the result oftypeof lValtoisStringandisNumber. Since everytypeofresult is itself a string, the string branch always runs.RegExp.testthen coerces missing values to strings instead of reaching the existing non-string/non-numberfalsebranch.For example, use this normal dataset filter:
Before this fix,
^null$selects bothmissing-nullandliteral-null. Replacing the condition with^undefined$selectsmissing-undefined,missing-property, andliteral-undefined. The same happens withRegExpobjects instead of string conditions.null/undefinedare supportedOptionDataValuevalues; absent properties in object rows also yieldundefinedthrough the normal source provider.After: How does it behave after the fixing?
Check the original value with
isString(lVal)/isNumber(lVal)so the existing type guard works as intended. The two filters select only their corresponding literal strings. Numbers still match their string representation:^42$selects bothnumberandnumeric-string.The change is limited to the guard. No comparator API, transform registration, or global/sticky regular expression
lastIndexpolicy is changed.Document Info
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
Added 10 regressions through the real
createSource/applyDataTransform/ built-in filter path, covering array rows, object rows, missing vs literal values, both supported regexp condition forms, valid numeric matches, and logical/piped filters. No comparator or classifier is mocked.On the unchanged base, 6 of the new tests fail and 4 pass. With the fix, all 10 new tests and the 8 existing data-transform tests pass:
The direct CLI source-module reproduction also confirms the before/after filtered rows. No browser or visual rendering is claimed; this is a data-filtering change, and the existing Jest data-transform suite uses jsdom/canvas mocks.
Local environment: Node 24.22.1, TypeScript 4.4.3, Jest 26.6.3, zrender 6.1.0. The canonical root and bmap typecheck commands were attempted but are blocked by 1,364 parse errors in the installed
@types/nodeand@types/babel__traversedeclarations. They are not reported as passing; no dependency or TypeScript configuration changes are included.Merging options
Other information
OpenAI Codex assisted with the unchanged-source reproduction, narrow guard change, regression tests, and verification described above.