Closed Danp2 closed 1 year ago
still need to check, but currently focusing on frames issue.
still need to check, but currently focusing on frames issue.
here is my latest opinion
https://github.com/Danp2/au3WebDriver/issues/487#issuecomment-1659380663
Please remove all $JSON_MLREFORMAT
usage
Also in wd_helper.au3
the use of StringReplace(...... , @TAB, '')
should be considered a candidate for removal.
Also in
wd_helper.au3
the use ofStringReplace(...... , @TAB, '')
should be considered a candidate for removal.
because:
$sData = Json_StringEncode($sData, $iOption) ; Escape JSON Strings
It's enough
The other question is why we always return $_WD_ERROR_Success
here:
https://github.com/Danp2/au3WebDriver/blob/c39d1f56fee86a5ebe5c9a9f9082ccdea120a5f2/wd_core.au3#L1747
Also in
wd_helper.au3
the use ofStringReplace(...... , @TAB, '')
should be considered a candidate for removal.
but maybe not? I think they are there to CleanUp the mess in sphagetthi called logs.
Also in wd_helper.au3 the use of StringReplace(...... , @TAB, '') should be considered a candidate for removal.
To me, these are two separate issues:
1) JS code submitted by the user 2) JS code supplied internally by the UDF
This PR is intended to only deal with the 1st instance.
but maybe not? I think they are there to CleanUp the mess in sphagetthi called logs.
Right... IIRC, you wanted the inline code to be more legible so this is the way it was done.
The other question is why we always return $_WD_ERROR_Success here:
IDK. We are dealing with an internal function, so it may not matter. This appears to be a carry over from before we switched to using Json_StringEncode
. I suppose we could check the error code from Json_StringEncode
, but then return a different error code if the function returned an error.
FWIW, I also noticed that the function header is missing a Return values
entry.
The other question is why we always return
$_WD_ERROR_Success
here:
This is the last question here
. I suppose we could check the error code from
Json_StringEncode
, but then return a different error code if the function returned an error.
Please propose solution.I will check when I woke up.
Looks fine for me
Pull request
Proposed changes
Fixes #487
Checklist
Put an
x
in the boxes that apply. If you're unsure about any of them, don't hesitate to ask. We are here to help!This is simply a reminder of what we are going to look for before merging your code.
Types of changes
Please check
x
the type of change your PR introduces:What is the current behavior?
Stripping of tabs and spaces from JS can result in code that no longer functions properly.
What is the new behavior?
Code is processed as-is. Any reformatting that is required should be performed prior to calling _WD_ExecuteScript
Additional context
System under test